wood burning stoves 2.0
The moose likes Beginning Java and the fly likes CLASSPATH in .bat file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "CLASSPATH in .bat file" Watch "CLASSPATH in .bat file" New topic

CLASSPATH in .bat file

Prabha Dhandapani
Ranch Hand

Joined: Sep 11, 2003
Posts: 70
Hello everybody,
I have a .bat file as follows

When I run this bat file it says that the class cannot be found...I have to do this today...Any help ASAP is appreciated
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299
This might work better:

You have to put Windows/Dos system variables in %
Having said that, I would NOT recommend doing it this way.
I would just do
java ThreadCall -classpath C:\TestPrograms\all.jar
or better yet, make the .jar executable and use
java -jar C:\TestPrograms\all.jar

My Java Freeware:<br />MACCC - <a href="http://maccc.pipasoft.com" target="_blank" rel="nofollow">http://maccc.pipasoft.com</a><br />Nator - <a href="http://nator.pipasoft.com" target="_blank" rel="nofollow">http://nator.pipasoft.com</a>
Prabha Dhandapani
Ranch Hand

Joined: Sep 11, 2003
Posts: 70
Thanks Brian!I put it this way but it still doesnt work...Is there anything that I need to setup in the environent variables by going to the control panel???
C:\>java ThreadCall -classpath C:\TestPrograms
Exception in thread "main" java.lang.NoClassDefFoundError: ThreadCall
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

This way '-classpath ..' is interpreted as parameter for the 'ThreadCall'.
You have to arrange it the other way round:

Now it's an parameter for the jvm.

Have you checked out Aspose?
subject: CLASSPATH in .bat file
It's not a secret anymore!