Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Repair XCode 1.5 documentation and code completion Apps
Apple recently updated XCode to version 1.5. One of the changes was the addition of Java code completion. This is a feature I highly anticipated. But it turned out that it was broken. Especially with the built-in classes, which where hardly ever recognised.

The first time you want to view the Java documentation, you have to unarchive it with a script that Apple provides. It turns out that this script calls a helper Application named pbhelpindexer, which indexes all the html files for searching and code completion.

After a little experimentation I found that this application searches for a specific file called "MacOSXDeveloper.pbHelpIndexerList" in /Developer -> Documentation -> Help -> Developer Help Viewer. In this file the location of the html pages are stored. If it doesn't find this file, it searches for the documentation at the default location. Unfortunately Apple changed the default location from /Developer -> Documentation to /Developer -> ADC Reference Library, and didn't tell this to the application. But interestingly enough, they updated the file.

The solution is simple: Open Terminal and then do:
sudo cp "/Developer/ADC Reference Library/documentation/Help/Developer\
 Help Viewer/MacOSXDeveloper.pbHelpIndexerList"\
 "/Developer/Documentation/Help/Developer Help Viewer/"
Enter that as one long line; it should copy and paste correctly with the backslashes. Next, run the command:
sudo /Developer/Tools/pbhelpindexer
Enter your admin password when prompted. After the command is finished, code completion and documentation search should work fine again. I didn't find this documented anywhere, neither at macosxhints nor at Apple's developer place. I hope it helps someone.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[17,885 views]  

Repair XCode 1.5 documentation and code completion | 9 comments | Create New Account
Click here to return to the 'Repair XCode 1.5 documentation and code completion' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Repair XCode 1.5 documentation and code completion
Authored by: jcbeckman on Sep 01, '04 12:42:31PM

Thanks! I wanted this feature too and was disappointed in how it worked - until now.



[ Reply to This | # ]
Repair XCode 1.5 documentation and code completion
Authored by: markian on Sep 01, '04 03:50:56PM

I had this problem recently. Someone on the xcode list suggested that I install the latest Java SDK. (1.4.2 update 1)

I did, and that also seems to have solved the problem. at least, I can now browse java documentation.



[ Reply to This | # ]
Repair XCode 1.5 documentation and code completion
Authored by: adrianm on Sep 01, '04 12:56:02PM

I have 1.5 installed and don't have the problem you describe.

Xcode IDE: 389.0
Xcode Core: 387.0
ToolSupport 372.0

Installed clean though, on new machine.
Maybe the problem is just in upgraded Xcode installs?



[ Reply to This | # ]
Repair XCode 1.5 documentation and code completion
Authored by: hedgepig on Sep 01, '04 01:55:26PM
I tried running the shellscript that expands the jar archive for the API documentaion but I get the following errors:

java.io.FileNotFoundException: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/docs.jar (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:106) at java.io.FileInputStream.(FileInputStream.java:66) at sun.tools.jar.Main.run(Main.java:185) at sun.tools.jar.Main.main(Main.java:904) java.io.FileNotFoundException: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/appledocs.jar (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:106) at java.io.FileInputStream.(FileInputStream.java:66) at sun.tools.jar.Main.run(Main.java:185) at sun.tools.jar.Main.main(Main.java:904)

And then when I click the HTML link in the Documentation Window of Xcode I see in the status line:
File not found: /Developer/ADC Rference..../doc/api/index.html
In the terminal I see that the symlink that should point to the appledoc directory just points to nowhere(the directory doesn't exist with the api documentation). The real api documentation is nowhere to be found.
anyone has experienced this? I am using xcode 1.5 and have not unpacked the java api before. maybe that is the problem

[ Reply to This | # ]
Repair XCode 1.5 documentation and code completion
Authored by: yuck72 on Sep 02, '04 05:40:37AM

That sounds like you updated your Java installation (1.4.2) without installing the corresponding Java Developer Tools (separate package available via ADC connect.apple.com (free membership is enough).

Installing a Java Update on the Mac is like installing a JRE on another system - but you want the Javadocs, headers, etc... Download the additional Java Developer package from ADC and install it, unpack the Javadocs with the provided shell script and try again



[ Reply to This | # ]
Repair XCode 1.5 documentation and code completion
Authored by: hedgepig on Sep 02, '04 08:51:29AM

Thanks, that did the trick!



[ Reply to This | # ]
Another thing to check...
Authored by: machakkr on Feb 05, '05 03:40:58PM

Another thing to check if code completion is not working the way you expect is this:

Select your main project icon in the Groups and Files outline section on the left. Cntrl-click on it and pick Get Info. On the project info inspector that opens up, select the Code Sense tab and check your settings there. These could be different from the Code Sense settings in the Xcode preferences (in the Navigation section), which will cause it to work in a way that you don't expect.



[ Reply to This | # ]
Repair XCode 1.5 documentation and code completion
Authored by: ld on Mar 02, '05 10:03:16PM

Changing the location of the file is not necessary. You don't need to change the script either.

Providing an argument (as specified) in the Release Notes as below is all you need to do.

e.g.,
/Developer/Tools/pbhelpindexer -o "/Developer/ADC Reference Library/documentation/Help/Developer Help Viewer/"

However, the thing that is broken (but easily fixed) is the original index templates provided. Simply open up the Java related templates and fix the broken links to the java jar files.

i.e., if you open up one of the index templates you'll notice that the java jar files are in red. They are still pointing to the following location:

/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/ etc.

This should be 1.4.2.

The templates are found in:
"/Developer/Extras/Xcode Index Templates"

---
regards,
LD



[ Reply to This | # ]
I had the same problem, this fixed it.
Authored by: BrunoUsesBBEdit on Mar 06, '05 12:38:24AM
I was going crazy over this. I am learning Java in my free time. This usually involves my wife's 12" powerbook and no network connection. Let's face it, without complete documentation a beginner has no chance of getting anywhere. Thanks for this hint! (BTW, the file you are looking for is Java142Update1Tools.dmg)

For those of you trying to learn Java, I have to recommend Jurtle. I am an expert PHP developer, but making the transition to Java was very intimidating. I had tried to learn it several times dating back to before I was a Mac user. Although I use OOP in PHP, I just couldn't grasp it. Having to know what libraries to import and such was always just too much for me. But I finally forced myself to go threw to lessons in Jurtle, and I'm very pleased with the result.

---
--==<< R i c h a r d B r o n o s k y >>==-- ---

[ Reply to This | # ]