Ant, Log4J, Junit, Eclipse

Topics: Apache Ant, Java platform, Java Pages: 4 (666 words) Published: May 29, 2010
1. Technical Specification

The target application environment Java compiler's version is Java 1.5. Create a project in Eclipse.
Need to connect a database (e.g. Oracle).
Should log error message using Log4J.
Delivery the project as a jar.

2. Procedures

2.1 Create User Library for Log4J and JDBC driver (oracle-jdbc)

2.2 Add these two user libraries to the project build path

2.3 Establish The Application Environment in Eclipse

2.3.1 Create file.properties file as a property file for the application to read

2.3.2 Create a log4j.properties file for log4j to read

2.4 Follow the instructions to set up JUnit available to Ant

2.5 Create build.xml file

2.1 Create User Libraries

1. In Eclipse, Window > Preferences > Java > Build Path > User Libraries. 2. Click New button, and enter the 'user library name'.
3. Click Add JARs... button, and select the jar files to be added to this user library. 4. Click OK button.

Do the above steps for Log4J, and oracle-jdbc

2.2 Add User Libraries to the project

1. Right click the project, and select properties (or Alt+Enter). 2. Select Java Build Path > Libraries, and click Add Library... button 3. Select User Library, and click next> button
4. Select lo4j, and oracle-jdbc (the two we just created in the previous step). 5. Click OK to add these user libraries to the project environment.

Doing this can make sure these libraries are in the project classpath.

Notes:

Add User Library to the project build path will allow the the project to be compile and run using Eclipse internal build and run.

2.3 Establish Project Structure

1. Create build directory, and its sub directories (classes and jar) md build/classes
md build/jar
2. Create lib directory, and copy log4j, oracle-jdbc, and junit jars in.

2.3.1 Create file.properties file as a property file for the application to read name1 = value1
name2 = value2

2.3.2 In the src directory, create a...
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • Ants Essay
  • JUnit Essay
  • Ants Essay
  • The Eclipse Essay
  • Eclipses Essay
  • Essay about Eclipse
  • Eclipse Essay
  • Eclipse Essay

Become a StudyMode Member

Sign Up - It's Free