ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Klas Eriksson <klas.eriks...@micronic.se>
Subject junit and fork:ed non-jre jvm
Date Fri, 06 Aug 2004 11:17:10 GMT
Hi
 
How to use junit+fork but still use jdk/bin/java and not jre/bin/java?
---
I have a unit test that internally use the java compiler from Sun:
com.sun.tools.javac.Main
it is defined in lib/tools.jar that normally is included in jdk/bin/java.
(I use junit fork=true as a workaround for:
java.lang.LinkageError: loader constraints violated when linking
org/w3c/dom/Document class
works fine.)
 
But fork changed jvm from jdk/bin/java to jre/bin/java
that doesn't include the class com.sun.tools.javac.Main.
 
So, I tried to force junit/fork to use jdk/bin/java with the 'jvm'
attribute:
<junit fork="true" jvm="${env.JAVA_HOME}/bin/java.exe">
I see that I now run the jvm I want, but it is tweaked by junit not to
include tools.jar.
I still get:
java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
 
If I remove the 'fork=true' attribute, the class is found and the test works
fine,
but then other tests that use xml get the LinkageError above.
 
Any clue why? How do I run the jdk/bin/java booted as *usual*?
 
/klas

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message