ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 6945] New: - java task with JDK 1.1.8 - can't change JAVA_HOME env setting
Date Thu, 07 Mar 2002 04:05:15 GMT
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=6945>.
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=6945

java task with JDK 1.1.8 - can't change JAVA_HOME env setting

           Summary: java task with JDK 1.1.8 - can't change JAVA_HOME env
                    setting
           Product: Ant
           Version: 1.4.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: shinsato@inxight.com
                CC: shinsato@inxight.com


I'm trying to run a JUnit test in JDK 1.1.8 (while running ANT in JDK 1.3.1), 
but I'm getting errors because I can't change the JAVA_HOME setting.  I could do 
this with a Windows exec call, which would really suck because it would not be 
platform independent.  I can change the JVM, it seems I should also be able to 
change the JAVA_HOME setting along with that from the java task.

This is an issue for anything that has a jvm property.  Even better is if I 
could do the same for the JUnit task.
  <target name="tests-118" depends=""> <!--jar-dist,compile-tests"-->
    <property environment="env"/>
    <property name="env.JAVA_HOME" value="${jdk_1.1.8_home}"/>
    <echo message="JAVA_HOME = ${env.JAVA_HOME}"/>
    <java
       classname="junit.textui.TestRunner"
       dir="${unittests}"
       fork="true"
       failonerror="true"
       jvm="${jdk_1.1.8_home}/bin/java"
    >
       <arg value="MyTest"/>
       <sysproperty key="JAVA_HOME" value="${jdk_1.1.8_home}"/>
       <sysproperty key="PATH" value="${jdk_1.1.8_home}/bin"/>
    </java>

makes error ....
tests-118:
 [property] Loading Environment env.
 [property] Override ignored for env.JAVA_HOME
     [echo] JAVA_HOME = c:\jdk1.3.1
     [echo] ANT_HOME is set to = c:\jakarta-ant-1.4.1\bin\\..
     [java] Forking c:\jdk1.1.8\bin\java -classpath C:\jdk1.1.8\lib\classes.zip;
C:\jdk1.1.8\lib;D:\cprj\ant\unittests;D:\cprj\ant\allsources\extjars\junit.jar 
junit.textui.TestRunner MyTest
     [java] .........................................
     [java] MimeTable.load: file = c:\jdk1.3.1\lib\content-types.properties, jav
a.io.FileNotFoundException: c:\jdk1.3.1\lib\content-types.properties
     [java] java.io.FileNotFoundException: c:\jdk1.3.1\lib\content-types.propert
ies
     [java]     at java.lang.Throwable.<init>(Throwable.java:74)
     [java]     at java.lang.Exception.<init>(Exception.java:38)
     [java]     at java.io.IOException.<init>(IOException.java:38)
     [java]     at java.io.FileNotFoundException.<init>(FileNotFoundException.ja
va:35)
     [java]     at java.io.FileInputStream.<init>(FileInputStream.java:49)
     [java]     at java.io.FileInputStream.<init>(FileInputStream.java:68)
     [java]     at sun.net.www.MimeTable.load(MimeTable.java:205)
     [java]     at sun.net.www.MimeTable.<init>(MimeTable.java:36)
     [java]     at sun.net.www.MimeTable.getDefaultTable(MimeTable.java:45)
     [java]     at sun.net.www.protocol.file.FileURLConnection.connect(FileURLCo
nnection.java:45)
     [java]     at sun.net.www.protocol.file.FileURLConnection.getInputStream(Fi
leURLConnection.java:155)
     [java]     at MyTest(Unknown Source)
     [java]     at junit.framework.TestCase.runTest(TestCase.java:156)
     [java]     at junit.framework.TestCase.runBare(TestCase.java:130)
     [java]     at junit.framework.TestResult$1.protect(TestResult.java:106)
     [java]     at junit.framework.TestResult.runProtected(TestResult.java:124)
     [java]     at junit.framework.TestResult.run(TestResult.java:109)
     [java]     at junit.framework.TestCase.run(TestCase.java:121)
     [java]     at junit.framework.TestSuite.runTest(TestSuite.java:157)
     [java]     at junit.framework.TestSuite.run(Compiled Code)
     [java]     at junit.framework.TestSuite.runTest(TestSuite.java:157)
     [java]     at junit.framework.TestSuite.run(Compiled Code)
     [java]     at junit.framework.TestSuite.runTest(TestSuite.java:157)
     [java]     at junit.framework.TestSuite.run(TestSuite.java:152)
     [java]     at junit.textui.TestRunner.doRun(TestRunner.java:74)
     [java]     at junit.textui.TestRunner.start(TestRunner.java:235)
     [java]     at junit.textui.TestRunner.main(TestRunner.java:108)
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] .........................................
     [java] ...............
     [java] Time: 18.506
     [java]
     [java] OK (261 tests)
     [java]

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message