Showing posts with label How to start Java. Show all posts
Showing posts with label How to start Java. Show all posts

The first step of java programming is to learn print out a statement.
Using Notepad or Netbeans.

public class Welcome1
{
public static void main( String args[] )
{
System.out.print( "Welcome to Java Programming!" );

} // end method main

} // end class Welcome1

NOTE: Save it as Welcome1.java

Now you can execute this using CMD. Use Run and type cmd.
Now you need to compile the file.
Locate your file by using " cd .."
Type javac Welcome1.java to compile.
If no syntax error, den type java Welcome1 .
It will show:
Welcome to Java Programming!

How to start java???
There are few program that you can write java language. Before you start writing java language, you need to use Netbeans, Jcreator or notepad in order to write java language. Every java program that you write, you need to compile it in order to execute the application that you write. You need to download JDK and install it. This program allow you to compile the application that you write.

After you install the software, go to your control panel>system.

Click advanced system settings and click environment variables(below).

Then find ''Path'' on system variables which is the box below.

Click edit and place " ;C:\Program Files\Java\jdk1.5.0_17\bin " next to it.

Now you can start compile your .java file and execute the application.