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

Summary: No support in GUI for tools.jar in classpath
Product: java Reporter: Stacy <stacy>
Component: PlatformAssignee: Tomas Zezula <tzezula>
Status: NEW ---    
Severity: blocker CC: jglick, mgrebac
Priority: P3    
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 41535    

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 project.properties 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 build.properties 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:
javac.classpath=${platforms.MyPlatform.home}/lib/tools.jar
Comment 7 Jesse Glick 2006-08-28 20:40:02 UTC
For default Java platform you can simply use

javac.classpath=${java.home}/../lib/tools.jar

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.