Skip to main content

Getting Started


Introduction:
This tutorial will help you get started with developing your own Java applications from scratch.

Requirements:
For developing Java applications you will need either an IDE (Integrated Development Environment) such as Eclipse which has it's own compiler built in which makes it easier for you to debug your program. Or, you can decide to use a Text Editor such as; Notepad, Notepad++ or Sublime then you will have to compile your .java files each time you would like to test your program. I would highly recommend using an IDE.

You will also need a Java JDK and the latest version of Java is recommended, both of which can be downloaded from http://www.java.com/en/.

Basic Application:
To ensure you have installed everything OK you should create a simple test project from the below steps:

1: Open your IDE and create a New Java Project.
2: Your IDE should now of generated a new Java Project. Now you can create a new Class within the src folder of your Project. Name this class "Main.java"
3: By default your class should have:

  1. public class Main {}

Within the two braces is the code block for your class. If you need to import any namespaces these will go above the generated line (more on these later).

For a basic program we will just output a line to the Console. The Console is the part of the program which is built in to the IDE or Command Line (if compiling manually), this is very useful for testing output.

So, to do this we are going to create a simple piece of code. You will learn about how the code works and how you can improve on it in later tutorials...

  1. public class Main {
  2. public static void main(String args[]) {
  3. System.out.println("Testing output.");
  4. }
  5. }

Finished!
As you can see from the thumbnail of this page, our output has worked! You are now ready to begin your next tutorial.

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.