File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "CLASSPATH in .bat file" Watch "CLASSPATH in .bat file" New topic
Author

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
Thanks,
Prabha
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
Brian


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
Thanks,
Prabha
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.


http://home.arcor.de/hirnstrom/bewerbung
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CLASSPATH in .bat file