Is Java Free for Commercial Use? The Full Answer

Yes β€” if you use an OpenJDK distribution. OpenJDK and its third-party builds (Eclipse Temurin, Amazon Corretto, Azul Zulu, Microsoft Build of OpenJDK, Liberica) are licensed under the GPL v2 with Classpath Exception, which explicitly permits commercial use at no cost. Oracle JDK is the only flavour that requires a paid subscription for commercial production use.

The one-sentence rule

If your java -version output says OpenJDK at the start, you are free. If it says Java(TM) SE Runtime Environment, you may owe Oracle a subscription fee for commercial production use.

Why does Oracle JDK cost money?

Oracle changed its licensing model with Java 11 (September 2018). Before that, Oracle JDK was free for all uses. From Java 11 onward, Oracle separated: the free path became OpenJDK (same code, different licence), and Oracle JDK became a commercial product. Oracle justifies this with premier support, more frequent patch backports, and GraalVM integration. Most organisations found the free OpenJDK builds good enough and switched.

What counts as "commercial production use"?

Under Oracle's subscription model, any use that generates revenue or supports business operations qualifies. Running an internal tool used by your company's employees counts. Shipping a product to paying customers counts. Development, testing and evaluation are free even with Oracle JDK.

Safe free choices for production

  • Eclipse Temurin β€” adoptium.net β€” most popular, monthly security patches, free forever.
  • Amazon Corretto β€” optimised for AWS, also runs anywhere.
  • Microsoft Build of OpenJDK β€” install via winget install Microsoft.OpenJDK.21.
  • Azul Zulu Community β€” broad platform support including Alpine Linux musl builds.
  • GraalVM Community Edition β€” free, adds native image compilation and polyglot capabilities.

Do cloud providers care?

If you run on AWS, Azure or GCP, the managed Java services (Elastic Beanstalk, Azure App Service, Cloud Run) typically ship Corretto or Temurin by default β€” no Oracle licence needed. Check what your cloud provider bundles if you care about support SLAs.

What about Java on Android?

Android's Java SDK is a separate licensing matter entirely. Android uses its own Dalvik/ART runtime, not the JVM. Google and Oracle settled their long-running API copyright case in 2021. Android developers are free to use Java and Kotlin without Oracle licence concerns.

Bottom line

Install Temurin or Corretto. They are functionally identical to Oracle JDK for the vast majority of workloads, they are free in production, and they receive the same CVE patches. Unless you specifically need Oracle's premier support contract or GraalVM Enterprise features, there is no reason to pay for Oracle JDK.