English 中文(简体)
• 如何将多个班级的单一杰尔档案用于其他项目
原标题:how to make a single jar file of multiple classes that can be used in other projects
  • 时间:2011-11-16 12:49:07
  •  标签:
  • java
  • jar

我有一些班子说,我有20个班级,目标不同。 现在,我想做的是,我只想把所有这些档案归档。 我愿这样做,因为我想在其他项目中把这些班子作为单枪匹马。 我如何能够这样做?

最佳回答

There s already a good discussion on merging multiple jars using ANT here, if you want it as part of a build process: Clean way to combine multiple jars? Preferably using Ant

问题回答

你也可以利用指挥线这样做。 将所有班级转成倍数。 它与绝对的道路C:Java项目1相重叠。

Go to the same folder from command prompt. And execute the following code :

jar cfv Project1.jar *

c 这里将产生jar, f 将把内容转至所提供的档案中,即: 项目1.jar和(5)将印刷过程。

* 野生卡将掌握所有文件夹。 还将以同样方式创建Jar案。

现在,你可以在你想要使用的地方复制这一节。

If you are using Eclipse You can do this by,

Right Click on the Package -> Export -> java -> jar file 

包裹是指任何Folder包或选定JAVA文档的任何组

简言之,课程是正常的。

i.e. 从指挥线:jar cf jar-file <input-file(s)>

More info can be found here: http://download.oracle.com/javase/tutorial/deployment/jar/basicsindex.html

Or you can just put the classes in one eclipse project and reference that project in the other android eclipse projects.

Right click on android project => Build Path => Configure BuildPath => 
Projects => Add

当你利用人力建设你们的项目时,这不会奏效。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签