• 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

creating jar file from eclipse

 
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to create the JAR file from Eclipse IDE. That's rather easy -> Create Runnable JAR. BUT, I want to add .JPG file, other .JAR files and .DLL files to that final JAR. Moreover I have to set some arguments for the JVM.

Do you have any ideas?
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Lucas Smith wrote:I want to create the JAR file from Eclipse IDE. That's rather easy -> Create Runnable JAR. BUT, I want to add .JPG file, other .JAR files and .DLL files to that final JAR. Moreover I have to set some arguments for the JVM.

Do you have any ideas?



A jar file is just a zip file, and can hold anything -- jpg files, other jar files, DLLs, etc. However, while java does allow you to access the files in a jar file, it doesn't allow you to use it like any other file in the file system. So, one option is to create an installer class. The class will check the file system for the files you need, and if not available, extract it from the jar file to the file system. Basically use the jar file only for packaging -- and have it extract at run time.

As for your second question, you can use a configuration file -- and extract it the same way as your first question.

Henry

reply
    Bookmark Topic Watch Topic
  • New Topic