Reputation: 145
I want to run the java class file that uses a external jar file , How to compile it. below is my command ,that i have tried it.
javac set classpath="d:\vinod\text.jar" Generate.java
Upvotes: 3
Views: 124
Reputation: 13872
Try:
set path = %path%;"d:\vinod\text.jar"
javac Generate.java // Or use -cp <path> command line argument
java Generate // if main method is present in Generate class.
Upvotes: 1
Reputation: 87
use eclipse IDE to add the external jar file easily. just select the project and press alt+enter then java build path , add the external jar file and refresh the eclipse.
Upvotes: 0
Reputation: 10098
say javac -cp d:\vinod\text.jar" Generate.java
or set the environment variable CLASSPATH to point to the text.jar
file and say javac Generate.jar
to run the file you need to use the same arguments with the java
program instead of javac
.
Upvotes: 1