This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 46866 - No support in GUI for tools.jar in classpath
Summary: No support in GUI for tools.jar in classpath
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Platform (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Tomas Zezula
Depends on:
Blocks: 41535
  Show dependency tree
Reported: 2004-08-03 16:30 UTC by Stacy
Modified: 2011-08-31 14:05 UTC (History)
2 users (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Stacy 2004-08-03 16:30:37 UTC
I am trying your new version of NetBeans with new
Projects, now. Platform support is really cool
thing for me!
I typically test my application on different JDKs
(1.4 & 1.5). But I have problem with some JDK
specific libraries. There is no way how to
register some Library for some specific platform.
For example tools.jar. There are two different
versions of this library for different JDKs. And I
each thime I change the platform, I have to change
version of library manually. This is really
disturbing, and I do not see any other solution
how to do it.
Comment 1 Petr Hrebejk 2004-08-03 16:35:40 UTC
Rather an enhancement than P2 defect I would say.
Comment 2 Jesse Glick 2004-08-03 16:45:40 UTC
You need only edit the classpath for your platform definitions to
include tools.jar, then you do not need a library definition at all.
Comment 3 Tomas Zezula 2004-08-03 16:49:20 UTC
There is no UI for it but it can be done in the build script, but it
is not easy.
I am not going to introduce library to platform dependency, but in the
next release (promo-E) the platform will allow user to change the
bootstrap libraries (and probably also standard libraries) in the
platform customizer.
Then you will be able to add the tools.jar into the platform specific
boot/standard classpath.
Comment 4 Tomas Zezula 2004-08-03 16:51:31 UTC
This seems to me to be a quite valid requirement for enhancement of UI
of PlatformManager. Reopening it.
Comment 5 Martin Grebac 2006-08-25 09:02:22 UTC
 I was trying to port some project to Netbeans. I had hard times, and had to do
a lot of manual work editing and project.xml, because the UI
very often added or replaced relative references as absolute, ... but I was able
to overcome this by manually editing the file. 
 The blocker for me however is adding tools.jar to the classpath of the project
(shared in cvs of course), so that it works for everybody. I don't know how to
do it, and I doubt there's a reasonable way to do it, thus raising priority of
the enhancement and changing target milestone. I hope NB 6 will be able to
address the problem.
 To the proposal of enhancement - possibility of adding tools.jar into classpath
is a little way around it, but then everybody has to tweak his platform in the
beginning to add this jar manually. I'd prefer a way to be able to reference jdk
jars through somehow.
Comment 6 Tomas Zezula 2006-08-25 13:16:38 UTC
To Martin:
Anything added to the project's compile, execute classpaths is relative if
possible (it has a common disk root).
The problem with tool.jar is another one, it should be relativized to JDK not to
the project. Currently there is no way how to solve it, it would require project
to let change the JVM classpath. You can work around it by using non default
platform and adding tools.jar in the following way:
Comment 7 Jesse Glick 2006-08-28 20:40:02 UTC
For default Java platform you can simply use


Of course this is not portable to non-Sun JDKs, but then using tools.jar implies
nonportability anyway.
Comment 8 Jesse Glick 2006-08-28 20:41:34 UTC
Probably should just be WONTFIX with a FAQ entry.
Comment 9 Jesse Glick 2006-08-28 20:46:08 UTC
Or ReferenceHelper.addExtraBaseDirectory may be able to infer a proper relative
path if you just add tools.jar via file chooser from Add JAR/Folder, just as it
infers ${basedir}/${relpath}. With the API as it currently stands,
${platforms.MyPlatform.home}/lib/tools.jar would work but
${java.home}/../lib/tools.jar would not (as the method requires a property name,
not an unevaluated text fragment).
Comment 10 Martin Grebac 2006-08-28 20:58:03 UTC
WONTFIX? I'm really confused by the different comments. I think I tried
${java.home} for sure, but it didn't work. I'll try again, though.