A Simple Hello World Java Program

| Last Updated: | In: Java


In this tutorial, i will explain how to write the simple hello world java program and execute on apache tomcate server. Before start writing Java program you need to install JDK in your machine.

How to install the JDK

Downloa the JDF file from Click here and install it into your system. After installation set your jdk/bin path and then start writing a simple java program.

HelloWorld program in Java

How to create a hello world java program

Below is the complete example of a simple hello world java program. Create a HelloWorld.java file and copy paste below code:

Save the HelloWorld.java file and open command prompt to compile and run you java program. Use below command to perform the action:

1) Compile: javac HelloWorld.java (It will create the HelloWorld.class file after successfully compilation)
2) Execute: java HelloWorld (It will print the Hello World!)

The output is:

Tags:


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.


You may also like:

Follow us!

Get Free Access of 400+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Free Guide: Learn how to implement security guideline in your WordPress site...

DOWNLOAD

Pincode Finder

pincode-finder tool

Online Pincode Finder

Best tool to locate post Office address and pincodes of all india...

SEARCH NOW