Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Setting classpath in java

Name: Anonymous 2011-04-19 16:22

Hey /prog/ I have a question about running an application that uses a .jar file.  If I have a file outside called Tester.java that uses a jar file, let's call it myJar.jar, and let's say the classes are packaged as myPackage.myClasses. I imported all the classes I needed using

import myPackage.myClasses.className;
in Tester.java, and when I go to compile it I typed
javac -cp ./:myJar.jar
myJar is in the same directory as my Tester.java file
Then to execute it i typed
java -cp ./:myJar.jar
and I got a java.lang.ClassNotFoundException(wrong name: myPackage/myClasses/Tester)

It seems like it is looking inside the jar file for the Tester class, when it is in my current directory.  How do I get it to execute the Tester class?  Any help would be appreciated

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List