Add jar file to buildpath at windows command prompt

I'm really tired of asking about it, but I can't get it to work. I currently have a project with:

5 Classes in the src / folder

2 JARS named profiles.jar and classifier.jar in the root folder

I want to create a "makefile"? or "batch file?" to compile and run these classes from the WINDOWS command line , but first add banks to the build path? Im not sure how i'm about it

When I try to do this, he says that the class was not found, most likely due to the fact that I did not add banks to the build path correctly. What commands do I need to use to run on the command line?

Thanks Philip

EDIT

Thanks for the help, I have a lot of problems to make it work. Currently I have a project with 5 classes in the src folder and 2 jars in the jar folder

Here are the Im commands that works:

set CLASSPATH = C: \ WAMP \ WWW \ News \ UserProfiling \ jars \ classifier.jar; C: \ WAMP \ WWW \ News \ UserProfiling \ jars \ profiles.jar

Then from the root folder Im running:

javac src / *. java

Then:

java -cp./src:./jars/* SRC / Interaction

Interaction is the main class, I get all kinds of noclass related errors, am I doing something wrong? Thank you so much philip

ERROR

java -cp./src:./jars/* "main" java.lang.NoClassDefFoundError: , : java.lang.ClassNotFoundException:          java.net.URLClassLoader $1.run( )         at java.security.AccessController.doPrivileged( )          java.net.URLClassLoader.findClass( )          java.lang.ClassLoader.loadClass( )         at sun.misc.Launcher $AppClassLoader.loadClass( )          java.lang.ClassLoader.loadClass( )          java.lang.ClassLoader.loadClassInternal( ) : . .

+4
4

Java 5 , .

java -cp a.jar:b.jar:c.jar:./src MainClass

6 , .

java -cp ./src:* MainClass

, .

java -cp ./src:./jars/* MainClass

, make start script , .

- Sun docs (v6)

- , , com.mypackage.MainClass,

java -cp ./src:./jars/* com.mypackage.MainClass

, , script. , , .

+5

ant maven. Ant - , , , maven , , .

+1

:

java -cp ./src:./jars/* src/Interaction

src/Interaction, . src ,

java -cp ./src:./jars/* Interaction
+1

, .

javac src/*. java

java -cp./src:./jars/* src/

: javac java , . src. src , /.

,

cd UserProfiling/src 

javac *.java 

java -cp .:../jars Interaction 

.

0

All Articles