In Eclipse Series, Part 3 , I have explained about Eclipse User Interface Used For Java Development.
Here, I will explain how to create first new java program in eclipse
Create Project
Press the
Enter the name of your new package in the dialog and press the button .
Create java class
After clicking on navigator you will find a new view in java perspective as follow:
Here, I will explain how to create first new java program in eclipse
Create Project
Select
. → →
from the menuEnter
as the project name. Select the
Create
separate folders for
sources and class files
flag.
Following this interface you will get new window as follow :
Project name : here we write the relevant name of project we want to create.
checking the default location point to the workspace we have chosen in eclipse startup.
JRE : this blocks point to the jre installed in our system, we can change it using drop down but the chosen jre should be available in our local machine.
A radio button to choose folders for .java file and generated .class file.
Press the
in.technoscience.first
folder in specified workspace and explore the content of this folder.
button to create the project. A new project is created
and
displayed as
a folder. Open the
Create Package
A good convention for the project and package name is to use the
same name
for the top level package
and
the
project. For example, if you
name your project
in.technoscience.first
you should also use in.technoscience.first
as the top-level package name.
To create the
in.technoscience.first
package, select the
src
folder, right-click on it and select
→ Enter the name of your new package in the dialog and press the button .
Reverse domain names should be used for packages to prevent
name
clashes. like if you are working in XYZ company then you should use com.XYZ.first
click on the finish button and you can check the specified package name under src folder of your specified project.
Create java class
Create a Java class. Right-click on your package and
select
→
Run your project in Eclipse
Now run your code. Either right-click on your Java class in the
Package Explorer
or right-click in the Java class and
select
→ .
After clicking on →
click on Window ==> show view ==> navigator.
After clicking on navigator you will find a new view in java perspective as follow:
But remember if you will try to open .class file in normal text editor application or eclipse it will not open , to see the content of .class you need to use decompiler and to use decompiler you can follow my post here
No comments:
Post a Comment