将JAR添加到Eclipse Java库

时间:2023-01-15 22:46:58

How do you add a JAR file to an already existing Java library in Eclipse? Note that this is not a user library.

如何将JAR文件添加到Eclipse中现有的Java库?请注意,这不是用户库。

That is, if you look at the Java Build Path for a Java project and click on the Libraries tab, you will see the list of libraries used by the project. If you expand a given library, you will see a list of JAR files included in that library. I want to add an additional JAR file to one of these libraries.

也就是说,如果查看Java项目的Java Build Path并单击Libraries选项卡,您将看到项目使用的库列表。如果展开给定库,您将看到该库中包含的JAR文件列表。我想在其中一个库中添加一个额外的JAR文件。

I am using Version 3.4.0 of Eclipse.

我使用的是Eclipse 3.4.0版。

4 个解决方案

#1


19  

In Eclipse Ganymede (3.4.0):

在Eclipse Ganymede(3.4.0)中:

  1. Select the library and click "Edit" (left side of the window)
  2. 选择库并单击“编辑”(窗口左侧)

  3. Click "User Libraries"
  4. 点击“用户库”

  5. Select the library again and click "Add JARs"
  6. 再次选择库,然后单击“添加JAR”

#2


48  

In eclipse Galileo :

在日食伽利略:

  • Open the project's properties
  • 打开项目的属性

  • Select Java Build Path
  • 选择Java Build Path

  • Select Libraries tab
  • 选择“库”选项卡

From there you can Add External Jars

从那里你可以添加外部罐子

#3


4  

You might also consider using a build tool like Maven to manage your dependencies. It is very easy to setup and helps manage those dependencies automatically in eclipse. Definitely worth the effort if you have a large project with a lot of external dependencies.

您可能还会考虑使用像Maven这样的构建工具来管理依赖项。它很容易设置,并有助于在eclipse中自动管理这些依赖项。如果你有一个包含大量外部依赖关系的大型项目,那绝对值得付出努力。

#4


3  

As of Helios Service Release 2, there is no longer support for JAR files.You can add them, but Eclipse will not recognize them as libraries, therefore you can only "import" but can never use.

从Helios Service Release 2开始,不再支持JAR文件。您可以添加它们,但Eclipse不会将它们识别为库,因此您只能“导入”但永远不能使用它们。

#1


19  

In Eclipse Ganymede (3.4.0):

在Eclipse Ganymede(3.4.0)中:

  1. Select the library and click "Edit" (left side of the window)
  2. 选择库并单击“编辑”(窗口左侧)

  3. Click "User Libraries"
  4. 点击“用户库”

  5. Select the library again and click "Add JARs"
  6. 再次选择库,然后单击“添加JAR”

#2


48  

In eclipse Galileo :

在日食伽利略:

  • Open the project's properties
  • 打开项目的属性

  • Select Java Build Path
  • 选择Java Build Path

  • Select Libraries tab
  • 选择“库”选项卡

From there you can Add External Jars

从那里你可以添加外部罐子

#3


4  

You might also consider using a build tool like Maven to manage your dependencies. It is very easy to setup and helps manage those dependencies automatically in eclipse. Definitely worth the effort if you have a large project with a lot of external dependencies.

您可能还会考虑使用像Maven这样的构建工具来管理依赖项。它很容易设置,并有助于在eclipse中自动管理这些依赖项。如果你有一个包含大量外部依赖关系的大型项目,那绝对值得付出努力。

#4


3  

As of Helios Service Release 2, there is no longer support for JAR files.You can add them, but Eclipse will not recognize them as libraries, therefore you can only "import" but can never use.

从Helios Service Release 2开始,不再支持JAR文件。您可以添加它们,但Eclipse不会将它们识别为库,因此您只能“导入”但永远不能使用它们。