en:developer:eclipse
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:developer:eclipse [2014/05/14 23:10] – external edit 127.0.0.1 | en:developer:eclipse [2023/03/13 01:46] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | |||
+ | |||
====== Eclipse and Greenstone 3 ====== | ====== Eclipse and Greenstone 3 ====== | ||
Line 7: | Line 10: | ||
In this document, $GS3SRCHOME is the full path to the top-level folder of your Greenstone 3. Wherever you see $GS3SRCHOME on this wiki page, it means you need to replace it with the full path to your top-level Greenstone 3 folder. | In this document, $GS3SRCHOME is the full path to the top-level folder of your Greenstone 3. Wherever you see $GS3SRCHOME on this wiki page, it means you need to replace it with the full path to your top-level Greenstone 3 folder. | ||
+ | |||
+ | ===== General notes on using Eclipse features ===== | ||
+ | |||
+ | === Swapping between Eclipse' | ||
+ | The instructions on this page will refer to Eclipse' | ||
+ | |||
+ | You can swap between Eclipse' | ||
+ | * **Windows > Perspective > Open Perspective > Java.** In this perspective, | ||
+ | * **Windows > Perspective > Open Perspective > Java Browsing.** In this perspective, | ||
+ | |||
+ | === To Delete a Project === | ||
+ | You can delete an Eclipse Project from the Java Browsing perspective. In the Projects tab, rightclick on the project to be deleted and choose Delete. Beware to only additionally choose to delete the contents on the disk too (and not just the Eclipse project) if you really mean to do that. | ||
=====Setting up Eclipse for use in Greenstone3===== | =====Setting up Eclipse for use in Greenstone3===== | ||
+ | The methods in the sections below can be used if you already have an SVN client on your computer. If you don't have SVN, you can instead use the Eclipse plugin Subclipse to checkout Greenstone. | ||
- | The following methods can be used if you already have an SVN client on your computer. If you don't have SVN, you can instead use the Eclipse plugin Subclipse to checkout Greenstone. | ||
- | ====Method 1==== | ||
- | ===Loading the gs3 eclipse project file into Eclipse=== | + | =====Method 1===== |
+ | |||
+ | ====A. | ||
An Eclipse project file is part of the GS3 svn checkout. It consists of a .project file, with associated .classpath file. | An Eclipse project file is part of the GS3 svn checkout. It consists of a .project file, with associated .classpath file. | ||
+ | |||
Once you've checked out a GS3 from SVN and compiled it up with an '' | Once you've checked out a GS3 from SVN and compiled it up with an '' | ||
- | In Eclipse, create a new workspace, and import this project file | + | In Eclipse, create a new workspace, and import this project file. Use File > Import and select General > Existing Projects into Workspace. Click Next and then browse to the GS3 top level directory as this contains the eclipse project file. Once selected, click Finish. (These instructions are from [[http:// |
+ | |||
+ | Check for build errors in Eclipse' | ||
- | ===To achieve the same from scratch === | + | The '' |
- | Creating a Greenstone project that can be reused with other fresh Greenstone checkouts from SVN. The src/java and gli/src folders, which contain java code, will be set up for automatic compilation in Eclipse. | ||
- | These instructions are from [[http:// | ||
- | Use File > Import and select General > Existing Projects into Workspace. Click next and then browse to the GS3 top level directory as this contains the eclipse project file. | ||
- | If you have any build errors, it means it's probably missing some newer library jar files. In that case, update | + | ====B. To achieve |
+ | Creating an Eclipse project for Greenstone that can be reused with other fresh Greenstone checkouts from SVN. | ||
- | ===Build Greenstone before opening Eclipse=== | + | ===1. Build Greenstone before opening Eclipse=== |
In an x-term: | In an x-term: | ||
Line 43: | Line 60: | ||
* run //makejar// in gli folder | * run //makejar// in gli folder | ||
- | ===Setting up Eclipse=== | + | ===2. Setting up Eclipse=== |
- | * Open Eclipse and go to Window > Open Perspective > Java (Browsing) | + | * Open Eclipse and go to Window > Open Perspective > Java Browsing |
* Rightclick in workspace' | * Rightclick in workspace' | ||
* In the New Java Project dialog that opens: | * In the New Java Project dialog that opens: | ||
* Untick "use default location", | * Untick "use default location", | ||
- | * Click Next and agree when it asks to remove all generated resources from the old location in gs3/bin | + | * Click Next and agree when it asks to remove all generated resources from the old location in greenstone3/bin |
- | * In the Source tab of the dialog screen that appears, control/ | + | * In the Source tab of the dialog screen that appears, control/ |
- | * In the Libraries tab, choose to remove both occurrences of LuceneWrapper.jar (since it's the LuceneWrapper3.jar files -- especially in gs2build/ | + | * Still in the Source tab, at the bottom set the '' |
+ | * In the Libraries tab, remove all jar files, so that only the "JRE System Library" | ||
+ | * Press Add External Jars and **first** add in the following jar files from web/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | </ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | </ | ||
+ | * The GLI source code requires further jar files. Back in the workspace' | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | </ | ||
* Press Finish to close the dialog | * Press Finish to close the dialog | ||
- | |||
- | * The GLI source code requires further jar files. Back in the workspace' | ||
- | * Press the Add Jars button, browse to open greenstone3/ | ||
- | |||
* Go to Project > Build All to find any compilation errors (there shouldn' | * Go to Project > Build All to find any compilation errors (there shouldn' | ||
* Make sure Project > Build Automatically is checked (else you'll have to keep going to Project > Build All) | * Make sure Project > Build Automatically is checked (else you'll have to keep going to Project > Build All) | ||
* Exit Eclipse | * Exit Eclipse | ||
+ | * Use a text editor to open the Eclipse '' | ||
+ | * Open the .project Eclipse file in a text editor and ensure the project is called '' | ||
**In an x-term** | **In an x-term** | ||
Line 67: | Line 124: | ||
* You can remove extraneous jar files from here as well, and resave the .classpath file so that the next time you run Eclipse, it will load the updated build path contents specified in .classpath. | * You can remove extraneous jar files from here as well, and resave the .classpath file so that the next time you run Eclipse, it will load the updated build path contents specified in .classpath. | ||
- | ====Method 2==== | + | =====Method 2===== |
- | | + | |
- | | + | |
- | | + | |
- | | + | - Open up the Eclipse' |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
+ | | ||
- | In order fix all the errors and allow the project to build correctly | + | * **Warning: |
- | * Right-click on the project folder and choose Build Path > Configure Build Path. Alternatively, | + | |
+ | | ||
+ | * Go to the Source tab and at the bottom set the '' | ||
* On the Libraries tab use the 'Add External JARs' button to add the following .jar files: | * On the Libraries tab use the 'Add External JARs' button to add the following .jar files: | ||
< | < | ||
- | [ANT DIRECTORY]/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
Line 90: | Line 149: | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
+ | </ | ||
+ | Similarly, also add all the jar files in: | ||
+ | < | ||
+ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
Line 99: | Line 163: | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
- | $GS3SRCHOME/ | + | $GS3SRCHOME/ |
- | $GS3SRCHOME/ | + | $GS3SRCHOME/ |
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
$GS3SRCHOME/ | $GS3SRCHOME/ | ||
+ | </ | ||
+ | * If '' | ||
+ | |||
+ | And if you gli/src is one of the source folders, then also add: | ||
+ | < | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
+ | $GS3SRCHOME/ | ||
</ | </ | ||
Press OK. | Press OK. | ||
+ | |||
+ | Note that **if compile time errors remain**, or errors appear during runtime, you can add try adding any further (or even all) the jars in: | ||
+ | < | ||
+ | $GS3SRCHOME/ | ||
+ | </ | ||
You can now edit the Java files and make use of the advanced IDE features as you would normally be able to. This approach does not work very well when you need to change the name of a file or add a new file. In these cases you will probably want to make the modifications directly on the file system and then re-import the specific files affected. | You can now edit the Java files and make use of the advanced IDE features as you would normally be able to. This approach does not work very well when you need to change the name of a file or add a new file. In these cases you will probably want to make the modifications directly on the file system and then re-import the specific files affected. | ||
Line 121: | Line 204: | ||
1. Open the GS3 .project Eclipse project file in Eclipse. | 1. Open the GS3 .project Eclipse project file in Eclipse. | ||
- | 2. In the Java perspective view, navigate down to executable java file and right-click on it. | + | 2. In the **Java perspective** view, navigate down to executable java file and right-click on it. |
E.g. rightclick on the TransformingLibrary.java in src/ | E.g. rightclick on the TransformingLibrary.java in src/ | ||
http:// | http:// | ||
Line 139: | Line 222: | ||
* There are some [[en: | * There are some [[en: | ||
* For a **walkthrough with screen shots** of the steps involved in installing Greenstone 3 by using the Eclipse plugin Subclipse (for checking out Greenstone 3 code from SVN), see [[http:// | * For a **walkthrough with screen shots** of the steps involved in installing Greenstone 3 by using the Eclipse plugin Subclipse (for checking out Greenstone 3 code from SVN), see [[http:// | ||
- | |||
en/developer/eclipse.txt · Last modified: 2023/03/13 01:46 by 127.0.0.1