create java library file

早过忘川 提交于 2019-11-28 01:29:35

问题


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,


回答1:


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.




回答2:


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/




回答3:


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




回答4:


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



来源:https://stackoverflow.com/questions/10871378/create-java-library-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!