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

how to refer a jar outside executable in desktop application?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a desktop java application and want to use some classes outside the executable. How can I do it?

Thanks
Amit
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

If the application is in an executable jar file (it's a jar file that you double-click to run, or that you can start with the command: java -jar TheProgram.jar), then you have to add the external classes to the classpath in the manifest file of the executable jar.

The tutorial Packaging Programs in JAR Files explains how executable jar files can be created and how to set the classpath in the manifest file.
 
amit malpure
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jesper for the responce.

Let me explain the scenario:

I have java application installed. And the jar is bundlled into an .exe file using some installer tool. Now I want to create a patch for this application.

If I create another jar containing updated files only, how can I refer it in the original code?

Please guide.

Thanks
Amit
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

If I create another jar containing updated files only, how can I refer it in the original code?


Short answer: As long as the new jar is on the classpath, it should work.

Long answer: It would depend on how the "patch" works. Does it involve code changes to your original classes? Does it involve new classes? If yes, how is the original jar supposed to use the new classes without any changes to the original code? Anything else?
 
Sheriff
Posts: 28333
97
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

amit malpure wrote:I have java application installed. And the jar is bundlled into an .exe file using some installer tool. Now I want to create a patch for this application.



That's a question about the (un-named) installer tool.
 
amit malpure
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.

Now I am able to refer a jar outside exe after specifiying proper class path. Now I am working on how to use code from new jar instead of code from old jar inside the exe?

Does it involve code changes to your original classes? Yes.
Does it involve new classes? Yes

Thanks
Amit
 
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic