Computing Magazine

Javac Error Using Classes from Rt.jar

Posted on the 17 January 2013 by Abhishek Somani @somaniabhi
i was setting my shopizer development , i faced this problem . i tried to build the project using ant and was getting exception in compilation where it could not find classes related to rt.jar in library of jre . i have included the path in ant class path still getting the same error :
com.sun.image.codec.jpeg.JPEGCodec can not find package 

java.lang.ClassNotFoundException JPEGCodec
the reason for this was :
when javac compiles the code , it tries to find the files in rt.jar in a symbol file called ct.sym (which is also present in lib directory). some files are missing in this symbol file.
i have to add a compile option to ignore symbol file and look directly in rt.jar.
so i have used this option -XDignore.symbol.file
for ant i put this value in javac tag
it works perfectly if you use eclipse or any other ide .
<compilerarg value="-XDignore.symbol.file" />

Back to Featured Articles on Logo Paperblog

Magazines