First Program In Java

Before developing first Java program , we need to have below things set.


1) JDK Installation


Download and install the JDK using below link

Java download link

2) Set the jdk path

Now write the Java program either in notepad or in eclipse IDE.

  1. class FirstJavaProgram{  
  2.     public static void main(String args[]){  
  3.      System.out.println("Welcome to Java");  
  4.     }  
  5. }
class FirstJavaProgram{  
    public static void main(String args[]){  
     System.out.println("Welcome to Java");  
    }  
}


Save it as FirstJavaProgram.java

Compile it using below command in command prompt
Javac FirstJavaProgram.java

Now run it using below command
Java FirstJavaProgram

About the Author

Founder of javainsimpleway.com
I love Java and open source technologies and very much passionate about software development.
I like to share my knowledge with others especially on technology 🙂
I have given all the examples as simple as possible to understand for the beginners.
All the code posted on my blog is developed,compiled and tested in my development environment.
If you find any mistakes or bugs, Please drop an email to kb.knowledge.sharing@gmail.com

Connect with me on Facebook for more updates

Share this article on