/[debian]/libjpf-java/trunk/jdocs/ide-eclipse.jxp
ViewVC logotype

Contents of /libjpf-java/trunk/jdocs/ide-eclipse.jxp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1601 - (show annotations)
Sat Feb 28 23:28:19 2009 UTC (12 years, 4 months ago) by gregoa
File size: 5289 byte(s)
[svn-inject] Forking libjpf-java source to Trunk
1 <%
2 // Java Plug-in Framework (JPF)
3 // Copyright (C) 2004 - 2006 Dmitry Olshansky
4 // $Id$
5 %>
6 <%
7 include("/functions.ijxp");
8
9 printHeader("Java IDE Configuration - Eclipse IDE");
10 printMenu("ide");
11 %>
12 <div class="content">
13 <h1>JPF-Demo as Project in Eclipse IDE</h1>
14 <p><em>Note:</em> for simplicity and concreteness, instructions prepared for JPF-Demo project but applicable to any JPF based application.</p>
15 <h3>Preface</h3>
16 <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>
17 <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>
18 <h3>Creating Project</h3>
19 <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>
20 <p><img src="resources/images/ide-eclipse-01.png" width="500" height="570" border="0" alt="Eclipse IDE" /></p>
21 <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>
22 <p><img src="resources/images/ide-eclipse-02.png" width="500" height="569" border="0" alt="Eclipse IDE" /></p>
23 <p><img src="resources/images/ide-eclipse-03.png" width="437" height="181" border="0" alt="Eclipse IDE" /></p>
24 <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>
25 <p><img src="resources/images/ide-eclipse-04.png" width="374" height="712" border="0" alt="Eclipse IDE" /></p>
26 <h3>Run/Debug Configuration</h3>
27 <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>
28 <p><img src="resources/images/ide-eclipse-05.png" width="738" height="572" border="0" alt="Eclipse IDE" /></p>
29 <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>
30 <p><img src="resources/images/ide-eclipse-06.png" width="738" height="572" border="0" alt="Eclipse IDE" /></p>
31 <p>... and include only jpf-boot.jar library.</p>
32 <p><img src="resources/images/ide-eclipse-07.png" width="738" height="572" border="0" alt="Eclipse IDE" /></p>
33 <p>Here the result.</p>
34 <p><img src="resources/images/ide-eclipse-08.png" width="738" height="572" border="0" alt="Eclipse IDE" /></p>
35 <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>
36 <p><img src="resources/images/ide-eclipse-09.png" width="738" height="572" border="0" alt="Eclipse IDE" /></p>
37 <p>In the opened window select <strong>Java Project</strong> source type...</p>
38 <p><img src="resources/images/ide-eclipse-10.png" width="471" height="289" border="0" alt="Eclipse IDE" /></p>
39 <p>... and mark checkbox near the JPF-Demo project. Press <strong>OK</strong> button.</p>
40 <p><img src="resources/images/ide-eclipse-11.png" width="346" height="470" border="0" alt="Eclipse IDE" /></p>
41 <p>Now source configuration should look like on this screen shot.</p>
42 <p><img src="resources/images/ide-eclipse-12.png" width="738" height="572" border="0" alt="Eclipse IDE" /></p>
43 <p>Finally you may run JPF-Demo application and debug it.</p>
44 <p><img src="resources/images/ide-eclipse-13.png" width="1152" height="840" border="0" alt="Eclipse IDE" /></p>
45 </div>
46 <%
47 printFooter();
48 %>

  ViewVC Help
Powered by ViewVC 1.1.26