Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
74 views4 pages

Eclipse Java Tutorial

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 4

Java Eclipse – A Beginner’s Guide

Eclipse is an IDE for Java, maeaning that it’s essentiially a suite of utilities and features
presented in an interface. Eclipse is incredibly well received among Java community for its
resourceful text editor and the vast suite of tools it has to offer.With eclipse, writing, testing
and debuggin your code is much more convinient. Eclipse was written in Java and is completely
free and opensource.

Java enthusiasts and profesisonals use Eclipse to create new programmes, IDEs and software
utilities.

Feature highlights
Eclipse has the following main features:

 CVS client
 Windows builder
 PyDev
 Mylyn
 Integration using Maven
 Git client
 XML editor

The Eclipse interface


Upon opeining Eclipse, the window will have a views menu, an Editors button, A menu bar and
a tool bar. You can open these windows all at once if it facilitates what the operation you’re
doing. Aside from these components, Eclipse interface will have a File menu, help menu, edit
menu, run menu, navigate menu, window menu, project menu, search menu. New features are
released with updates, so make sure to keep up to speed to diversify the toolset you have.

Eclipse Perspective view


You can have several perspectives open simultaneously, but have only one perspective show up
at a time. You can switch between these perspective, or pull up a new perspective.

Here’s a list and summary of the views you can open in Eclipse.

1: Package Explorer :With package explorer view, you can overview and edit the skeletal of
your current work as well as access the different files in it.
2. Outline :Shows how a given source file is structured.

3. Problems :This view is where you can see all the error messages.

4. Javadoc : Pulls up the documentation of a given file in the text editor.

5. Java editor: Java editor is used to edit the sourcefile’s properties.

How to create a Java Program in Eclipse


Move your cursor to the select file button and a list will drop down. Select New, then select
Java Project. Then name your project and choose an appropriate package name, then hit finish.

Creating Java Package in Eclipse

Once you’ve created a project, head over to the src folder and select New>Package, and hit
finish.

Editing files in Java Eclipse

You can import copies of projects into your current project. Head over to the navigator and
double click any one of the files, and select import. A new window will pop up. Pick a file system
and hit next. Then click on browse button and look up the file you want to import, then select it.

Creating classes in Java

To create a java class, move your cursor to package and click the right mouse button. Then
select new, and pick any one of the classess avaialbe to you. name the class check the box that
says public status void main. Then press finish.

Executing a script in Java Eclipse

Head overto package explorer and click on your java class and select run as to execute a script
in Java Eclipse.

Configuring Java Build Path


Java build path is utilized when we’re compiling a Java project. Switch to package explorer view
and right click the java project and select properties. From the options available, pick java build
path.

Creating a Java project in Eclipse

Java projects corresponds to java builders, which can be displayed by switching to package
explorer view and right clicking the project you want t osee builders of.

Select Builders in the left-hand side tree

The distinction between different javva projects is based on java builders.

Testing scripts in Java


Eclipse makes ddebuggin codes in java very convinient. Just switch to the Package Explorer
view, then right click the class with the script that you want to test. Next, select “debug as” and
choose the java application.

Creating a JAR file


In order to make a Jar file, hover mouse cursor to project and select export menu from the drop
down menu. Then selec Jar file and click next an enter a the location where you want to export
the file, them click finish.

Running java program outside inteface


The program has to be exported as a JAR file before it can be executed outside eclipse.

Fire up the command terminala and head over to the jar file and include it into the classpath by
using the command below:

$java –classpath myprogram. Jar com.username.eclipse.ide.one.MyFirstclassName

Breadcrumb mode in Java

There’s this Breadcrumb mode in java that you can activate if you want to manuever across the
the source code without switching perspectives. You just have to select show by right clicking
the editor. With breadcrumb mode activated, you can move around the sourcecode directly.
How to close a Project in Ecliipse
You can reduce the runtime memory usage from Eclipse by closing some of the side projects. To
do that, you simply right-click the project you want to close and hit the close project menu.

If you want to terminate several projects at once, just rightclick a project you want to keep and
click close unrelated projects.

Content Assist feature


Content assist is a feature unique to Eclipse. It enables users to retrieve context-sensitive parts
of the script in the IDE. To enable content assist feature, press space and ctrl keys together..

Quick Fix Feature


The Quick fix feature makes suggestions for any errors that the interface detects. It highlights
the error by underlining it.

To enable quick fix feature, select the poriton of script and press ctrl and 1 together.

Wrapping things up
Eclipse provides an easy and convinient interface to create, teeest and debug java scripts and
makes things a lot easier for developers who prefer speed and accessibility while programming.
Eclipse is open source and available for free and anybody who uses Java should definitely give it
a try.

You might also like