Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Lomboz plugin with Eclipse



Paul Lalonde <email@hidden> wrote:

>My memory is a bit blurry, but IIRC I tried specifying the path to the
>classes.jar file. I also tried creating the symlink in other
>locations, such as under /Library/Java/Home.

I see no reason why those would not have worked. It may be something
unrelated to "tools.jar" itself, such as file-permissions.


>I'm a Java newbie, so classloader subtleties kinda go over my head. I
>was just trying to get the plugin to work. I have no idea what Lomboz
>does with the path to tools.jar. All I know is it needs it and doesn't
>function without it. Someone did raise the issue of their dependency
>on tools.jar on their user forum, and their answer was "it's the only
>way" to do what they need to do. Maybe they are incorrect in saying
>that, but who am I to say?

Maybe you can't say, but you can certainly question WHY "it's the only way".


It's not easy to figure out how the Lomboz plugin is using the path to
"tools.jar", not even after searching the entire source tree for it.

Oh, it's easy to find the "tools.jar" reference:
src/com.objectlearn/jdt/j2ee/ui/preferences/J2EEPreferencePage.java:
112: public static String fgTOOLSJAR = "//jdk/lib/tools.jar";

It's also easy to find where it's stored, bound to the variable-name
"JDK_TOOLS", in the same J2EEPreferencePage class.
342: Util.addClasspathVariable("JDK_TOOLS", fTools.getText());

But finding where the value itself is used, and what for, is not so easy to
track down.


However, the JDK_TOOLS variable appears to be used solely to augment the
classpath being passed to the app-server, or passed to other programs or
processes. The evidence is in a number of *.server files in the Lomboz
source tree, as the JDK_TOOLS <jar> element. A recursive grep shows plenty
of these, apparently for any number of app-servers (JBoss, Tomcat, Resin,
etc.).

The reason for specifying JDK_TOOLS as a classpath entry appears to be that
the Java compiler class sun.tools.Javac is used by some of these programs,
or by the app-server itself, or perhaps all the above. Hard to say, since
I'm not a JSP expert.

However, the path to "tools.jar" should work fine on Mac OS X if it's just
set to something innocuous but accessible, such as ".". The reason this
should work is that the desired class sun.tools.Javac, as supplied by Sun's
optional JDK file "tools.jar" elsewhere, is already present by default in
the Mac OS X boot-classpath. In short, it can already be found WITHOUT a
"tools.jar".

Since all the sun.tools.* classes of interest are available by default in
the boot-classpath, "it's the only way" is false in this case. Specifying
an overt classpath entry is NOT the only way, and it's NOT a necessity to
have a specific JDK_TOOLS classpath entry, either.

It may well be a *design* necessity because all the JSP pages and whatnot
have an overt entry for that classpath item, but that's a consequence of
the software's design. It's definitely NOT a consequence of the JVM or the
JRE or even the vendor's Java installation, be that Sun or Apple or
whoever.

Still, if "." or something else innocuous doesn't work, it's not clear to
me why not, assuming I correctly understand how the path to "tools.jar" is
actually being used. Maybe I don't understand its usage, but it shouldn't
take a rocket scientist to figure it out.

I'm neither a rocket scientist nor a JSP expert, and I don't play one on
TV, but maybe "It's the only way" should be revised to "It's the only way
we thought of doing." This at least makes it clear it was their own design
decision, and not an inevitable requirement of Java portability.

-- GG
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: Using Lomboz plugin with Eclipse (From: Greg Guerin <email@hidden>)
 >Re: Using Lomboz plugin with Eclipse (From: Paul Lalonde <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.