Does the JDK (Java Development Kit) update itself? I have noticed that I haven't gotten an update for JDK but only Java updates.
The JDK is used for writing java applications and is only updated manually.
The JRE is used for running java applications, such as jars and applets. Depending on the OS the JRE can be scheduled for automatic or manual update.
Some links with more details:
http://java.com/en/download/help/mac_java_update.xml
http://java.com/en/download/faq/expire_date.xml
Related
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?
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.
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 -version in 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, or which - on Linux) in your shell, to see all the Java binaries available on your OS.
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.
I have made an a java app with JDK 13. I created a exe file with launch4j. But nobody can run it because everyone has the jre 1.8 version and it wont start... I has to include the java jdk 13 with installation and set the java_home with that ?
TL;DR - If you want to distribute a Java 13 application, the best option is to use jlink to create the executable. This avoids the user having to install any JDK or JRE to run your code.
Clearly, users cannot run your application with a Java 8 JRE or JDK. A typical Java 13 application will make use of features that are not present in the Java 8 platform. But even if it worked, free Java 8 will be end-of-life in April 2021, and at that point:
It will stop getting security updates, making it (in theory if not practice) unsafe for your customers to use.
It will be more difficult for your customers to find free Java 8 binaries. (Paying Oracle for a license will be an option though.)
But Java 13 is problematic too. That will be end-of life in September 2020! And besides, JRE distributions are no longer available.
Finally, application installers with embedded JREs were always somewhat problematic:
It was easy for software suppliers to forget to update the installer when there was a security patch to the JRE.
It was difficult for system administrators to add the embedded JRE to the list of things that were automatically updated. Especially if they allowed end-users to install the application for themselves.
The best approach will be to do the following:
Use jlink to create the distributable for your application for all platforms that you support
Update to Java 14 as soon as practical
Whenever a Java patch release with security fixes is released, assess what has been fixed and (if warranted) create new releases of the distributable for your customers to install.
If you don't want use jlink, another alternative would be to develop your code to run on Java LTS releases. (The current LTS release is Java 11, and the next one will be Java 17 which is planned for September 2021.)
Using an LTS release would allow you to release your code as JAR files.
Embedded JREs are a bad idea; see above.
I have a question about the two versions of Java: JRE (Java Runtime Environment) and JDK (Java Development Kit).
Is the JDK installed and used in addition to the JRE or is it used instead of the JRE so that one could install the JDK as a JRE with simply more functions for developers?
You must understand that JDK includes JRE. JRE is Java Virtual Machine where your Java programs run on whereas JDK is full featured Software Development Kit for Java
From the docs:
JRE (Java Runtime environment):
It is an implementation of the Java Virtual Machine* which actually executes Java programs.
Java Runtime Environment is a plug-in needed for running java programs.
The JRE is smaller than the JDK so it needs less Disk space.
The JRE can be downloaded/supported freely from https://www.java.com
It includes the JVM , Core libraries and other additional components to run applications and applets written in Java.
JDK (Java Development Kit)
It is a bundle of software that you can use to develop Java based applications.
Java Development Kit is needed for developing java applications.
The JDK needs more Disk space as it contains the JRE along with various development tools.
The JDK can be downloaded/supported freely from https://www.oracle.com/technetwork/java/javase/downloads/
It includes the JRE, set of API classes, Java compiler, Webstart and additional files needed to write Java applets and applications.
They're not two versions of Java. JRE is the Java Virtual Machine which executes bytecode. On the other hand, JDK is the Java Development Kit, which allows you to write Java code, compile it into bytecode and ships a JRE to execute it.
If your client just needs to execute Java, it needs to install the JRE only. If you want to run Java applications and create them install JDK.
One can install JDK..which has JRE also.
Recently I'm studying Java. I had no real troubles while building normal java files to .class and execute them, but, when I started a bit with applets I haven't been able to run anything.
Before I had started Java, as developer I had already a lot of development tools (Eclipse, Visual Studio, CodeBlocks and others). So, basically, I already had JDK but downloaded it again to get updated to 1.8.
Now, I have also JRE 8 and there are no troubles in using javac.exe and java.exe to build and execute, but, after building the .class file of applet, when I load the html page, I got an error which strongly recommends me to upgrade JRE.
Just to translate it:
Current version of Java is obsolete.
Upgrade (recommended choice)
Block
Later
If I do the update, it gets me to this page http://java.com/it/download/index.jsp), but, it's the download link of JRE 1.7. As much as I know, JDK 1.8 is not beta (it's accessible a 1.9 preview) so why shall I use 1.7? Indeed, after downloading and installing, when I try to run the applet, the message above is shown again.
Is actually possible to install JRE 1.8 on Google Chrome?
I resolved it. It wasn't easy since it wasn't a real trouble of java.
I had effectively Java 7 version 55 and Java 8 (but also 7-45 and 6). Java 8 was 64-bit while Java 7 was 32.
Google Chrome (32-bit browser) used so the last version it could use. According to Oracle, it's recommended to remove older versions of java (because of security) so I removed everything but the 8, and then switched to 64-bit browser (Chromium). I left older JDK installed for compatibility development reasons.
My Java applet only supports 1.4 java run time(1). I am having one machine on which both Java 1.4 and 1.6 environment is installed. Is there some setting available by which I can make sure my applet will always use Java 1.4 run time when it runs?
We are using key event class private data array bData with the help of Java reflection. The data which is there in this array JDK 1.4 and 1.6 is different in both the version.
A Java application compiled with JDK 1.4 will run on JDK 1.6.
You can compile a Java application with JDK 1.6, but compatible with JDK 1.4 by configuring the 'source level'.
Although you can choose your default JDK to be safe, but it depends on your operating system. If you are on Linux, you can choose between available Java versions using pdate-alternatives --config java command (which will modify some symlinks in the hindsight).
On Windows 7:
Control Panel -> Programs -> Java
Select 'Java' tab, and View the Java Runtime Environment settings.
Ensure that your Java 1.4 entry is selected.
There's a way to force a specific installed version to run, but if one Java plugin replaces the other there might be an issue with this. See linked question for further details.
Force Internet Explorer to use a specific Java Runtime Environment install?
Are there any issues with running the 1.4 code on 1.6? If not, you should be fine. Just avoid using anything in the classpath that changed significantly between these versions. Otherwise, look [here][1]. The codebase download thing is interesting, since it lets you download a different classpath. So, regardless of the JRE version, you could force the download of a 1.4 JRE classpath, which should ensure full compatability.
Edit: found an updated guide to using previous classpaths with newer Java versions in applets, which actually seems to work:
http://download.oracle.com/javase/tutorial/deployment/applet/deployingApplet.html
Edit 2: I actually have it working, but it appears to need to download JRE 1.4 and install it, but then it will run the applet with it automatically. However, this might be suitable for your needs.
http://www.2shared.com/file/bl3Rua2e/applet.html -- extract the archive, and then run index.html inside this. All source code is included.