简体   繁体   English

将Java库添加到Eclipse

[英]Add Java Libraries to Eclipse

I am quite new to Java and Eclipse. 我是Java和Eclipse的新手。

I am trying to call some functions from the jpf library from a program that I am writing in Eclipse. 我试图从我在Eclipse中编写的程序的jpf库中调用某些函数。

Can anyone help me load or install these libraries into my Eclipse project? 谁能帮助我将这些库加载或安装到我的Eclipse项目中? The .zip files are here . .zip文件在这里 If these are already in the Eclipse program or there is some better way to get them, can someone also post that answer in addition to how to load any arbitrary java library. 如果这些已经在Eclipse程序中,或者有一些更好的方法来获取它们,除了如何加载任意Java库之外,有人还可以发布该答案。

Thanks for the help. 谢谢您的帮助。

The JPF project page, to which you already linked in your question, contains a section about setting up the Eclipse IDE for JPF projects . 您已经在问题中链接到的JPF项目页面,包含有关为JPF项目设置Eclipse IDE的部分。 A more general webpage on how to add external jars to your eclipse project might be helpful as well 关于如何将外部jar添加到Eclipse项目的更一般的网页也可能会有所帮助

Download and extract jpf-bin-1.5.1.zip . 下载并解压缩jpf-bin-1.5.1.zip In here, you will find one or more JAR files. 在这里,您将找到一个或多个JAR文件。 Add them into your Eclipse project, under something like a "lib" folder. 将它们添加到Eclipse项目的“ lib”文件夹下。 Right-click on the JAR files from there, then choose "Build Path" / "Add to Build Path". 从那里右键单击JAR文件,然后选择“构建路径” /“添加到构建路径”。

Or better yet, investigate the use of Apache Maven, and let it handle all of the dependency resolution for you. 或者更好的是,研究Apache Maven的使用,并让它为您处理所有依赖关系解析。 (Per http://jpf.sourceforge.net/roadmap.html , this project is at least Maven-enabled.) At least the 1.5 version is also available from the central Maven repository at http://repo1.maven.org/maven2/net/sf/jpf/jpf/ . (根据http://jpf.sourceforge.net/roadmap.html ,此项目至少已启用Maven。)至少还可以从http://repo1.maven.org/的中央Maven存储库中获得1.5版本。 maven2 / net / sf / jpf / jpf / I don't see 1.5.1, but the jpf-bin-1.5.1.zip contains a "MAVEN.txt" that explains how to install it into a local Maven repository for use. 我看不到1.5.1,但是jpf-bin-1.5.1.zip包含一个“ MAVEN.txt”,解释了如何将其安装到本地Maven存储库中以供使用。

download desired jar in to your local machine - add those jar to your project using below 将所需的jar下载到本地计算机-使用以下命令将这些jar添加到您的项目中

right click on your project - configure build path - libraries - add external jars - browse downloaded jars - add 右键单击您的项目-配置构建路径-库-添加外部jars-浏览下载的jars-添加

check how add libraries in eclipse. 检查如何在eclipse中添加库。 http://wiki.eclipse.org/FAQ_How_do_I_add_an_extra_library_to_my_project%27s_classpath%3F http://wiki.eclipse.org/FAQ_How_do_I_add_an_extra_library_to_my_project%27s_classpath%3F

Also check this how make user libraries in Eclipse and then add them in your project. 还要检查如何在Eclipse中创建用户库,然后将其添加到项目中。 http://i-proving.com/2006/07/18/user-libraries-in-eclipse http://i-proving.com/2006/07/18/user-libraries-in-eclipse

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

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