15

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?

7
  • 6
    How 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.
    – user22815
    Commented Feb 28, 2015 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
    Commented Feb 28, 2015 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) Commented Feb 28, 2015 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". Commented Mar 1, 2015 at 0:04
  • @R.., where did you hear such “best practices”? Commented Mar 1, 2015 at 5:54

3 Answers 3

44

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
  • 3
    A 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
    Commented Feb 28, 2015 at 20:05
  • 1
    Bundling JRE requires licensing and it's awfully dangerous if the application accesses the internet.
    – acelent
    Commented Mar 1, 2015 at 0: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? Commented Mar 1, 2015 at 7:16
12

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.

1
  • I wish this were the case for Android :(. Commented Mar 1, 2015 at 1:27
1

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.