Avatar ·

What is the difference between Oracle JDK and OpenJDK for a Java developer?

Hello everyone! I'm a beginner Java developer, and I'm confused. When I install Java on my computer (Windows 10), I see two options: Oracle JDK and OpenJDK. I usually download from the official Oracle website, but recently at work they told me to use OpenJDK.

I tried writing a simple Java 11 program on both JDKs — it seems to work the same:

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}

But I noticed that when compiling, Oracle JDK gives some warning, while OpenJDK does not. I also heard that Oracle JDK is now paid for commercial use. Is that true? Or does it only apply to older versions?

Please advise: