Hi, Since I've re-installed my Windows system, I got a problem that when I try to compile with Ant in Eclipse, it gives me an error that the Java Compiler cannot be found ...
Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK
However, I've set an env var named JAVA_HOME to my JDK path (D:\Java\jdk1.5.0_06\) and I've also added the bin folder to the path etc. I can use the compiler on the command prompt but Ant keeps telling me this error. What would I have to do to satisfy Ant? [ April 23, 2006: Message edited by: Sascha Balkau ]
Joined: Jan 25, 2006
Ah nevermind, I have figured it out by adding the tools.jar from JDK/lib to the classpath for Ant in Eclipse.
However now I got a different problem ...
When I compile and try to run a class that is not in the default package, I get a bunch of errors ...
E:\Works\Eclipse\Java Test\bin\testpack>java Test Exception in thread "main" java.lang.NoClassDefFoundError: Test (wrong name: testpack/Test) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source)
I'm puzzled with this! What could be wrong now? Thanks for any hints!