如何在Eclipse中导入一个jar ?
当前回答
如果你有一个麻烦的udemy课程乍得对进口的罐子。然后按照这些步骤进行。
右键单击项目。 你会看到一个Build Path选项,点击它。 你会有一个选项配置构建路径,点击它。 去图书馆。 然后去你有一个jar文件的地方,把它们放到一个新的文件夹里,上传到一个新的地方。 然后点击Add External Jars,你肯定可以上传它,这也会对classpathxmlapplicationcontext有帮助。
谢谢你!
其他回答
首先,你要了解你的项目是什么 然后右击鼠标,选择底部的属性 然后在左上角选择内置路径然后添加外部jar文件添加点击应用,就这样了
右键单击项目。 单击Build Path。 单击“配置生成路径”。 在Libraries下面,单击Add Jar或Add External Jar。
只是对将jar导入Eclipse(插件开发)项目的注释:
In case you are developing Eclipse plug-ins, it makes sense to use Eclipse's native bundling mechanism instead of just importing the jar into a plug-in project. Eclipse (or better its underlying OSGi runtime, Equinox) uses so-called bundles which contain some more information than plain jars (e.g., version infos, dependencies to other bundles, exported packages; see the MANIFEST.MF file). Because of this information, OSGi bundles can be dynamically loaded/unloaded and there is automatic dependency resolution available in an OSGi/Eclipse runtime. Hence, using OSGi bundles instead of plain jars (contained inside another OSGi bundle) has some advantages.
(顺便说一句:Eclipse插件与OSGi包是一回事。)
很有可能有人已经将某个(第三方)库绑定为OSGi包。你可能想看看下面的bundle仓库:
http://www.springsource.com/repository/app/ http://download.eclipse.org/tools/orbit/downloads/ http://www.osgi.org/Repository/HomePage
您可以通过右键单击Project→Build Path→Configure Build Path在Eclipse中添加一个jar。在Libraries选项卡下,单击Add Jars或Add External Jars并给出Jar。这里有一个简单的演示。
上述解决方案显然是一个“快速”的解决方案。然而,如果您正在处理一个需要向源代码控制存储库提交文件的项目,我建议将Jar文件添加到源代码控制存储库中的专用库文件夹中,并引用上面提到的少数或全部Jar文件。
以下是步骤:
click File > Import. The Import window opens. Under Select an import source, click J2EE > App Client JAR file. Click Next. In the Application Client file field, enter the location and name of the application client JAR file that you want to import. You can click the Browse button to select the JAR file from the file system. In the Application Client project field, type a new project name or select an application client project from the drop-down list. If you type a new name in this field, the application client project will be created based on the version of the application client JAR file, and it will use the default location. In the Target runtime drop-down list, select the application server that you want to target for your development. This selection affects the run time settings by modifying the class path entries for the project. If you want to add the new module to an enterprise application project, select the Add project to an EAR check box and then select an existing enterprise application project from the list or create a new one by clicking New. Note: If you type a new enterprise application project name, the enterprise application project will be created in the default location with the lowest compatible J2EE version based on the version of the project being created. If you want to specify a different version or a different location for the enterprise application, you must use the New Enterprise Application Project wizard. Click Finish to import the application client JAR file.
推荐文章
- codestyle;把javadoc放在注释之前还是之后?
- 如何在Spring中定义List bean ?
- 将Set<T>转换为List<T>的最简洁的方法
- 在JavaScript中,什么相当于Java的Thread.sleep() ?
- 使用Java重命名文件
- URL从Java中的类路径加载资源
- .toArray(new MyClass[0]) or .toArray(new MyClass[myList.size()])?
- Hibernate中不同的保存方法之间有什么区别?
- Java 8流和数组操作
- Java Regex捕获组
- Openssl不被视为内部或外部命令
- 如何添加自定义方法到Spring Data JPA
- 如何在Ubuntu中设置Java环境路径
- 无法执行dex:在Eclipse中超过GC开销限制
- 有人能解释一下JPA和Hibernate中的mappedBy吗?