如何在Eclipse中导入一个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.
其他回答
两个选择:
1/来自项目:
2/如果你已经导入了其他jar,从“References Libraries”目录:
两者都会引导你进入这个屏幕,在这里你可以管理你的库:
Eclipse ->首选项-> Java ->构建路径->用户库->新建(命名它)->添加外部jar
(我建议在这些步骤之前将您的新库拖到eclipse文件夹中,以保持所有内容在一起,这样如果您重新安装eclipse或您的操作系统,您就不需要rwlink除JDK以外的任何内容)现在选择您想要的jar文件。单击OK。
右键单击项目并选择生成路径->添加库
供参考,只是代码,然后右键单击和来源->组织导入
在eclipse中,我包含了一个压缩jar文件,即zip文件。Eclipse允许我将这个压缩文件添加为外部jar,但当我试图访问jar中的类时,它们没有显示出来。
经过大量的尝试和错误,我发现使用zip格式是行不通的。当我添加一个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.
系统路径下的Jar文件为:
C: \ oraclexe app \ oracle产品10。2。0 \ server \ jdbc lib \ ojdbc14。jar
Ojdbc14.jar (jar文件)
要在Eclipse IDE中导入jar文件,请遵循以下步骤。
右键单击项目 选择生成路径 单击Configure Build Path 单击Libraries,选择Modulepath,然后选择Add External jar 从所需的文件夹中选择jar文件 单击“应用”和“确定”
推荐文章
- 禁用IntelliJ星(包)导入?
- 面试问题:检查一个字符串是否是另一个字符串的旋转
- 将文件加载为InputStream的不同方法
- 到底是什么导致了堆栈溢出错误?
- 为什么Android工作室说“等待调试器”如果我不调试?
- Java:路径vs文件
- 如何使用Eclipse比较两个文件?Eclipse是否提供了任何选项?
- ExecutorService,如何等待所有任务完成
- Maven依赖Servlet 3.0 API?
- 如何在IntelliJ IDEA中添加目录到应用程序运行概要文件中的类路径?
- getter和setter是糟糕的设计吗?相互矛盾的建议
- Android room persistent: AppDatabase_Impl不存在
- Java的String[]在Kotlin中等价于什么?
- Intellij IDEA上的System.out.println()快捷方式
- 使用Spring RestTemplate获取JSON对象列表