Java Eclipse-如何删除从引用库的“类路径”中添加的 jar

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37292284/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 19:09:30  来源:igfitidea点击:

Eclipse- How to remove jars which are added "from class path" of referenced library

javaeclipsejareclipse-classpath

提问by Rilwan

I use eclipse. I just added two jars into my project as library >Add external jar . As in below picture, all other jars in the folder are coming to my project as referenced library. How to remove this. Are these really required ? After I compiled, the app jar file size is much bigger than I expected.

我使用日食。我刚刚在我的项目中添加了两个 jar 作为 library >Add external jar 。如下图所示,文件夹中的所有其他 jars 都作为引用库进入我的项目。如何删除这个。这些真的是必需的吗?我编译后,app jar 文件的大小比我预期的要大得多。

enter image description here

在此处输入图片说明

tool tip shows-from class path of .jar

工具提示显示-from class path of .jar

enter image description here

在此处输入图片说明

回答by Fred

Right click on project, goto Build Path -> Configure Build Path, then goto the Libraries Tab, select the Referenced library and click remove.

右键单击项目,转到构建路径 -> 配置构建路径,然后转到库选项卡,选择引用的库并单击删除。

回答by VinG

Select Project in Project Explorer and Press "Alt+Enter" then Go to Java Build path and select Libraries then select jar file finally click on Remove button.

在 Project Explorer 中选择 Project 并按“Alt+Enter”,然后转到 Java Build 路径并选择 Libraries 然后选择 jar 文件,最后单击 Remove 按钮。

Or Another way is their

或者另一种方式是他们的

select jar in the Project tree-view and right click on it and select Build Path then in select the Remove from Build Path . You are done.

在 Project 树视图中选择 jar 并右键单击它并选择 Build Path 然后选择 Remove from Build Path 。你完成了。

回答by Mihir

To remove a library reference from the project classpath, follow this procedure:

要从项目类路径中删除库引用,请按照以下步骤操作:

1.Right-click on the project in the Project Explorerview and select Propertiesfrom the drop-down menu.This will open the Propertisdialog.

1. 在Project Explorer视图中右键单击项目并从下拉菜单中选择Properties。这将打开Propertis对话框。

2.On the Propertis dialog, select the Java Build Pathfrom the list of properties.

2. 在Propertis 对话框中,从属性列表中选择Java Build Path

3.On the Java Build Pathpart of the dialog, select the Librariestab.

3. 在对话框的Java Build Path部分,选择Libraries选项卡。

4.Find the entry in the list of libraries called Shared Library [], and then select it.

4. 在库列表中找到名为 Shared Library [] 的条目,然后选择它。

5.Click Remove.

5.单击删除

回答by Greg Loring

The only way I found to remove those other .jarfiles was to move them into another directory.

我发现删除这些其他.jar文件的唯一方法是将它们移动到另一个目录中。

In my case, I had a lib/foo-depsdirectory from which I needed two small .jar files out of about a dozen huge .jarfiles. This made Ctrl+Shft+TOpen Type take almost a minute. So, I made a lib/foo-runtime-depsdirectory and put everything I did not need to compile into that directory.

就我而言,我有一个lib/foo-deps目录,我需要从大约十几个大.jar文件中的两个小 .jar文件。这使得Ctrl+Shft+TOpen Type 花费了将近一分钟的时间。因此,我创建了一个lib/foo-runtime-deps目录并将不需要编译的所有内容放入该目录中。