git 你如何在eclipse中设置Java类路径?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16291009/
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-09-19 08:29:06  来源:igfitidea点击:

How do you set the Java classpath in eclipse?

javaeclipsegitegitgitlab

提问by ryosua

I am having trouble importing a project from git into eclipse as a Java project.

我在将项目从 git 导入 eclipse 作为 Java 项目时遇到问题。

Existing questions say to import it from git, then modify the .project file to change it into a Java project. I was able to do that. But then you have to change the .classpath file. Most answers recommend doing this through eclipse instead of directly modifying the file. To do that they (and eclipse docs) say to go to Project > Properties > Java Build Path. I do not have the Java Build Path option under properties. I have Eclipse Juno.

现有问题说是从git导入,然后修改.project文件,改成Java项目。我能够做到这一点。但是随后您必须更改 .classpath 文件。大多数答案建议通过 eclipse 执行此操作,而不是直接修改文件。要做到这一点,他们(和 eclipse 文档)说去项目 > 属性 > Java 构建路径。我在属性下没有 Java Build Path 选项。我有 Eclipse Juno。

采纳答案by Drogba

It seems that you are trying to import a non-eclipse project.

您似乎正在尝试导入非 eclipse 项目。

  1. Create a new project and give it whatever name you want, like "client abc". If you already have a folder in the workspace file system named "client abc" then name your project something else like "client abc whatever".
  2. Now close Eclipse and open explorer (if you're using Windows)
  3. drag the ".buildpath" and ".project" files as well as the ".metadata" folder from the new project folder ("client abc whatever") into the actual client folder ("client abc"). Now just delete the "client abc whatever" folder.
  1. 创建一个新项目并为其命名任何您想要的名称,例如“client abc”。如果您在工作区文件系统中已经有一个名为“client abc”的文件夹,那么将您的项目命名为“client abc what”之类的其他名称。
  2. 现在关闭 Eclipse 并打开资源管理器(如果您使用的是 Windows)
  3. 将“.buildpath”和“.project”文件以及“.metadata”文件夹从新项目文件夹(“client abc what”)拖到实际的客户端文件夹(“client abc”)中。现在只需删除“客户端 abc 随便”文件夹。

http://www.dennisplucinik.com/blog/2009/12/22/how-to-import-an-existing-non-eclipse-project-into-eclipse/

http://www.dennisplucinik.com/blog/2009/12/22/how-to-import-an-existing-non-eclipse-project-into-eclipse/

回答by austin

Make sure your project is a Java project, not just a normal project. Try to re-create the project again, choosing File -> New ... -> Java Project.

确保您的项目是 Java 项目,而不仅仅是普通项目。尝试再次重新创建项目,选择File -> New ... -> Java Project