GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Eclipse
  • IntelliJ IDEA
  • NetBeans

This view

  • Original page
  • New address

GeezerVison is showing jenkov.com — Installing the Java SDK

Tech & Media Labs
Home
RSS
Java Language
  1. Java Tutorial
  2. What is Java?
  3. Installing the Java SDK
  4. Your First Java App
  5. Java Main Method
  6. Java Project Overview, Compilation and Execution
  7. Java Core Concepts
  8. Java Syntax
  9. Java Variables
  10. Java Data Types
  11. Java Math Operators and Math Class
  12. Java Arrays
  13. Java String
  14. Java Operations
  15. Java if statements
  16. Java Ternary Operator
  17. Java switch Statements
  18. Java instanceof operator
  19. Java for Loops
  20. Java while Loops
  21. Java Classes
  22. Java Fields
  23. Java Methods
  24. Java Constructors
  25. Java Packages
  26. Java Access Modifiers
  27. Java Inheritance
  28. Java Nested Classes
  29. Java Record
  30. Java Abstract Classes
  31. Java Interfaces
  32. Java Interfaces vs. Abstract Classes
  33. Java Enums
  34. Java Annotations
  35. Java Lambda Expressions
  36. Java Modules
  37. Java Method Chaining
  38. Java Scoped Access or Access Scoping
  39. Java Exercises

Installing the Java SDK

  • Installing Multiple Java SDKs
  • Installing a Java IDE

Jakob Jenkov
Last update: 2020-02-15

In order to develop Java applications or Java APIs you need the Java Software Developer Kit (Java SDK) installed. You should install the Java SDK you want to use. At the time of writing this, I am using the several different JDKs. I use Java 8 SDK for some types of apps, and Java 13 for others. The latest "Long Term Support" (LTS) version is Java 11 (as of Feb. 2020).

Since April 2019 Oracle has changed the licensing for the Java SDK they offer. The Oracle Java SDK is now no longer free to use in production. However, there exists a free OpenJDK alternative which has most of the same features. Some of the high end enterprise features are missing, but often you will not need those.

To find the right installation, simply search online for "Java SDK 13" or "OpenJDK 13" and you will find the right installation packages quickly.

Once you have installed the Java SDK, test that you have it working by opening a command prompt (textual interface to your computer, ala Unix Shell, Windows CMD etc.) and type:

java -version

If the Java SDK was probably installed you should see an output similar to this:

C:\Users\jjenkov>java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

Installing Multiple Java SDKs

If you are maintaining older Java projects you may need to have multiple Java SDKs installed. This is possible. However, typically it will be the latest version which is executed when you type java in the command prompt. In order to run an older Java SDK, write the full path to where the java (or javac or whatever command you need) is located in the older Java SDK.

If you are using an IDE, they can typically handle this for you. Typically you set a Java SDK for the project, point to where that Java SDK is installed on your machine, and the IDE takes care of using it for compiling and running your Java code.

Installing a Java IDE

If you plan to be working more seriously with Java, I would recommend that you install a Java IDE (Integrated Development Environment). An IDE contains both a code editor with syntax highlighting, code completion, code generation, often with version control system integration and more. An IDE also makes it easy to compile and run your Java code, all from within the IDE.

Here are the three most popular Java IDEs:

  • Eclipse
  • IntelliJ IDEA
  • NetBeans

Personally I use IntelliJ IDEA, but I have used all three IDEs over the years, and all of them are pretty good nowadays. IntelliJ IDEA has a free community edition which is enough for you to get started with Java. Eclipse and Netbeans are completely free.

Next: Your First Java App
Tweet

Jakob Jenkov

Featured Videos

Java ConcurrentMap + ConcurrentHashMap

Java Generics

Java ForkJoinPool

P2P Networks Introduction

















Close TOC

All Trails

Trail TOC

Page TOC

Previous

Next
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.