Friday, 14th October 2011
Follow WikiJava on twitter now. @Wikijava

Creating a new Project with Eclipse

From WikiJava

Jump to: navigation, search
The author suggests:

buy this book


This tutorial will introduce you to the great world of Eclipse.

Once you installed the eclipse it may be hard the first time to understand what to do.

In this tutorial you will find the first steps on using Eclipse

Contents

the article

Eclipse is a great tool because it makes easy to do everything, from the easiest procedures to the most complex ones, follow these simple steps to create your first java application in Eclipse.

Once Eclipse is started:

  1. hit file -> new -> project
  2. choose java project
  3. select a name for the new project, choose something that will remind you what is the project about, most often this will be the name of the program you want to create
  4. you will now see a new project in the package explorer,
  5. expand that project and select SVN_LOCAL
  6. hit file -> new -> class
  7. compile the package name for your class, most often you will want to start with the main class which you will want to put in the base package for your software
  8. select the name of your class, this will be also the name you will use to execute the program in the
    java {Class Name}
    prompt command. Remember that according to the naming standards the name of each class should start with a capital letter
  9. check the public static void main(String[] args) to have the main already written in the newly created class
  10. check the Generate Comments to have Eclipse automatically generate the javadoc comments for automatically generate the java api manuals.

you should now see in the main window the newly created class file containing the code that was automatically generated by eclipse.

It should look like the following:

/**
 * 
 */
package com.wikijava.reflection;
 
/**
 * <Replace this with a short description of the class.> 
 * 
 * @author Giulio
 */
public class Reflection {
 
    /**
     * <Replace this with one clearly defined responsibility this method does.>
     *  
     * @param args   
     *   <n.b. for "@param" above <add a description after the field name>
     *   <n.b. for "@return" above <add the return_Type & the description>
     *   <n.b. for "@throws" (i.e. @exception) above, add "If" & description of when it happens>
     */
    public static void main(String[] args) {
	// TODO Auto-generated method stub
 
    }
 
}

You are free now to start writing your program.

after you wrote your code you can execute it by simply hitting run -> run (or ctrl+F11) and select Java Application from the menu, Eclipse will automatically compile and execute your program.


have fun.

See Also

installing Eclipse

Comments from the users

To be notified via mail on the updates of this discussion you can login and click on watch at the top of the page


Comments on wikijava are disabled now, cause excessive spam.