<%
// Java Plug-in Framework (JPF)
// Copyright (C) 2004 - 2006 Dmitry Olshansky
// $Id$
%>
<%
include("/functions.ijxp");

printHeader("Java IDE Configuration - Eclipse IDE");
printMenu("ide");
%>
<div class="content">
	<h1>JPF-Demo as Project in Eclipse IDE</h1>
	<p><em>Note:</em> for simplicity and concreteness, instructions prepared for JPF-Demo project but applicable to any JPF based application.</p>
	<h3>Preface</h3>
	<p><a href="http://sourceforge.net/project/showfiles.php?group_id=110394&package_id=121489">Download</a> ZIP archive with JPF-Demo source code and unpack it into some location. This location will be the project "root" folder. Following instructions are created for <a href="http://www.eclipse.org" target="_new">Eclipse IDE</a> version 3.1 but similar steps applicable to earlier versions also (tested with 3.0).</p>
	<p><em>Note:</em> JPF-Demo source distribution package already contains project files for Eclipse IDE - <code>.project</code> and <code>.classpath</code> files. You have to remove these files if you whant to go through steps in this tutorial. But for quick start with JPF-Demo source code simply import provided project into Eclipse IDE workplace.</p>
	<h3>Creating Project</h3>
	<p>Open Eclipse <strong>New Project</strong> dialogue and select <strong>Java Project</strong> wizard. In the <strong>Contents</strong> section enter location of the unzipped JPF-Demo source folder.</p>
	<p><img src="resources/images/ide-eclipse-01.png" width="500" height="570" border="0" alt="Eclipse IDE" /></p>
	<p>On the next step wizard scans all project folders to detect Java source files and libraries there. The result is shown on the screen. What you have to do here is to tell Eclipse to put compiled classes for each plug-in into separate folders named <code>classes</code> and located in corresponding plug-in folders. You have to create folder with such name in every plug-in directory that contains source code and point Eclipse to put output to those folders.</p>
	<p><img src="resources/images/ide-eclipse-02.png" width="500" height="569" border="0" alt="Eclipse IDE" /></p>
	<p><img src="resources/images/ide-eclipse-03.png" width="437" height="181" border="0" alt="Eclipse IDE" /></p>
	<p>When <strong>all</strong> source/output folders configured, press <strong>Finish</strong> button. Now you should get configured JPF-Demo project. In the <strong>Package Explorer</strong> it looks like this.</p>
	<p><img src="resources/images/ide-eclipse-04.png" width="374" height="712" border="0" alt="Eclipse IDE" /></p>
	<h3>Run/Debug Configuration</h3>
	<p>Open <strong>Run...</strong> dialogue and select <strong>Java Application</strong> on the left pane. Press <strong>New</strong> button to create new Run/Debug configuration. On the <strong>Main</strong> tab enter configuration name and <strong>Main class</strong>, for JPF-Demo project this should be <code>org.java.plugin.boot.Boot</code> because JPF-Demo uses <a href="boot.html">JPF Boot Library</a> for application starting.</p>
	<p><img src="resources/images/ide-eclipse-05.png" width="738" height="572" border="0" alt="Eclipse IDE" /></p>
	<p>Now switch to <strong>Classpath</strong> tab. Here Eclipse by default included all classes and libraries from the project that is good for usual "monolithic" applications but is wrong for JPF based application. In JPF application only "boot" level libraries and classes are required for application startup, all classes that come from plug-ins shouldn't be included into application classpath because JPF itself manages lookups and loading such libraries and resources. Thus you have to <strong>Remove</strong> the whole <em>default classpath</em> section from the configuration classpath...</p>
	<p><img src="resources/images/ide-eclipse-06.png" width="738" height="572" border="0" alt="Eclipse IDE" /></p>
	<p>... and include only jpf-boot.jar library.</p>
	<p><img src="resources/images/ide-eclipse-07.png" width="738" height="572" border="0" alt="Eclipse IDE" /></p>
	<p>Here the result.</p>
	<p><img src="resources/images/ide-eclipse-08.png" width="738" height="572" border="0" alt="Eclipse IDE" /></p>
	<p>The last thing that remains to do is to configure sources for plug-in classes for comfortable debugging. Switch to <strong>Source</strong> tab and press <strong>Add...</strong> button.</p>
	<p><img src="resources/images/ide-eclipse-09.png" width="738" height="572" border="0" alt="Eclipse IDE" /></p>
	<p>In the opened window select <strong>Java Project</strong> source type...</p>
	<p><img src="resources/images/ide-eclipse-10.png" width="471" height="289" border="0" alt="Eclipse IDE" /></p>
	<p>... and mark checkbox near the JPF-Demo project. Press <strong>OK</strong> button.</p>
	<p><img src="resources/images/ide-eclipse-11.png" width="346" height="470" border="0" alt="Eclipse IDE" /></p>
	<p>Now source configuration should look like on this screen shot.</p>
	<p><img src="resources/images/ide-eclipse-12.png" width="738" height="572" border="0" alt="Eclipse IDE" /></p>
	<p>Finally you may run JPF-Demo application and debug it.</p>
	<p><img src="resources/images/ide-eclipse-13.png" width="1152" height="840" border="0" alt="Eclipse IDE" /></p>
</div>
<%
printFooter();
%>
