Before we start learning Java we should prepare our machine so that our machine should understand as well as process the code written in Java language.
To configure our system for java, we should know following :
- As per our operating system being installed in our system, which extension of file we need to use for installing java. ( as for window it requires .exe file and for linux .tar file)
- which version of Java is released and as per requirement which version of Java we should install.
To get these information please visit ORACLE OFFICIAL WEBSITE and get the supported file and required version.
- After downloading the required file where you should install it, by default if you follow the installation instruction for windows operating system then it will be installing in "C" drive inside program files, but i will not suggest to install it inside program files directory because later when u will be installing build tool like ant then you will be facing problem. so i will suggest to install it in "C" drive but in separate Java directory.
- After installing the Java we need to set the path for installed java so that our system could understand that newly installed software.
- I am not going to explain how to set the system variable and path for Java, because if you will Google it you can find lots of link. (it is always better to take little effort! so dig to Google for this step) or you can follow my another post http://learntechnolgy.blogspot.in/2014/03/configuring-java-in-windows.html
In upcoming posts,i will explain why we need to set the path ? What is system variable and class-path.
After performing these all steps we need to check whether we have done it right or not ?
To check this we need to open the command prompt in window. Then in command prompt we can check the installed Java for that we we need to write following:
java -version
if java has been set correctly in path you will be getting following message on window:
java version "1.7.0_10"
Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
Java HotSpot(TM) Client VM (build 23.6-b04, mixed mode, sharing)
Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
Java HotSpot(TM) Client VM (build 23.6-b04, mixed mode, sharing)
If Java is not set correctly in system path then we you will be getting the following message:
'javac' is not recognized as an internal or external command, operable program or batch file
If you receive this error, Windows cannot find the compiler (
javac
).If you receive this message then we need to go back to following steps and and check again about the system variable and system path.
I tell you, writing first java program is not tough but configuring your System for Java become confusing and burden for the beginner. so try to get these steps and configure your system properly to write the java programs.
No comments:
Post a Comment