My Project is set to run with Java 11.
I can build it without any issues, but when I try to run it, it is looking for Java 1.8
Running on Mac OS 12.2.1
IntelliJ Version 2021.3.2
The problem was in the run configuration. I needed to specify the java version as well. Thanks for the suggestions
You have to check the following settings match (for Java 17):
Also if you use maven check that the correct version is set and if not, change them and reimport the project.
Related
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
I had some problems with JRE versions, so I tried to change it using the plugin Choose Runtime. I changed it to Java 1.8.0_112-release-287-b2. Now, when trying to start IntelliJ, i get an unsupported Java version error: Cannot start under Java 1.8.0_112-release-287-b2: Java 11 or later is required. I have tried to modify the runtime path in the ide64.exe.jdk file, but it seems like the old jdk IntelliJ ran on has been deleted. I also tried reinstalling intellij, no luck either. Anyone know how to get back the JDK? do I just download it from oracle and install it in the IdeaIC2020.3\jdks\ folder?
Thanks,
Jakob
I went to the jdks folder and deleted all contents. This fixed the issue. IntelliJ started without a problem.
I am using Intellij to write code in Java, if I run my software inside Intellij my software works but, if I create a jar file and I try to start it from my terminal it says that the jre version is too old.
My question is, if the JDK includes also the jre and my software works in Intellij, why it doesn't from the Ubuntu's terminal?
Intelij is poiting to a different java version than the one configured in your terminal path.
If you want to keep booth version the same you can look in Intelij Settings to find out which version it is using, then replace the /usr/bin/java link in your terminal to point to the same java binary.
Or, simply folow these step to just update your teminal version: install-java-ubuntu
I dont know anything about IntelliJ but why not just update the system JRE so it is the same as or more recent than the version that IntelliJ uses?
I am trying to config my eclipse (Helios) use jdk 7 to compile my code. I didn't install jdk 7 on my Windows XP. But I include all of the jdk contents with my project. It seems the solution provided in this post doesn't work. Compile java code needs JDK. the JRE is enough for running the compiled code. I think we need a way to configure the JDK to be used not just JRE. I tested with a JDK 7 new feature, String in switch, I can compile it in my batch file compile system but cannot use eclipse to compile it.
any idea?
This is what I did to make Eclipse 3.x works with Java 7.
install Java 7 in another machine and then copy the JDK folder into my java application 3rdparty directory (so my machine still use Java 6);
download the Eclipse 3.7.1 from here: eclipse 3.7.1
configure Eclipse by following steps in this post (select 1.7 in Compiler compliance level under the Java Compiler entry);
At least I can use String in Switch now in Eclipse.
Good luck.
Compile java code needs JDK. the JRE is enough for running the
compiled code.
that is right
"But I include all of the jdk contents with my project"
Including those will not change eclipse's compiler behavior. Including files under project build path just makes those classes available for your application development/run-time (or as good as setting CLASSPATH)
Do these :
1 - Install required version of JDK
2 - Choose following menu - Window > Preferences > Java > Compiler - and you will see a drop down to choose the version you want to use.
3 - Read this and this as well.
Good luck for being DBA after 5 yrs. Please consider working on your English as well (no offense please)
I am getting this bad version error as shown below. How to fix this. Do I need to have a separate jar file for each version of java?
(source: sourceforge.net)
How to fix this.
Is this a plugin that you created, or did you download it from somewhere?
I've never seen this myself, but I suspect that you are running Eclipse using an older version of Java (e.g. 1.5) and trying to use a plugin that was compiled for Java 1.6. Assuming that is the case you can:
upgrade the JDK used to run Eclipse to 1.6,
try to find a version of the plugin that was compiled for the Java 1.5 platform, or
download the plugin sources and build it for Java 1.5 yourself.
Do I need to have a separate jar file for each version of java?
No. A JAR file built for a Java 1.5 target platform should also work on a Java 1.6 platform. (Just not the other way around ...)
I got similar kind of error once and I was not able to fix it. And I ended up removing the plugin (EMF Plugin) and installing it on a new setup of Eclipse.
Now, I use Yoxos On-demand where you can create/add/remove Eclipse plugins with no effort. This is the best Eclipse customizer I have seen.
You are running on an older version of Java than the code was compiled for.