Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Defining batch files with classpath variables

 
ramya narayanan
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
In another topic, while discussing about using third party jars I was told that we can use batch files with classpath variables.
As far as I know a batch file is similar to a text file only with a extension .bat.
Is it correct?

a.bat:


I want to know in using 3rd party jar, how can we use these batch files?
Regards.
 
Maneesh Godbole
Saloon Keeper
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not understand why you are considering the batch file approach. If you switch platforms, you will have to go through the trouble of modifying the bat file to a shell script or something similar.

You can always define the classpath in your jar's manifest file.
Something like

Notice the white space between the two jars.

Check this out for more detailed information
http://www.j2ee.me/docs/books/tutorial/deployment/jar/downman.html
[ December 22, 2008: Message edited by: Maneesh Godbole ]
 
ramya narayanan
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The link was very useful but somehow I cannot sync what's the use of this article with my post here.
But anyhow thanks.
Regards.
 
Maneesh Godbole
Saloon Keeper
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought the article would be more helpful, as it described in more details, how to set the class path element in the manifest file to point to various external jars.
 
Campbell Ritchie
Sheriff
Pie
Posts: 48946
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
3rd-party jars? No longer a beginner's topic . . . moving.

Batch files are in fact text files with a .bat extension, but they are liable to be executed by a DOS or Windows computer automatically, maybe even at start-up time. That's about as much as I know about them.
You might do better to create an executable .jar with the 3rd-party jar specified in the manifest file. Look in the Java Tutorials: this section.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic