Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

.class file execution

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ram Sudheer Mandava
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.


 
Ranch Hand
Posts: 88
Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic