You are on page 1of 17

Eclipse Configuration

Install Eclipse
Download Eclipse from http://www.eclipse.org

Unzip

Execute eclipse.exe

Create a directory on disk for workspaces. There can be more than one workspace. Workspaces
contain 1 or more projects, which will be created later.

On start up, browse to the directory created for workspaces and select the option to not prompt
for workspace on startup.

Install FileSync
FileSync will copy files built in Eclipse over to Windchill.

Select Help > Install New Software …


Select Add…

For “Name:”, enter FileSync.

For “Location:”, enter http://andrei.gmxhome.de/eclipse.

Select OK.
Under “ Eclipse 3.5 – 3.7 plugins”, select only FileSync. De-select all other options.

Select Next >.

Select Next >.


Select “I accept the terms of the license agreements” and select Finish.

Select OK.
Select Restart Now.

Configure FileSync
Select Window > Preferences and select File synchronization.

Select “Allow different target folders”.

Select Add Folder… and configure at least the following two folders:

 project codebase/com/gs --> WT_HOME/codebase/com/gs


 project codebase/src_gen --> WT_HOME/src_gen
Select OK.

Setup Basic Eclipse Configuration


Eclipse can scrub (delete) output directories automatically. If the output directory is set to
WT_HOME/codebase, then codebase would be deleted – this is not good. Normally Eclipse is
configured to build (compile) into directories outside of WT_HOME/codebase, but the following
preference will ensure that Eclipse does not scrub output directories.

Select Window > Preferences. Then expand Java > Compiler and select Building:

De-select “Scrub output folders when cleaning projects” and select Apply.
Setup the default output directory for compiled classes. Expand Java and select Build Path. For
“Output folder name:” enter codebase.

Select OK.
Create an Eclipse Project
Select File > New > Project.

In the “New Project” wizard, expand Java and select Java Project. Frequently, the project type
Web > Dynamic Web Project is also selected.
Select Next >.
For “Project Name”, enter any name and select Finish.

Configure Libraries for the Project


Right click on the project created and select Properties. Select Java Build Path. On the right-hand
side of the screen, select the Libraries tab.

Open a Windchill shell and review the CLASSPATH variable. On Windows, execute set cl:
Add the jars, libraries of jars and folders in the same order as the Windchill class path shown in the
Windchill shell:

 Add External Class Folder… and browse to WT_HOME/codebase


 Add External JARs… and browse to WT_HOME/codebase/WEB-INF/lib and select all JAR
files
 Add External JARs… and browse to WT_HOME/codebase/ lib and select all JAR files
 Add External JARs… and browse to JAVA_HOME/lib/tools.jar
 Add External JARs… and browse to WT_HOME/tomcat/bin/bootstrap.jar

Two additional JAR files must be added for Java Annotations:

 WT_HOME/srclib/tool/Annotations.jar
 WT_HOME/srclib/tool/AnnotationProcessing.jar

The Libraries tab will show in alphabetical order, but the actual class path order is shown in the
Order and Export tab according to the order JARs and directories were added:
Select OK.

Configure Java Annotations for the Project


Right click on the project created and select Properties. Expand Java Compiler and select
Annotation Processing. On the right-hand side of the screen, select “Enable project specific
settings”. “Enable annotation processing” should be already selected.

For “Generated source directory:”, enter src_gen.

Add 3 name/value pairs:

 eclipse_compiler / true
 gen_class_info / true
 wt.home / <path_to_WT_HOME>
Select OK.

In the left-hand side, expand Annotation Processing and select Factory Path. Select Add External
JARs… and add 7 JAR files:

 WT_HOME/srclib/tool/Annotations.jar
 WT_HOME/srclib/tool/AnnotationProcessing.jar
 WT_HOME/srclib/install/InstallUtil.jar
 WT_HOME/srclib/wnc/CommonCore.jar
 WT_HOME/srclib/jmxcore/WtLogR.jar
 WT_HOME/srclib/log4j.jar
 WT_HOME/srclib/commons-collections.jar
Select OK.

A dialog box will open indicating the project needs to be rebuilt based on the new Annotation
settings.

Select Yes.
Export the Project Configuration to Create New Projects Quickly
Select File > Export

Optional
Install Aptana
Select Help > Install New Software …

Select Add…
For “Name:”, enter Aptana.

For “Location:”, enter http://download.aptana.com/tools/studio/plugin/install/studio.

Accept the license agreements.

You might also like