Eclipse Design Tab detects wrong Java - java

When I click on the design tab I get this error:
Incompatible Java Versions
Eclipse is running under 1.7, but this Java project has a 1.8 Java compliance level, so WindowBuilder will not be able to load classes from this project. Use a lower level of Java for the project, or run Eclipse using a newer Java version.
I've checked in window>preferences that:
>java>compiler is set to 1.8
>java>installed JREs has a 1.8 JDK as the default
Have I missed something?

looks like JAVA_HOME is set to the java 7 one, will this require a restart?
You're actually executing eclipse with Java 7, you can update JAVA_HOME to point to Java 8, and then restart eclipse (not your computer).

Related

The incompatible between windows builder versions and java versions and eclipse version

I encounter this problem as below:
"Eclipse is running under 0, butthis Java project has a 1.8 Java compliance level, so WindowBuilder will not be able to load classesfrom this project. Use a lower level of Java for the project, or run Eclipse using a newer Javaversion. "
I tried several ways but it did not work. I installed both java 17 and java 1.8 and changed the jre to 1.8 & the complier to 1.8. In the end, it still did not work.
The eclipse version I am using is 2018. I need it to start the SWING application and now I am into troubles.
Can you give me some suggestions? Thanks in advance!

When I download eclipse what version of JDK and JRE is being used and how can I change it?

I have downloaded the new eclipse 2022-06 and I wanted to know that what version of Java does it run on. What is the JDK and JRE and how can I create a project to run on Java 7 with a compatible JRE? Where do I select those settings or what do I additionally need to download?
Take a look at the official documentation: Eclipse/Installation
You will find for each version of Eclipse the required JRE/JDK to run it.
Instead, if you are looking for how to run a project with a different JRE/JDK, you can take a look at this guide: How to Change Java Version in an Eclipse Project

Google app engine deployment error : JDK not JRE

I'm trying to deploy the app with a .jsp file, which I figured is the reason I get an error because other projects without .jsp files have no problem.
When I try to deploy the app, I get the error : "Cannot get the System Java Compiler. Please use a JDK, not a JRE"
I tried resolving the problem using Mahmoud's solution here : Google app engine deployment : JDK not JRE
But once I have changed the eclipse.ini file, I launch Eclipse and get this error : "Version 1.7.0_80 of the JVM is not suitable for this product. Version 1.8 or greater is required"
You need to install JDK8 or JRE8 for Eclipse to execute and JDK7 for compile this application to build.
As mentioned in the error, JDK7 is not compatible with Eclipse. So you need to set your system JDK to 8 for Eclipse. Alternatively, you could instead modify the environment variables or startup script for Eclipse to reference JDK8 and avoid making this a system wide change.
Although for security purposes, I do recommend using the latest JDK/JRE as the system one for most cases.
Then within Eclipse, set the project JDK to 7.
Click through the following:
Windows -> Preferences -> Java -> Installed JRE
There you can remove the "JRE System Library", then you can add and configure another already installed JRE/JDK for this specific project.
You need the JDK for building which includes a JRE, but for deploying you only need the JRE.
The JDK includes the ability to compile Java source into executable code, where as the JRE can only execute that executable code.
You can download JDK from Oracle's site here: Oracle Java JDK 8

Eclipse 2.5 spec web app error

Have a running 2.5 web module project on my eclipse. I wanted to upgrade to Java 8 (currently running 7). When I set the compiler compliance of the project to Java 8, I'm getting error icon on the project. And the unsupported version exception when loading the class in tomcat (8)
Setting compiler compliance of a project to Java 8 is not enough. You need to:
Add a Java 8 "Installed JRE" in the "Preferences".
Change the "JRE System Library" of the project to use the new JRE.
Change compiler compliance of the project.
To run the code, you also need to:
Change Tomcat to use a Java 8 runtime.
If Tomcat is running as a Windows Service, you need to remove and re-add the service, because it remembers the Java version that was in effect when it was added.

How do i use diffrent jdks for Netbeans and Eclips

I have both Net-beans and eclipse IDEs installed in my laptop, But there is a per-devolved system that want lower version of JDK. so I installed net-beans older version too. but then JDK does not support my eclipse version. can I use two JDK in once?? and what should I do for working in both IDE in different versions.
Eclipse / Net beans need JRE to run in first place. If the version of JRE you install is not supported by the version of Eclipse/Netbeans u have, then you have to get a compatible version of Eclipse/Netbeans that match your installed JRE. (Alternatively you can change the JRE version)
Now coming to JDK. You need JDK only to compile you code inside Eclipse/Netbeans. You can have any number of JDKs installed and you can configure 'per project'.
In Eclipse, this is how you configure the JDK for the project
Java Build Path -> Libraries -> Add Libraries -> JRE System Library
In the next screen you add the desired JDK from your system , by locating it in the file browser.
P.S : Havent used Netbeans, but sure it is supported

Categories

Resources