How does Java run a program?

Ever wonder how a Java program works?

For a program to run, it first is translated into bytecodes by compiling..

In the picture below, a source program HelloWorld.java is examined by a java program called javac.

The source program must be translated into bytecodes.

The file of bytecodes (machine language for Java ) is called HelloWorld.class.

A Java bytecode is a machine instruction - very low level code that we are not going to learn. The architecture of this process has been very carefully designed by the designers of Java at Sun Corp. and is freely available to anyone.
A bytecode file will contain exactly the same bytecodes no matter what computer system is used. The Java compiler on a Macintosh will produce the exact same bytecodes as the Java compiler on an Intel system.

Now, what are we going to learn?

How to write the source code to solve problems.
Then you compile and the compiler creates the class.
When you execute, the class is run.

The software JCreator does all of these for you. If the compiler does not understand your source code, you will get a compiling error - NOT A GOOD THING!!. Our software attempts to tell you what the error is.  You will fix the error, compile and execute again.