java - Include Swing when compiling with javac -


i compile , jar source fine, when run it, complains:

java.lang.classnotfoundexception: javax.swing.jpanel

i guess have include swing library when compiling, how do that?

i included every rt.jar on system:

javac -classpath /usr/lib/jvm/java-1.5.0-gcj-4.4/jre/lib/rt.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/rt.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar:/home/me/equinox.jar *java 

still compiles fine, still crashes when run.

it looks using gcj. it's old project attempted produce java implementation pure open source.

they got halfway, implementation far perfect. these days, it's better avoid entirely , instead use openjdk (or oracle/sun jdk, if open source not requirement).

on ubuntu can use update-java-alternatives configure system different java implementation:

sudo update-java-alternatives -s java-6-openjdk 

by way, never need specify rt.jar explicitly on classpath, it's available automatically. also, using multiple rt.jar different jvms recipe disaster.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -