Posted in How To..., Java

How to Import Existing Java Project in Eclipse


Import Existing Java Project -> Open Eclipse -> Click on File Menu -> New -> Java Project
Java Project
Java Project

Java – Download Free EBooks and Whitepapers

Give Java Project Name

New Java Project
New Java Project
New Java Project Settings
New Java Project Settings

Click on Finish; New Java Project will be available in Project Explorer -> Right Click on it…

Import Existing Project
Import Existing Project
Select General -> File System
Select General -> File System

a

Select Existing Project from File System
Select Existing Project from File System
Overwrite Dialog Box
Overwrite Dialog Box

See the Red Cross Mark in added Project due to Jar files

Java Source File Errors
Java Source File Errors

Right Click on the Imported Project

configure build path in eclipse
configure build path in eclipse

Click on Add Jars;

Add Jars in Eclipse
Add Jars in Eclipse

If Jars are not available in the Same Project which is imported then click on Add External Jar in above dialog box, Select Jars from the directory available on your system.

Jar Selcetion
Jar Selcetion

Click on Ok.

Notice, Red Marks are Gone..

Source Files Errors Removed After adding Jars in Classpath
Source Files Errors Removed After adding Jars in Classpath
Advertisements
Posted in Ant, Java

How ANT works?


How ANT works?

Each Project will have a build file (build.xml)

Each build file will contain one or more Targets

Java – Download Free EBooks and Whitepapers

The Target to be executed:

                Is either explicitly selected on the command line

                Or a project default Target is executed

Java™ Application Development on Linux® – Free 599 Page eBook

Enterprise Java Virtualization:

Understanding the TCO Implications

InfoWorld’s Java IDE Comparison Strategy Guide:

Java Essential Training

Apache Jakarta Commons: Reusable Java™ Components

Enabling Rapid ROI: With Java™ – Based Business Intelligence Applications:

Each Target is executed only once.

Project

is the top level element in an Ant script

<project> has three optional attributes:

                name: the name of the project

                default: the default target to use when no target is supplied

                basedir: the base directory from which all path calculations are done

<project name=“MyProject” default=“compile”>

                <!–- properties and targets will come here…–>

</project>

Targets

             Each project defines zero or more targets

             A target is a set of tasks you want to be executed

             When starting Ant, you can select which target(s) you want to have executed

             When no target is given, the project’s default is used

             Targets can be conditionally executed (using if/unless)

             A target can depend on other targets

             Target dependencies are transitive

             Each Target will contain one or more Tasks

             Some Tasks are executed conditionally

             Tasks are implemented as Java classes

<project name=“MyProject” default=“compile”>

                <property name=”buildDir” value=”build”/>

                <property name=“srcDir” value=“.”/> 

                <target name=”compile”>

                                <!–Tasks will come here…–>

                </target>

</project>

Tasks

             A task is a piece of code that can be executed

             A task can have multiple attributes (a.k.a arguments)

             The value of an attribute might use the value of a property.

             Ant comes with over 80 core tasks, and 60 optional tasks

             Ant task extensions can be easily written for any unique problem

<project name=“MyProject” default=“compile”>

                <property name=”buildDir” value=”build”/>

                <property name=“srcDir” value=“.”/> 

                <target name=”compile”>

                                <javac srcdir=”${srcDir}”               destdir=”${build}”/>

                </target>

</project>

Single Sign-On for Java and Web Applications

Bulletproof Java Code: A Practical Strategy for Developing Functional, Reliable, and Secure Java Code

Transforming a Generic Java IDE to Your Application Specific IDE:

The Java Virtual Appliance—No OS Required

BEA WebLogic® Operations Control: Application Virtualization for Enterprise Java

Enabling Rapid ROI: With Java™ – Based Business Intelligence Applications: