Tuesday, August 9, 2011

Configuring the JCreator

If you install the program properly, when you start the JCreator the first time, you will see these screen.
 Choose save setting per user. Click Next
 Choose Java Source File. Click Next.
If you install properly, you should see something in the JDK home directory. If you made a mistake and its empty, click Browse.
The Java folder is commonly under the Program Files, so look there for the Java folder.
Select the jdk folder. The number might not be the same, depending on your jdk version. Then click OK.
Leave the JavaDocs empty and just click Finish. This is how you configure the JCreator.

Sunday, August 7, 2011

The thing about Java..introduction

Basically Java is a programming language. Like any programming language, you need to know the syntax of it. Programming is not difficult, the problem is when the error come out, you have to settle it.

There are many Java editors, I am going to use JCreator. To install JCreator, you need two things basically.
1. You need a JDK file that can be downloaded from Oracle website
2. You need the JCreator installer.

You need to install the JDK file first before installing the JCreator, or you will have problem building a file later.

Another thing, when a Java file is compiled, it does not create an exe file like C or C++. It creates a class file.

C++
Program.cpp when compiled will produce Program.exe.

Java
Program.java when compiled will produce Program.class.

But java has a peculiar habit where the class name MUST be the same as the file name, otherwise there will be an error when you try to compile the file.

public class Program {
public static void main(String args[]) {

}
}
This piece of java code MUST be saved as Program.java. Any other name, even lowercase program.java will give you error when you compile it.