Java development tools
- Eclipse http://www.eclipse.org/downloads/
- Net Beans https://netbeans.org/features/index.html
- J Developer http://www.oracle.com/technetwork/developer-tools/jdev/overview/index.html
- J Creator http://www.jcreator.org/download.html
But if you are new to java it is better to use Text editor like
- Notepad++ http://notepad-plus-plus.org/download/v6.4.1.html
- Code::Blocks http://sourceforge.net/projects/codeblocks/
- J Edit http://www.jedit.org/index.php?page=download
- Edit Plus http://www.editplus.com/
But in this way you have to compile manually. You need command prompt to compile and run the programs. Let’s see how to save, compile and run java programs.
Your first java program
Class name is ‘Hello’
You can type this in your text editor.
When you are saving, there is a genuine method.
You have to save your program with ‘.java’ extension and the file name should be the class name which contain the main method.
In this program,
- Hello – class name
- Public – access modifier
- Static – can be accessed without requiring an instantiation of the class to which it belongs
- Void – not return anything
- Main – main method
- String – string data type
- Args[ ] = array
- System.out.println(“ ”) – this is for display somthing in java
Saving the file.
- Save the file as Hello.java in known folder.
- Just think I saved this file in Desktop in the folder named Ravi.
- Then go to the command prompt.
- Windows 7 – start-> run-> type cmd and enter.
- Windows 8 – press windows button-> type cmd-> select command prompt.
- Now you have to select where your file has been saved.
- You can change the directory by typing cd<space>folder name or partition.
So you have to change directory to desktop first and then change the directory to Ravi folder.
cd desktop
and then,
cd Ravi
Now you can access the file.
You have to compile the file before run.
Compiling command is ‘javac’
Type javac Hello.java
Then you can run the file.
Running command is java
Type java Hello
Look at this image to understand.
cd desktop
and then,
cd Ravi
Now you can access the file.
You have to compile the file before run.
Compiling command is ‘javac’
Type javac Hello.java
Then you can run the file.
Running command is java
Type java Hello
Look at this image to understand.
Java development tools and your First java program
Reviewed by Ravi Yasas
on
10:50 PM
Rating:
No comments: