DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18055>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18055

javac task includes java rt.jar in classpath when using jvc compiler

           Summary: javac task includes java rt.jar in classpath when using
                    jvc compiler
           Product: Ant
           Version: 1.5.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Core tasks
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


When using Microsoft's jvc compiler for the javac task, rt.jar from the Java
install running Ant gets included in the compilation classpath. This is a
problem since code meant to be compiled with jvc is linked against Sun class
libraries which leads to compilation errors.

Delving into the addJavaRuntime() method in org.apache.ant.tools.types.Path
reveals the following statement intended to be called when using the jvc 
compiler:

if
(System.getProperty("java.vendor").toLowerCase(Locale.US).indexOf("microsoft")
>= 0) {
   ...
}

The problem is this will never get called, as System.getProperty("java.vendor")
will return the vendor of the Java install being used to run Ant. Instead, the
method will (incorrectly) add the rt.jar of the Java install running Ant.

This can be fixed by altering includeJavaRuntime in
org.apache.tools.ant.taskdefs.compilers.JVC to always be false if no
bootclasspath has been supplied.

Reply via email to