Topic 2_Java Environment Setup
Topic 2_Java Environment Setup
Follow the instructions to download Java and run the .exe to install Java on your
machine. Once you installed Java on your machine, you will need to set environment
variables to point to correct installation directories:
CLASSPATH is the environment variable, which shows the Java compiler, javac.exe,
the location where the class files are stored. It finds the path where the class files are
stored while compiling the Java program using the javac complier. The following steps
are required:
Setting Up the Path for Windows
Step 5: Enter the Variable name as path and the value to your jdk bin path i.e
c:\Programfiles\Java\jdk-1.6\bin and
NOTE: Make sure u start with .; in the value so that it doesn't corrupt the other
environment variables which is already set.
Setting the Environment Variables for Java (con’t)
Popular Java Editors
To write Java programs, you need a text editor. An Editor is a software system that
allows you to create and edit JAVA program on your computer.
There are even more sophisticated IDEs available in the market. The most popular
ones are briefly described below −
❑ Notepad − On Windows machine, you can use any simple text editor like Notepad
(recommended for this tutorial) or WordPad. Notepad++ is also a free text editor
which enhanced facilities.
class HelloWorld
System.out.println("Hello, World!");
}
How the program works?
❑ Class File
❑ This file contains the Bytecode of the program.
❑ Executable File The file extension of file is .class