• 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

How to put together OneJar, UberJar without source code

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,


How can I put couple of jars together in 1 jar file?

That would be OneJar or UberJar, if I had the source code, but i don't have it in this case

main.jar (here is the main class)
dependant_jar1.jar
dependant_jar2.jar
.
.
.


Regards
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just jar them up as you would any other resource.

Be aware that jars contained in jars are not on the classpath. If you need them to be you need to implement your own class loading logic.
 
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what you're asking - that's exactly what OneJar does; are you asking how you can use it? If so, there's documentation on its web site. If you're asking something else, tell us exactly what that is.
 
Imre Tokai
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, experience with OneJar is welcome!

Which file to download?
http://one-jar.sourceforge.net/index.php?page=downloads&file=downloads

How to put this together? What commands to use?
myapp.jar
mycomp.mypackage.RunningClass
dependencies:
swing-layout-1.0.4.jar
myutils.jar


Regards
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suggest you read the "Quick Start" section - it explains what jar files you need and how to use them.
 
Imre Tokai
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Appreciate your fast response(s) a lot!


http://one-jar.sourceforge.net/index.php?page=getting-started&file=quickstart
When I walkthrough the Command-Line Approach guidelines, I get one-jar.jar that contains only META-INF folder? What am I doing wrong?
Can anybody share precise guidelines on success generation of 1 jar, please?
What if additional resources are involved (images, i18n, internal DB...)?


Regards
 
Imre Tokai
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Found this old thread and it might turn out useful...

So OneJar generates executable jar (involving other jars) together with image-icon from the resources, as expected

Further, does anyone know how to setup, read and update a config file for OneJar? Where to put it exactly and how to reference it? getResourceAsStream should be used, i guess, but how?
http://one-jar.sourceforge.net/index.php?page=documents&file=faq
Posted also on:
https://sourceforge.net/p/one-jar/discussion/380843/thread/0c9353a4/

Regards

P.S.
Don't want to miss-lead with below unsuccessful tries:
 
Imre Tokai
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Encapsulating config.properties file in .exe and assembling all as installer is also an option.
Any experiences? Which (non-commercial) tool would you recommend?

Regards
 
reply
    Bookmark Topic Watch Topic
  • New Topic