NEW Java Web Programming With Eclipse – Turner, David A./ Chae, Jinseok, Ph.d.
Current Bid: $13.41
How to Program in Java Using Eclipse IDE
To be able to Program in Java using eclipse, you must Install Eclipse IDE first if you do not have the IDE yet. You can find the download links and instructions on how to have Eclipse IDE on your PC here. Assuming you already have an Eclipse IDE in your PC. Open Eclipse and follow the steps below.
How to Make a Java Project on Eclipse IDE
1. Click FILE, then NEW, then JAVA PROJECT.
2. A text box will open. Enter a name for your new Java Project. Example: First_Eclipse_Program
3. Click FINISH. Your Java Project Name will be listed on the left side bar.
4. To make a Main Class for your Java Project, right click the Project Name on the left side bar, Click NEW, Choose CLASS.
5. A Dialog box will Open, then type MAIN on the class Name. Click FINISH. Now a new interface will open, that would be your Main Class Program.
Inside the main class, the code is like this:
public class main {
}
Eclipse for Java Developers!
The Java Developer’s Guide to Eclipse, 2nd Edition, McCarthy, Pat, Kellerman, Jo
Current Bid: $14.82
The Java Developer’s Guide to Eclipse by Scott Fairbrother, Pat McCarthy, Jim…
Current Bid: $18.40
Cheap Smart Phones!
UGOOD’s High Quality Cheap Android Smartphone Fashion Women’s Mobile Phone X8 BL
Current Bid: $31.00
4.0″ NEW Cheap Android 4.0 Dual Sim WIFI Capacitive Smart phone AT&T T-Mobile
Current Bid: $63.95
Make your First Eclipse Java Project inside the Main Class
Inside the main class: Try to Copy and Paste this Code:
public static void main(String[] args)
{
System.out.println(“Yay! This is my First Program in Eclipse…:D”);
}
The whole code must look like this:
public class main {
public static void main(String[] args)
{
System.out.println(“Yay! This is my First Program in Eclipse…:D”);
}
}
6. Save the Program. Short cut is ctrl + S, it will automatically be saved.
7. Then Click Run: It is the one enclosed in red below.
Source: aisha91.hubpages.com
8. See the output on the console below.
Sample Console Output
Source: aisha91.hubpages.com
9. If you want to make another class aside from main program, just repeat the step 5, except the name must not be MAIN, make your own name. It will be another class inside the package. The MAIN name is a default name for the main program. So, every time you make another Java Project, you will also manually make the MAIN Class. If you do not, the program will not run without the MAIN class.
That’s it. If you want some other codes for beginners, better look at this one and try it out!
Java Simple Codes and Basic Programs for Beginners
See Also the Complete List of Java Tutorials and Source Codes Here!
List of Java Tutorial Examples and Source Codes for Absolute Beginners
Interesting Reads!
5 Important Tips on How to Learn Java Programming and Other Languages Easily
How to Compile and Run Java Code Online
How to Install Netbeans IDE in Your PC