Java Eclipse:无法解析“系统”

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

Eclipse: 'System' cannot be resolved

javaeclipse

提问by user2898038

First i installed java 7.0 update 25 and then installed eclipse. Later as per requirement, I uninstalled this java version and installed earlier version 5.0

首先我安装了 java 7.0 update 25,然后安装了 eclipse。后来根据要求,我卸载了这个java版本并安装了早期的5.0版本

Now in every eclipse program, it is showing error with word 'System'. Solution is to add path of java.exe to eclipse. Can anyone guide me to do it?

现在在每个 eclipse 程序中,它都显示带有“系统”一词的错误。解决办法是在eclipse中添加java.exe的路径。任何人都可以指导我这样做吗?

回答by user4229947

To resolve this problem perform below steps: Go to Package Explorer -> Select your Project -> Right click on your project -> go to Properties-> Click on Java build path -> select your JRE file (mostly it will display error) and click on edit button which is on right side -> new dialog box will get displayed as “JRE System Library” in this window select radio button i.e"Workspace default JRE(jre6)" or whichever you have installed. Then click on finish. Errors will not come.

要解决此问题,请执行以下步骤:转到包资源管理器 -> 选择您的项目 -> 右键单击​​您的项目 -> 转到属性 -> 单击 Java 构建路径 -> 选择您的 JRE 文件(主要会显示错误)和单击右侧的编辑按钮 -> 新对话框将显示为“JRE 系统库”,在此窗口中选择单选按钮,即“工作区默认 JRE(jre6)”或您已安装的任何一个。然后点击完成。错误不会出现。

回答by Paul

The solution to the above problem is, change the JRE system library by doing the following:

解决上述问题的方法是,通过执行以下操作更改JRE系统库:

  1. Right click on your project and select properties.
  2. Select Libraries from the tab.
  3. Select the current JRE system library and click on edit.
  4. Select either Alternate JRE or Workspace default JRE (Latest version of JRE).
  5. Click Finish and then OK.
  1. 右键单击您的项目并选择属性。
  2. 从选项卡中选择库。
  3. 选择当前的 JRE 系统库,然后单击编辑。
  4. 选择备用 JRE 或工作区默认 JRE(最新版本的 JRE)。
  5. 单击完成,然后单击确定。

回答by Park JongBum

On Eclipse Oxygen, follow steps from (1) to (6) shown below figure.

在 Eclipse Oxygen 上,按照下图所示的 (1) 到 (6) 的步骤进行操作。

enter image description here

在此处输入图片说明

回答by Thomas P.

I solved the problem a little bit different. That may be because on my computer "java" doesn't work at Windows/cmd.exe because it is not listed in the Windows-PATH variable.

我解决了这个问题有点不同。这可能是因为在我的计算机上,“java”在 Windows/cmd.exe 中不起作用,因为它没有列在 Windows-PATH 变量中。

My solution is this:

我的解决方案是这样的:

  1. Project -> Properties -> Java Build Path -> Libraries
  2. Add Library -> JRE System Library -> Alternate JRE -> Installed JREs…
  3. Dialog “Installed JREs” open -> [Add…] -> “Standard VM”
  4. Dialog “JRE Definition” opens -> JRE home: [Directory…]
  5. Select the path to your JRE.
  1. Project -> Properties -> Java Build Path -> Libraries
  2. Add Library -> JRE System Library -> Alternate JRE -> Installed JREs…
  3. Dialog “Installed JREs” open -> [Add…] -> “Standard VM”
  4. Dialog “JRE Definition” opens -> JRE home: [Directory…]
  5. 选择 JRE 的路径。

Use [Finish]or [Apply]several time. I hope it also works for you.

使用[Finish][Apply]数次。我希望它也适用于你。

回答by Charles Goodwin

For those who make errors as I do, check whether the error is "'System' cannot be resolved" or "'system' cannot be resolved." In the latter case, capitalizing system will likely cure the problem. In the former case, follow directions above. Only wasted an hour figuring that one out.

对于那些像我这样谁犯错误,错误检查是否是“‘小号ystem’解决不了”或“‘小号ystem’无法得到解决。” 在后一种情况下,资本化系统可能会解决问题。在前一种情况下,请按照上述说明进行操作。只浪费了一个小时来弄清楚那个。