I've been working with Java for a bit now and the JDK/JRE version has given me quite a bit of trouble lately. I am developing using the Intellij IDEA IDE and it of course uses the latest version of the JDK, 14. However when I attempt to execute software compiled with JDK 14 outside the IDE, I get an error that the JRE isn't new enough to run this software. So I updated Java on my computer and another machine and attempt to run again without any success. After some digging, I tweaked my machine to use the JRE included in the JDK 14 which is compatible.
However it is kind of odd that I had to do that, one would think that the latest version of java should of been enough to run applications made with the latest version of the JDK (14). Right now Java is version 8 build 251 and says there is no newer update available. If JDK 14 is out for a while now, why would they not update the version of Java they ship?
The problem is partially solved, as only the machine I am using for development is capable of executing the created applications. Other people I've sent them to have been unable to run them, despite having the latest version of java. Also it is a pain to get the latest JDK, especially when having limited experience on how to get rid of old versions, change path point to the latest version, get the right package (open/oracle JDK) and do that for windows and several distrubutions of linux. What is going on? Did I get Java from the wrong place and everyone else as well? Why are oracle doing this and why are there no java updates since clearly there exists a newer version?
-
jdk versions do not match java runtime versions. runtime is much way back in numberDrkDeveloper– DrkDeveloper2020年07月04日 12:40:15 +00:00Commented Jul 4, 2020 at 12:40
-
@DrkDeveloper that seems to be the case, i do not know why that is. So for people to use my apps, they need to get the JDK? I was thinking that I should ship my applications as they are, and wait 5 years for java version to catch up.DuckHunterZx– DuckHunterZx2020年07月04日 12:51:41 +00:00Commented Jul 4, 2020 at 12:51
-
1Read Java Client Roadmap Update and Java Is Still Free.Basil Bourque– Basil Bourque2020年07月04日 16:54:46 +00:00Commented Jul 4, 2020 at 16:54
3 Answers 3
Starting with Java-11, separate JRE does not exist anymore. In other words, if you are using Java-11 or above, you should care about JDK only.
You should uninstall JRE-8 from your machine and make sure your JDK-14 bin folder in the PATH variable. Some application even requires JAVA_HOME to work and therefore you should make sure that your system has an environment variable called JAVA_HOME and its value set to the root folder of JDK-14 (i.e. one level above your JDK bin).
Q: What should my clients do to run my application compiled on JDK-14?
Ans: Your clients must install JDK-14. Also, check this thread for some alternatives.
3 Comments
jlink and/or jpackage, or some third-party mechanism).You're confusing how IntelliJ or JDK are used on the OS. IntelliJ, now, often comes with its JDK binaries (but even this can be configured, IntelliJ can be configured to use any JDK/JRE build you'll provide to it); however, if you run your Java application out of IntelliJ, most likely you're using Java installed locally on your OS, which might be referenced via your JAVA_HOME environment variable.
I'd suggest to:
- Check
java -versionin your shell (and hence you'll see what JVM instance your OS spins up when you run a Java application); - Check
where java(on Windows, orwhich- on Linux) in your shell, to see all the Java binaries available on your OS.
5 Comments
Try to uninstall Java SE Development Kit and Java JRE(if you have both in your machine) and reinstall both again, JDK and JRE both, I am sharing my google drive link where you can find the latest version of both JDK and JRE and when you are done installing, add there bin folder path in the Environment Variables of your machine.