Enabling CodeSense for 3rd Party Jars
Let's say you have a bunch of jars added to your
/Library/Java/Extensions folder and you want to have the benefit of CodeSense
for those classes. Read on .......
NOTE: I am still using 10.3.7 and XCode 1.5 ....
don't want to live on the bleeding edge of Tiger and XCode 2.1.X until we can
afford to upgrade our application
servers!Using Terminap.app, navigate
to the folder having the JavaIndex.xcode
template:$ cd /Developer/Extras/Xcode\
Index\ Templates/JavaIndexOpen the
JavaIndex.xcode project in XCode$ open
JavaIndex.xcodeBy default, this has
classes.jar and ui.jar in it. If they are in red font, that means it cannot find
those jars. Probably means that they are pointing to a now missing 1.4.1 VM jar.
To fix the red font, click on the file and click Info and use the Choose button
to navigate to the jar. For example the Java 1.4.2 VM classes.jar path
is:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/classes.jarNow
right-click on the project icon in the "Groups & Files" pane and select
Add/Existing Files... from the
menu.Navigate to
/Library/Java/Extensions and add all the jars you want code sense for to the
project.
Save
and close the JavaIndex project.Now
create index in your preferences using Terminal (while still in the JavaIndex
project folder):$ xcodeindex -destPath
/Users/kieran/Library/Application\ Support/Apple/Developer\ Tools/Index\
TemplatesClose XCode and relaunch (or
log out/in if you encounter
problemsNow just use it. Shown here is
the jakarta commons lang StringUtils class being
"codesensed":
Posted: Wednesday - June 22, 2005 at 05:14 PM