Hi,
In order to be able to work on a school project, i have to add several classes and jar s to the java class path. How do i do this?
thx
Hi,
In order to be able to work on a school project, i have to add several classes and jar s to the java class path. How do i do this?
thx
you can use the -cp or -classpath switch directly on your command line when launching your application:
Code:java -cp somejar.jar exampleClass
But i want to add several classes and jars to the class path so this method is not sufficient.
if you type java -? you'll get a list of all switches, and:
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A : separated list of directories, JAR archives,
and ZIP archives to search for class files.
that is, you can put a list of : separated items if you need to.
I don't want to use packages only when i run my program, i also want them to compile my classes in eclipse.
In eclipse you have to define in
- Project
-- Properties
in Java Build Path
under the tab "Libraries":
all the jars folders that you want in your class path
There seems to be a problem when i want to import a folder that contains only classes, not jars.
Exactly what is the problem?
I don't use Eclipse, but I think if anyone is to give a useful answer to your question, they'll need more specific descriptions.
Right click your Project > properties > java build path > libraries tab. There you've got different options like "add external jar", "add library" and "add class folder", so that should be pretty intuitive.
Hi,
what i actually want to do, is to add some jars and paths to the system variable classpath. (or that is what i should do in windows)
for example, i need to add:
folder a, b and c, d.jar, c.jar, e.jar
to the system variable classpath. This way i can also run my application within the terminal.
Bookmarks