6

I'm using number of java files as common in different ADF projects, I want to archive them in jar file so I can import this archive file from any new project to use the java libraries in the project, I tried create it in jdeveloper but no luck.

Thank you for any advice,

Ya Basha
  • 1,902
  • 6
  • 30
  • 54
  • this may help - http://tompeez.wordpress.com/2011/06/01/creating-a-jar-file-in-jdeveloper/ – Caffeinated Jun 03 '12 at 15:07
  • Tthanx all for your help, I need to just import the jar package and to use it in any project I just need to import it into the library and i can implement code with the imported jar file. I hope the solutions you provided will help me to achieve this. – Ya Basha Jun 03 '12 at 21:38

4 Answers4

10

You can use the following article to understand the way.

creating a Jar file

jar cf jar-file input-file(s)

But still you can zip a file using windows zip utility or winzip and rename it as a jar file. It is not official but it works.

Chathuranga Chandrasekara
  • 20,548
  • 30
  • 97
  • 138
4

No matter how big or small you project is, the best answer to this question IMHO is a build tool. I would recommend maven, it is a great tool. It will take some time to get into and it will probably slow down your pace at first but the rewards of knowing how to use a tool like that are very big.

http://maven.apache.org/

Ludwig Magnusson
  • 13,964
  • 10
  • 38
  • 53
  • Moving to Gradle is even a better choice. It's just a personal consideration. Here you can find the documentation: [Gradle Java Library Plugin](https://docs.gradle.org/current/userguide/java_library_plugin.html) – Stefano Bossi Mar 30 '19 at 10:53
1

from your terminal - go to the directory where you have the files you want to jar and type the command

jar -cf myjarfile.jar *.java

hope this helps see also: Creating a JAR File

baby boom
  • 158
  • 2
  • 11
0

Assuming that the files that you want to reuse are related to ADF you should read about using ADF Libraries to increase reusability. See: http://docs.oracle.com/cd/E16162_01/web.1112/e16182/reusing_components.htm#BEIGHHCG

Shay Shmeltzer
  • 3,693
  • 1
  • 13
  • 9