Captain's Universe Home
Captain's Universe Home
Cosmic Ray Muon DetectorTeleGarden Pages
Time on MarsBryophyllum Plants
Jupiter Radio AstronomyAncient Pages
Salzburg Tourist GuideEarth Magnetometer
  H O M E     AJAX & MORE     LINUX & MORE     RTAI     XENOMAI     ADEOS IPIPE      
    JAVA & BROWSERS     *NIX     ELECTRONICS     REVIEWS     ARTEMIA     FAIRY SHRIMP      



java.lang.NoClassDefFoundError - javac: target release 1.1 conflicts with default source release 1.5

If you get a java.lang.NoClassDefFoundError error with a java applet in MicroSoft's Internet Explorer IE, but not in NetScape/Mozilla/Firefox it's most likely due version 1.5 of Java.



Compiling the applet with the target option will help, but it's a bit tricky in Java 1.5.
When I compiled my applet with
# javac -O -target 1.1 applet.java
it failed with
javac: target release 1.1 conflicts with default source release 1.5
So I removed the target, but that didn't work. This actually resulted in the java.lang.NoClassDefFoundError.



SOLUTION: Specifying -source 1.1 doesn't work too, but this seems to work:
# javac -O -target 1.1 -source 1.2 applet.java

This also prevents the "Applet Notinited" error e.g. with the Microsoft Internet Explorer JAVA plugin.

If you make a jar-file, don't forget to include the manifest.mf:
Manifest-Version: 1.0
Main-Class: applet
Created-By: 1.3(Sun Microsystems Inc.)
jar cvfm applet.jar manifest.mf applet.class
...and if the applet is located in i.e. captain.at/applet/ don't forget the codebase:
<applet code="applet.class" archive="applet.jar" width="500" height="700"
codebase="/applet/"></applet>


Last-Modified: Mon, 26 Jun 2006 15:57:20 GMT

Google
 
Web www.captain.at
go to top
© 1996-2010 . All rights reserved.
No reproduction, distribution, publishing or transmission of the copyrighted materials at this site is permitted. Policy
go to top