[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[News.eclipse.technology.cme] solution ClassNotFoundException com.sun.tools.javac.Main

If you try to compose a concern and got the following error 
"java.lang.ClassNotFoundException: com.sun.tools.javac.Main
Internal error: compilation of generated construction classes failed."
like I did, here is the solution:

The problem was that the cme was looking for the sdk directory in the
wrong place. After installing jsdk 1.4.2 under windows using the default
options,
it created the folowing 2 directories on my computer: 
c:/j2sdk1.4.2_0 and
c:/program files/java/j2re1.4.2_0
Eclipse 2.1 uses the runtime java from the directory c:/program
files/java/j2re1.4.2_0 instead of c:/j2sdk1.4.2_0/jre which gives an error
when trying to compose a concern when searching for the compile method in
the sdk using a relative path.

The solution is to change the path for the runtime java in the eclipse
preferences window to c:/j2sdk1.4.2_0/jre. Btw, a clearer error would have
saved me a lot of searching (a try catch around ClassLoader.loadClass
in org.eclipse.cme.util.env.DefaultJavaCompiler)