| Author |
.class file execution
|
Ram Sudheer Mandava
Greenhorn
Joined: Aug 04, 2010
Posts: 22
|
|
Hi All,
I'm supporting one java application. In that Windows system we have one batch file
example.bat
java -classpath "E:\Data\Scripts_in\Pre-Processing;E:\Data\Scripts_In\Pre-Processing\log4j-1.2.15.jar" HelloWorld
the above line is the content in the batch file. Now my question is How can i run that batch file in another windows system?
anyone please help me on this
|
 |
Mohamed Sanaulla
Bartender
Joined: Sep 08, 2007
Posts: 2946
|
|
There should be an option to pass the path of the jar or class file as a command line argument.
And this is not specific to JSPs though.
|
Mohamed Sanaulla | My Blog
|
 |
Ram Sudheer Mandava
Greenhorn
Joined: Aug 04, 2010
Posts: 22
|
|
|
Sorry, I didn't get what you are saying? and log4j.jar file and .class file are in same directory. When run the batch file, .class file is not executing.
|
 |
Mohamed Sanaulla
Bartender
Joined: Sep 08, 2007
Posts: 2946
|
|
You earlier said:
Ram Sudheer Mandava wrote:
Now my question is How can i run that batch file in another windows system?
As the location of your jar and class files will not be same in different systems, I suggested you take the input for your -classpath as an command line argument to the bat file.
|
 |
Shashank Ag
Ranch Hand
Joined: Dec 22, 2009
Posts: 88
|
|
You do not need to give absolute path of jar in batch file, relative path can also do.
I'll suggest to package your application as:
in batch file write:
java -cp ../lib/log4j.jar;../lib/<your app>.jar;. java <class name>
|
SCJP 91%, SCWCD 97%
|
 |
 |
|
|
subject: .class file execution
|
|
|