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 path of the jdk

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

1
2
3
4
5
class FirstJavaProgram{  
    public static void main(String args[]){  
     System.out.println("Welcome to Java");  
    }  
}
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

Output : Welcome to Java

About the Author

Karibasappa G C (KB)
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