简体   繁体   English

从Java源文件夹制作JAR文件

[英]making JAR files from java source folders

I would like to use spongycastle api for android. 我想将spongycastle api用于android。

https://github.com/rtyley/spongycastle/archive/spongy-master.zip https://github.com/rtyley/spongycastle/archive/spongy-master.zip

However, the linked file only contains .java files, I cannot make it for eclipse external library. 但是,链接文件仅包含.java文件,我无法使其用于Eclipse外部库。

Could you give me ways to build jar files from src folder. 你能给我办法从src文件夹构建jar文件吗? (with specific command plz) (使用特定命令plz)

You should be able to import the java files as a package. 您应该能够将Java文件作为包导入。 No need to build a jar or anything. 无需建造一个罐子或任何东西。 Just click and drag all the java files (and folders in the source) into your package explorer. 只需单击并将所有Java文件(和源文件中的文件夹)拖到包资源管理器中即可。

The ZIP file contains a POM.xml file, and that means you should be able to build it using Maven . ZIP文件包含一个POM.xml文件,这意味着您应该能够使用Maven进行构建。 But there is also a script called use-maven-layout.sh which appears to be used for moving the files around into the Maven preferred directory layout. 但是,还有一个名为use-maven-layout.sh的脚本,该脚本似乎用于将文件移动到Maven首选目录布局中。 You'll need to work out what is going on there for yourself. 您需要自己弄清楚发生了什么。

Other alternatives are: 其他替代方法是:

  • manually download the pre-built JAR files from Maven Central, or 从Maven Central手动下载预构建的JAR文件,或者
  • (if you are already using Maven in your project), add the relevant dependencies to your project's POM.xml so that they downloaded automatically. (如果您已经在项目中使用Maven),请将相关的依赖项添加到项目的POM.xml中,以便它们自动下载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM