I'm having a lot of difficulty doing something fairly simple... I just want to import a package in one .java file from a .jar file that's in the same directory, but javac is giving me headaches. I can't find the right command in Windows command prompt to make this compile. I keep trying stuff like:
javac NameUser.java -classpath=.;Name.jar
And more complicated variants with full path names. No joy!
I'm sure this'll be an easy one, so thanks in advance
I haven't done things from the command line in a while, so I could be off, but I think you need to put the name of the .java file at the end of the command, and the options you want to use before it:
javac -classpath=.;Name.jar NameUser.java
You might also benefit from surrounding the classpath in quotes, not sure though
javac -classpath=".;Name.jar" NameUser.java
Steve
George C Nixon
Greenhorn
Joined: Oct 21, 2009
Posts: 3
posted
0
Thanks for replying, Steve
I just tried this line (cut and pasted from my command line):
javac -classpath=".;Name.jar" NameUser.java
But I still get the messages:
javac: invalid flag: -classpath=.;Name.jar
Usage: javac <options> <source files>
use -help for a list of possible options