Am I correct to assume that most end users are using an older version than Java 8? Since I do not want to force people to upgrade in order to use my application, should I plan it to use Java 7 or even 6 from the start, even if that means that I can't apply the benefits of the newer versions for myself as a developer?
-
6How will the answer to this question be relevant in a year? Five years? Asking a question about e.g. Java 8 as compared to Java 7 is fine, but asking which of the two versions to use is not a good question for this site for the fact that the question itself is stuck in time, not to mention it is essentially asking for a product recommendation. – Feb 28 '15 at 16:39
-
Who are your users and what kind of application is it? An application for the grandmas of the world is different from a utility application for IT people. – Freiheit Feb 28 '15 at 17:26
-
Java doesn't come preinstalled (unlike .NET on Windoze), so you'll have to include (a subset of) JRE with your application. So, you can use whatever is the best. That means — use latest stable version. (that means now — a version of JRE 1.8) – Display Name Feb 28 '15 at 17:30
-
Being that best practices for security are to consider having Java installed an unacceptable risk, I think the only reasonable answer is "none at all". – R.. GitHub STOP HELPING ICE Mar 01 '15 at 00:04
-
@R.., where did you hear such “best practices”? – Arturo Torres Sánchez Mar 01 '15 at 05:54
-
@R.. I think you're mixing up java as a browser plugin (that applets run it) and java for desktop applications (that programs like minecraft run in). Security for desktop applications are a moot point since an equivalent .exe has rights to trash your computer running a .jar instead can't be worse – Richard Tingle Mar 01 '15 at 11:14
-
@RichardTingle: No. While the browser plugin is the single biggest risk and can be disabled, there are plenty of additional risks like the possibility of bundled malware being installed when the auto-update runs and the possibility of the browser plugin being accidentally enabled (when upgrading or otherwise). – R.. GitHub STOP HELPING ICE Mar 02 '15 at 01:55
3 Answers
Relying on an installed JRE to be correct doesn't make sense outside of a controlled corporate environment where all the desktops are locked to a specific version. In which case, you should ask this question of the person who controls that environment.
For a mass-market Java desktop application, you should use an installer or launcher that bundles the JRE you want them to be using, or set up Java Web Start (JAWS).
Note that if you actually physically distribute a bundled JRE, you have to comply with the license terms. I am not a lawyer, but those shouldn't be problematic for most purposes. If you are in a situation where you have a legal team, you should of course run it past them.
For a developer or other technically-oriented tool, it is generally preferable to publish the jars on Maven Central, so distribution and download is entirely automated. This is one case where sticking to older Java versions is something of an advantage, as it enables their use in corporations locked down to an older version.
But I wouldn't worry about that too much for a project started today.
Finally, if all the above is too much work, you can just publish the source on github or bitbucket and let the user build it themselves.

- 3,625
- 23
- 15
-
3A timeless answer to a timeful question, awesome. I would add that you can distribute a JRE free alternate version for people who like that sort of thing. Could make that a portable release even. – Weaver Feb 28 '15 at 20:05
-
1Bundling JRE requires licensing and it's awfully dangerous if the application accesses the internet. – acelent Mar 01 '15 at 00:44
-
Please elaborate, does that mean that I have to license a JRE even if I'm going to release my software without an intent for profit, or maybe even open source? – Andreas Hartmann Mar 01 '15 at 07:16
Java 6 is unsupported by Oracle, so don't use that. Java 7's support ends on April 15th, so you know. Just use Java 8 and save yourself the hassle.
See Oracle's support roadmap for more info.

- 309
- 1
- 3
Another point to consider is that, depending on the size of your project, what version of Java will be out and what will be obsolete. For most sizable projects, it would be wise to work with the current 'out of beta/alpha' version, (in this case Java 8) which may or may not be current when you release.

- 21
- 2