• 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

deploy a .zip that includes some .jar files

 
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I have packaged my code into "myapp.jar" file, and this code needs a few third party jar files too. I want to zip all of them together and create a zip file. Inside the zip file I may need a windows "cmd" file like "execute.cmd" that looks like

set classpath="d:\thirdParty.jar"..

"java" -classpath "%CLASSPATH%" myapp.Main

After all, I want to send this zip to someone who can unzip on his PC and just run my "cmd" file. But the question is -- I don't know where the user may put the zip and unzip it. How do I specify that in my "classpath" ? I am not a windows guy, please help if you can.

Thanks.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It doesn't matter where the file is unzipped. As long as the .bat file is in the same directory as the jar files, the classpath can reference them directly, like "set CLASSPATH=thirdParty.jar;fourthParty.jar;fifthParty.jar".
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic