• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

executing class files held in different jar files from Dos

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, yesterday i posted a question in the java intermediate section regarding the execution of a java class from a dos batch command. my question was as follows
"Hi,
I am trying to execute a java class from a dos batch file. The java class exists in a jar file on my Jrun application server.
I have successfully executed java classes from batch commands before, however on these instances the java class did not reside in a jar file. In this instance, I cannot seem to execute my java class that resides in my jar file.
My batch command is as follows
C:\jdk1.3\bin\java -cp d:\Allaire\jrun\servers\server10\default-app\web-inf\classes\utils.jar dev.projectA.utils.TriggerEmailDispatchTest
When I try to execute the batch command it seems as if it has run currently, however it does not execute my Java class as rewquired.
Can you see where I am going wrong? Or what do I need to do differently to execute a java class from a dos batch file?
The reason I am executing this from a batch file is because i will be adding this to my windows scheduler to run at scheduled times.
Cheers in advance for the help. "

The answer I received and accepted was as follows:
"C:\jdk1.3\bin\java -cp .;d:\Allaire\jrun\servers\server10\default-app\web-inf\classes\utils.jar dev.projectA.utils.TriggerEmailDispatchTest"
This solved my problem to run my TriggerEmailDispatchTest class which sits in my utils.jar file.
However the TriggerEmailDispatchTest class uses a class (AccountSysHome) which is held in another jar file. This jar file is d:\Allaire\jrun\servers\server10\default-app\web-inf\classes\remoteAndHomeInterfaces.jar
I cannot seem to instantiate my AccountSysHome class as it cannot seem to be found from my TriggerEmailDispatchTest class held in my utils.jar file.
Does anyone have any suggestions as to how I can get this working.
Thanks in advance
[ January 21, 2003: Message edited by: Fergus Red ]
 
Fergus Red
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all, I managed to get this working myself - cheers all the same. My answer was as follows.
To execute the following.

C:\jdk1.3\bin\java -cp .;d:\Allaire\jrun\servers\server10\default-app\web-inf\classes\utils.jar;d:\Allaire\jrun\servers\server10\default-app\web- inf\classes\remoteAndHomeInterfaces.jar dev.projectA.utils.TriggerEmailDispatchTest
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic