The Java is GPL license (reference from wikipedia). I am not sure I can use it in in commercial projects. I already have a website written in Java and I plan to use this for commercial use. Is that illegal?

  • 2
    @Sathya That question is about using a GPL plugin in a Java app. This question seems to be about the legality of using Java itself.
    – Adam Lear
    Commented Feb 27, 2011 at 5:37
  • 6
    @Shisoft Considering how many commercial Java applications are out there, I don't think you have anything to worry about. You'd see at least a few lawsuits if it weren't okay.
    – Adam Lear
    Commented Feb 27, 2011 at 5:38
  • 1
    Java SE is no longer GPL it is BCL. Oracle is free to change the license as they please. (FAQ #8 oracle.com/technetwork/java/javase/overview/…). That being said, Oracle cannot renag older versions of Java released under the GPL.
    – snmcdonald
    Commented Feb 27, 2011 at 5:38
  • 3
    @snmcdonald OpenJDK 6 & 7 continue to be licensed as GPL with Classpath Exception. "Sun" JDK 6 and earlier have never been GPL. (IANAL) Commented Feb 27, 2011 at 13:51

8 Answers 8


The GPL license applies to the source of Java itself, not to applications created using Java. You should only be concerned if you are extending / modifying the Java language itself and reselling the result as a commercial product (or any other non-GPL license).

  • 8
    This is at the very best murky, which is why there is GPL with Classpath Exception. Code running on the JDK is linked to the Java library. Code linked to GPL code is supposed to GPLed (subject to the relevant jurisdictions' interpretation). (I am not a layer!) Commented Feb 27, 2011 at 13:45
  • 3
    @tom - it's called the standard library exception - otherwise all code that called into a GPLed Linux kernel would have to be GPL Commented Feb 27, 2011 at 22:58
  • 4
    @Tom: which is exactly why the classpath exception exists, to ensure that compiled Java code (all of which relies on the standard libraries which are GPL if you downloaded the OpenJDK release, not if you downloaded the commercial release) does not have to be GPL.
    – jwenting
    Commented Feb 28, 2011 at 7:52
  • this answer is correct only correct because it is released under GPL with classpath exception and not raw GPL
    – ihebiheb
    Commented Sep 30, 2018 at 18:40

OpenJDK is licensed under GPL with Classpath Exception. The Classpath Exception part is important. It allows you to use OpenJDK with software of any licence, not just the GPL. In particular, you can use OpenJDK with proprietary software.

  • 2
    @Shisoft "Sun" implementations of Java SE 6 and earlier are licensed under a variety of licences, some of them free as in beer, but not [as yet] any flavour of GPL. OpenJDKs 6 & 7 (6 is a backward port of 7), are GPLv2 with Classpath Exception. It's intended to do a "Sun" release of JDK7 as well. Commented Feb 27, 2011 at 13:49

Java JDK binary is NOT GPL, it is BCL. Oracle is free to change the license as they please. (FAQ #8) That being said, Oracle cannot renege older versions of Java released under the GPL.

Always consult the License for up-to-date information. As of today the license states:

Internal/In-house use: The Java SE platform binaries (JDK and JRE) are licensed under Sun's Binary Code License (BCL) with supplemental terms. For most developers and end-users, the binary JDK and binary JRE are all that's needed to experience the world of Java technology. USE: The binary JDK and JRE are available at no fee from Sun (per terms of the BCL) for use with desktop personal computers. JDK or JRE use for embedded devices and other computing environments may require a license fee from Sun. Read more about embedded use of Java SE, or contact your local Sun office to obtain a license.

Keep in mind you cannot release Java SE on an embedded device (think Google Android) as stated by the FAQ.

The Java SDK source is available under the SCSL and JPL license.

Source Code: The JDK source code is available for researchers and others interested in exploring the details of the JDK. Each release has its own license or set of licenses which frequently includes the Sun Community Source License (SCSL) terms. Sun has recently started offering simplified access to the JDK source code under the a new Java Research License (JRL). Note that in either case (SCSL or JRL), if you decide to use your project internally for productive use or distribute your product to others, you must sign a commercial agreement and meet the Java compatibility requirements. Contact your local Sun office to obtain an agreement.

  • 2
    -1 Your wording suggested that the Sun/Oracle-provided JDK distribution downloads were once GPL, but no longer. This is not true. They never were GPL. What was, and is, released under GPL, is the OpenJDK, which is different from the commercial JDK releases. As the copyright holder of OpenJDK, they are free to provide commercial, non-GPL, releases of derivatives of OpenJDK. Commented Nov 27, 2011 at 16:36
  • 2
    Additionally, in the OpenJDK FAQ: "Oracle JDK is based on the OpenJDK source code. In addition, it contains closed-source components. The final result is licensed under a Binary Code License." The closed-source stuff is stuff from third parties that they couldn't get relicensed. For a truly-free, complete OpenJDK distribution, there's IcedTea (which is what most GNU/Linux distributors use as their main Java implementation). Commented Nov 27, 2011 at 16:48

You are confusing several things.

  • The GPL is a license concerning the redistribution of software. Even if the Java compiler you used was GPL'ed, this wouldn't prevent you from distributing your own software, because that's different from redistributing Java. (And the Java runtime can be downloaded separately from Oracle, anyway).
  • The GPL is not incompatible with commercial software. Some answers here seem to be confusing "proprietary vs free (as in speech)" with "commercial vs free (as in beer)". It's true certain care must be taken when selling GPL'ed software (selling does count as "redistribution"), but it's not impossible to do.
  • Oracle's implementation of Java is not GPL'ed. Read its license here.
  • Open JDK is a GPL'ed implementation, but as mentioned above, this doesn't make it incompatible with commercial software.

As I know , according to current license Java is under BCL(Sun's Binary Code License) , you can use JDK and JRE free for commercial use . Use ECLIPSE as your IDE as enty point to develop your Java code. It is an opensource one so you don't need any lisence for the same. When you are working on project , you will need many other tools to perform various stuffs. Most of required functions are given as plugins(downloadable) in eclipse.


After movement to Java BLC the entire licensing of Java usage is subject to interpretation which means "contact Oracle if you want to really sure".

That means pay if they want you to pay. As per BLC, Java can be freely used for "General Purpose Desktop Computers and Servers" (as in http://www.oracle.com/technetwork/java/javase/terms/license/index.html) , whose definition includes words "general purpose computing".

I don't know if my computing is a general purpose computing - are you sure that yours is? Oracle have also added clauses like "used for general computing functions under end user control".

Check with your legal department.

  • 6
    This is FUD. I see plenty of companies around me, including big-name banks, using Java without any giving any thought to licensing problems.
    – quant_dev
    Commented Dec 31, 2011 at 19:03
  • 1
    Ask Google if it ever caused any problems. Skepticism in trusting Oracle with regards to their interpretation of copyrights is warranted to the tune of $9 billion. I hope you're right - but I bet Google thought the same. Oracle recently made a big deal out of changing the license, so presumably they expect that license to yield $$. caveat emptor
    – Jeff K
    Commented Sep 5, 2019 at 20:12
  • @JeffK The problem with Google was about reimplementing (for various reasons) standard Java APIs. This has nothing to do with you writing your business software with Java. If you ever want to reimplement Java or its standard library or JVM you may have to worry, but otherwise you're free to use Java (as is the case with most of us).
    – Andres F.
    Commented Feb 27, 2020 at 17:53

No. As far as I currently know, the GPL only limits the use of the source code of the code or program licensed with it (in this case, the program which runs Java code). But it does not limit the Java code itself.


You can compile an application using gcc, which is free software. Then you can license your app as you please, but not the gcc compiler.

  • 3
    Last time I checked, gcc didn't compile Java. Commented May 15, 2013 at 16:12

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