Bug 39194

Summary: classpath inconsistent between Windows and Unix for tools.jar
Product: Tomcat 5 Reporter: mschulz
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 5.5.15   
Target Milestone: ---   
Hardware: Sun   
OS: Solaris   
Attachments: patch for setclasspath.bat to make it consistent with the .sh version
Patch to setclasspath.sh that fixes the bug.

Description mschulz 2006-04-04 01:43:54 UTC
I have found out (the hard way) that on Unix tools.jar is not included in the
classpath, while in our Windows test envionment, it is.

I need the java compiler accessible for a 3rd-party library, coincidently
called Jasperreports.

Since the documentation states that tools.jar _is_ available,  I would ask
that it is made so by correcting setclasspath.sh, which only puts
tools.jar in the classpath for the 'debug' and 'javac' commands.

That is nt consistent with the behavior of setclasspath.bat on Windows,
which always adds tools.jar.

Thanks!
Comment 1 Warren Lewis 2006-04-05 22:05:35 UTC
Created attachment 18029 [details]
patch for setclasspath.bat to make it consistent with the .sh version

Here is a patch to setclasspath.bat to make it consistent with Remy's changes
he made to setclasspath.sh some 14 months ago.
Comment 2 Yoav Shapira 2006-04-13 21:29:43 UTC
I'm hesitant to always include tools.jar now that we don't strictly need a JDK,
and I'm not sure what the unix version does it.  Consistency is a good goal but
in this case I think we may need to go the other way, i.e. remove tools.jar from
one script instead of adding it to the other.  Please bring this up on the
tomcat dev mailing list for discussion.
Comment 3 Jason Brittain 2006-04-18 08:19:16 UTC
Created attachment 18120 [details]
Patch to setclasspath.sh that fixes the bug.

This patch fixes the bug in my 5.5.16 installation such that I can then start
Tomcat with:

$CATALINA_HOME/bin/catalina.sh javac start

and it will use the Ant Java compiler to compile JSPs without copying
tools.jar anywhere.

I believe this bug affects the latest source, and this patch fixes it, at
least on the non-windows OSs.
Comment 4 Mark Thomas 2009-07-05 15:50:59 UTC
This has been fixed in trunk along with a handful of other script niggles.

All the fixes have been proposed for 5.5.x and 6.0.x
Comment 5 Mark Thomas 2009-07-12 09:32:33 UTC
The fixes for the niggles have been applied and will be in 5.5.28 and 6.0.21.

The main fix was veto'd due to the incomplete implementation of the javac option and lack of documentation about what it was supposed to do. A new patch has been proposed which removes the javac option. tools.jar can be added to the classpath using the setenv script.
Comment 6 Mark Thomas 2009-07-17 03:53:47 UTC
This has been fixed in 6.0.x and 5.5.x and will be in 6.0.21 and 5.5.28 onwards.