I want to develop a desktop Java application, deploy it as a jar file and sell it.
What is the latest Oracle JDK version I can use to keep it free assuming I don't need further updates nor support and I will keep using this version for a couple of years.
Should I stick with Oracle JDK-8u202?

Wht not Java 11?
I want maximum compatiblity. I don't want to target users with only JRE 11 installed and answer users' questions about application not working or Java updates. I just want it to work for everyone. JRE 8 is dominant with with over 60%, and 11 adoption is only about 25%. Even Minecraft still uses Java 8.

  • I am not sure, did the Java license change lately? How about JVM forks, like adoptopenjdk or others? – peterh May 24 '20 at 1:08
  • 1
    OpenJDK is the main variant/reference implementation of Java, and is available under GPL + Classpath Exception. The current version is Java 14, although you likely want a LTS release such as 8 (supported till 2026 via AdoptOpenJDK) or 11 (supported till 2024 via AdoptOpenJDK or Corretto). Oracle's variant adds some features and includes the possibility of extended support, but is subject to more restrictive licensing conditions – you probably don't want to use it. Please don't ship outdated software like 8u202. – amon May 24 '20 at 8:17
  • 1
    I’m voting to close this question because as not about Free Software or Open source. The phrase "for free" in the title makes it clear. That the question is about price, not freedom. – ctrl-alt-delor May 25 '20 at 21:49

There is no limitation on the Java Runtime Environment (JRE) or Java Development Kit (JDK) you can use for free in commercial software.

You've misunderstood how Java is licensed: First of all, Java is more like a specification than a piece of software. Oracle publishes the Java specification which defines how the language and runtime work, and anyone can implement the specification by writing their own Java Development Kit or Java Runtime Environment. (I'm not sure of any off the freedoms, either gratis or libre to write your own JDK or JRE - The specification license isn't clear on that point.)

Oracle provides two implementations. The Oracle JDK which is closed source, but still free as in gratis. They also provide the open source OpenJDK which is some variation of free as in libre as well as gratis.

You do not have to pay anything to write software in the Java language, or which runs on a Java Runtime Environment - Appendix A of the Java specification details that point. Your customers can also acquire a copy of a JRE at no cost from various sources: I believe the OpenJDK is GLPv2, so you could include a copy of OpenJDK with your software provided you also included the OpenJDK source code. Your application and the Java implementation are separate pieces of software, so my understanding is the GPL from the OpenJDK would not effect your ability to commercially license your application which runs on the java implimentation.

Otherwise, a common solution is to have your installer get your customer to agree to a JRE (Oracle, OpenJDK, dosn't matter...) license when you install your software, and then have your installer automatically download and install download the JRE from the official distributor. This way you aren't "shipping" the software you don't have the license to distribute, but still ensuring the user acquires it when they need it to run your software.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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