Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

creating jar file from eclipse

 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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?
 
Henry Wong
author
Marshal
Pie
Posts: 21504
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • 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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic