[英]Exporting usable .jar files from GitHub project
I'm rather new to java and eclipse, and I would like to get jar files from this github project: 我是java和eclipse的新手,我想从这个github项目中获取jar文件:
https://github.com/nikkiii/omegle-api-java https://github.com/nikkiii/omegle-api-java
I've tried doing so in eclipse, but I can't import the project as a java project, and (I think) for this reason I am not able to use the Export feature to obtain jar files for the project. 我试过在eclipse中这样做,但是我不能将项目作为java项目导入,并且(我认为)因为这个原因我无法使用Export功能来获取项目的jar文件。 What is the easiest/best way to go about this?
最简单/最好的方法是什么?
Thanks 谢谢
This is the easiest way, assuming you dowloaded the zip file containg the .java source files from github: 这是最简单的方法,假设您下载了包含来自github的.java源文件的zip文件:
omegle-api-java-master
. omegle-api-java-master
。 omegle-api-java-master
. omegle-api-java-master
。 Eclipse will create a project from the source in your workspace, and set it up with a java builder. Properties
, going to Java Build Path
, selecting the Projects
tab, and clicking the Add
button. Properties
,转到“ Java Build Path
,选择“ Projects
选项卡,然后单击“ Add
按钮,将其导入到您的“聊天”项目中。 Export
-> Java
-> JAR file
, which will create your jar file for you. Export
- >“ Java
- >“ JAR file
,这将为您创建jar文件。 I assume that you have an Android library (downloaded a GitHub repository of the library) and found that it doesn't contain pom.xml
. 我假设你有一个Android库 (下载了库的GitHub存储库),发现它不包含
pom.xml
。 If you have this file, see How to Create a jar file from github project . 如果您有此文件,请参阅如何从github项目创建jar文件 。
Open a folder of the library and add local.properties
file with a path to your Android SDK (for instance, sdk.dir=D\\:\\\\Android\\\\SDK
). 打开库的文件夹,并添加带有Android SDK路径的
local.properties
文件(例如, sdk.dir=D\\:\\\\Android\\\\SDK
)。 Otherwise you can see an error: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable
否则,您可以看到错误:
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable
. SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable
。
In command prompt (cmd.exe) run gradlew build
. 在命令提示符(cmd.exe)中运行
gradlew build
。 If it will throw Android exceptions, maybe you should switch to master
branch of the library and build again. 如果它会抛出Android异常,也许您应该切换到库的
master
分支并再次构建。
If everything was normal see subfolders and look for build\\libs
folders inside. 如果一切正常,请参阅子文件夹并在里面查找
build\\libs
文件夹。 There you can find jar
-files. 在那里你可以找到
jar
文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.