Menu
Laney College

Java Setup

Java Setup

Before yo start coding in Java, you need to make sure to download and install the necessary software. Here is what you need:

1. Download the Java Software Development Kit (JDK) from Oracle’s web site: Click on the below link and choose the latest version of JDK for your system (Usually Windows or Mac) to download. You will also need to accept the license agreement before downloading.

– Download Java SDK (Links to an external site.)

2. Download an Integrated Development Environment (IDE): Now, you need to download an IDE to help you with writing, compiling and running java files. To start, we will use Sublime Text Editor as the IDE. It  is  lightweight IDEs for students and beginners. We will also use Greenfoot which is another Java IDE that supports graphic applications.

– Download and install Sublime Text: https://www.sublimetext.com

– Download and install Greenfoot: https://www.greenfoot.org/download

3. Creating your Java Path (For Windows users): Please see the 2 minutes YouTube tutorial for setting up java path. Make sure follow the exact steps as show in video.

JAVA is not recognized as an internal or external command (YouTube)

Note: Don’t forget to add semicolon (;) at the end of address in variable value. 

4. Create a new java file using Sublime Text. Name the file Test.java and save it some where on your Desktop. 

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

5. Compile and Run your program

1. Open the command-line and navigate to where you saved your java file

2.  Type javac Test.java to compile the file

3. Type java Test to execute the file

How to use Command line:

Windows: https://www.digitalcitizen.life/command-prompt-how-use-basic-commands

MAC: https://www.taniarascia.com/how-to-use-the-command-line-for-apple-macos-and-linux

For more information on getting started with Java, check out W3Schools.com: https://www.w3schools.com/java/