Search This Blog

Tuesday, October 12, 2010

Running your first program in JCreator.

After you setup JCreator the next task is to write a small code to verify the setup. This section will help you on writing java , compiling and running Java code for the first time in IDE. Double click on the JCreator icon on your desktop and select new file.

1) Select Main Class or Java Class as and click next.

Quiz : What is the difference between Main class and Java Class. Think !!!

image

2) It is always better to give some meaningful name to your java file and store it in some particular folder. This step will help you in doing this.

image

3) JCreator will automatically generate the following code for you along with comments. (It is always considered as a good practice to write comments when you write code)

image

4) After writing code click on Build Menu and select “Build File”. If your code don’t have bugs then in Build Output you will see Process Completed, otherwise it will show you the errors. This is equivalent to compiling the code by using “javac FirstExample.java”.

image

5) After compiling successfully you can click on Run Menu and select Run File this will run you file and show you the output in General Output tab. This step is equivalent to executing the code by issuing the command “java FirstExample

image

6) By following the above steps you can simply write java code and compile.

HACK : You can skip step 4 and simply execute step 5. It will do step 4 + step 5. This will save some time of yours.

Done Thumbs up. If you need any other help please post your comments.

Running your first program in JCreator.SocialTwist Tell-a-Friend

No comments:

Post a Comment