简体   繁体   中英

Error in Java EE project

I uninstalled the jdk and again installed it. And when Java EE projects are opened in eclipse, they all are showing errors on each and every line, which projects were created before and was working fine.

Plz tell me what is the error or how to build the path for it

Have you tried to remove and re-add the JRE(JDK) from the build path? Right click on the projects->Java build path->Add library.

Be sure to point to the right jdk directory.

Open Window menu , then select Preferences

In the tree open Java , select Installed JREs , then Add... the new one, and delete the invalid one.

This sets Eclipse's default values, however, you might have to check the project specific settings by right clilcking on the project, selecting Properties , and

  • Run/Debug settings - all run/debug settings can have different JRE set up on the JRE tab
  • Java Build Path on the Libraries tab: delete invalid JRE, add new one using Add Library... and selecting JRE System Library

Also, while you're at it, be sure to check

  • PATH environment variable, to have the valid path
  • JAVA_HOME environment variable

Go to Window -> Preferences, select Java -> Installed JREs, make sure you have added your new java installation here.

Right click on your project, select Properties, select Build Path -> Libraries, remove and add JRE System Library. Also, check if you have enabled any project specific configurations (like compiler version, etc) for Java Compiler in project Properties, if yes, update that as well.

Had similar situations.

Make sure:

  • Your JRE settings is pointing to the JDK.
  • Go to your project properties and make sure it's using the right java version.
  • Check there are no build path errors, and make sure all dependent jars can use the new java version.

If it still doesn't work, it may be Eclipse playing up.

Try to reset the project configurations and code by closing the projects, open them again, run a F5 refresh on the project clean it and rebuilt it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM