Now we are going to start a new Java Program in Eclipse. Let’s start by opening Eclipse.

  1. Open Eclipse.
  2. Go to File → New → Java Project
  3. Give your project a name (the proper naming convention is all lowercase), then click “finish”
  4. Right click on the folder in the Eclipse Package Explorer and select New → Package

    NOTE: Packages in Java are used to create directories to organize your files. Each folder is named when you create you package. For example, naming your package “current.package.example”, your package will contain the folder current, with a subfolder called package, and one final folder called example. Proper naming convention for a package is all lowercase.

    If you do not have a Package Explorer, you can open it by going to Window → Show View → Package Explorer.

  5. Right click on the new package and select New → Class.
  6. Name your Class. Your class name should be a noun, and should be based off of what the methods and/or constructors in this class are going to be used for. The proper naming convention for a class is Pascal Case.
  7. If this is your program’s main class (the class that will perform actions based on user input or developer entry), check the “public static void main(String[] args)” checkbox.
  8. Click finish. Notice that Eclipse has now built the start of your code for you. If you are writing a main method, an example code written by Eclipse may be:
Package iuk.edu.folderexample;

Public class OneNewClass{

  Public static void main(String[] args){
  // TODO Auto-generated method stub

  }
}

These first few lines may appear confusing. However, it is very important that you understand these lines to continue your Java experience.

Previous Next

Startup Discount
Small Business?
Contact us for an Enormous Discount!