"Import java.awt cannot be allowed" and "***** cannot be allowed to type",

I downloaded a Java project that I want to learn and learn some things. When I downloaded it to another computer, it worked fine, but when I try it on my computer, almost every declaration and import is given the error message " * cannot be allowed for type" or "Import" java.awt cannot be allowed "

I did some research on this site and found that this may be due to the fact that you do not have the latest version of Java installed. I checked mine and I have JavaSE-1.7 (unbound). So I have the latest version, but is it (unrelated)?

Could this be a problem? And what does (unrelated) mean?

I am using Eclipse 3.3.2

UPDATE: I found this error message at the top of the Properties window: org.eclipse.jdt.launching.JRE_CONTAINER / org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType / JavaSE- 1.7 . What does it mean?

+4
source share
3 answers

This is because the project depends on the J2SE 1.7 library, but cannot find the JRE in this place on your computer.

Project-> Properties-> Java Build Path

Or Add a new JRE to eclipse using Window> Preferences> Java> Installed JRE and find the path to the JRE folder on your computer. and then replace the dependency of your project with the new JRE you installed in eclipse.

UPDATE UNBOUND JRE in Hello World

+4
source

This might work for some ... this is for me:

  • Hover over "java.awt" in your code, and in quick fixes, select Fix project settings .

  • Pop-up displays containing "The following offers were found ..." and
    "Add the JRE System Library [JavaSE-1.7] to create the path."

  • Select "OK."

0
source

The problem arises because the project depends on the java 1.7 library, but cannot find the JRE in the specified location on your computer.

Project-> Properties-> Java Build Path

Or Add a new JRE in eclipse using the window> Settings> Java> Installed JRE and find the path to the JRE folder on your computer. and then replace the dependency of your project with the new JRE you installed in eclipse. if teher does not have a JRE and click on the jre tab and specify the location of the Jre directory and add this.

0
source

All Articles