Basic step for installing and setting up environment.
- Download Latest Version of Java From Here: JAvA WEBSITE.
- Install the Java.
- Setting up Environment Variables:
For Windows XP- Right Click on My Computer and then select properties.
- Click on Environment Variable under the tab "Advance".
- Now modify the path variable.
Example: If it contains any value leave it and at very last add the following:
;C:\Program Files\Java\JDK\
where after ";" is JDK Path where you install Java.
- Right Click on My Computer and then select properties.
- Select Advanced System Setting under the Advanced Tab.
- Follow the same thing as described for XP.
- Run your bash or shell program.
- Write: export PATH=/path/to/java:$PATH
- Almost Done.
- For writing java program you can use Notepad or Notepad++.
- Write your first java program in any text editor and save it with anyname with suffix(extension) ".java"
- Open command prompt(in Windows) or shell/bash(in Linux).
- Move to your file location by using cd.
Example: If you save your file in C:\test\myfile.java then you write cd c:\test - Write javac YourFileName.java
- If there is no syntax error in your java program then its returns nothing.
- Write java YourClassName
For Windows 7 or Windows 8
For Linux, Unix or FreeBSD
No comments:
Post a Comment