E Under Eclipse

From Erights

Revision as of 06:17, 19 May 2008 by Micah (Talk)
Jump to: navigation, search

Windows XP

While these directions worked for me on Windows XP, it's very likely the same set of instructions would also work on *nix, MacOS X and other versions of Windows.

Installation / Setup

1. Download and install JRE http://www.eclipse.org/downloads/

* If you prefer, you can manually download JRE from http://java.com/en/download/manual.jsp

2. Download and install Eclipse http://www.eclipse.org/downloads/

* Choose "Eclipse IDE for Java Developers".
* "Install" it anywhere you want by just extracting it to some place on your hard drive.

3. Run Eclipse.

1. Execute eclipse.exe from the folder you extracted it to above.
2. When the Workspace Launcher appears give it a location you would like it to store it's data files at for you.
3. On the Eclipse welcome screen click the "Workbench" button on the right side.

4. Install the Subclipse plug-in.

* Follow the directions found at http://subclipse.tigris.org/install.html
* When you get to step 6, uncheck the "Integrations (Optional)" box, if you don't the install will fail due to missing dependancies.

5. Checkout the latest E source code.

1. Window -> Show View -> Other...
2. SVN -> SVN Repository
3. Add SVN Repository (button in top right of SVN Repository window).
4. Url: svn://svn.synchrona.org/erights/e/trunk/src
5. Right-click the top level of the source tree you just created and select "Checkout..."
6. Select "Check out as a project configured using the New Project Wizard" from the Checkout dialog and click Finish.
7. At the New Project wizard choose Java -> Java Project (Next)
 * Project Name: E-Source
 * Create new project in workspace
 * Use default JRE
 * Create separate folders for sources and class files
 Configure defatult (we change these because the defaults conflict with the E repository folder names)
  * Source folder name: Source
  * Output folder name: Output
  * As JRE library use: JRE container
 * (Next)
8. Source Tab: Click on the folder "Source" and select "Remove source folder 'Source' from the build path".
9. Finish.
10. Confirm Overwrite: OK
11. Wait for the SVN Checkout to complete, this may take several minutes.

6. Setup E Project.

1. In the Package Explorer window right-click E-Source (root of your newly checked out tree).
2. Build Path -> Configure Build Path...
3. Source Tab:
 1. Add Folder...
 2. Check "jsrc" and click OK.
4. Libraries Tab:
 1. Add Class Folder...
 2. Check esrc, safej, bin/resources and click OK.
 3. Add JARs...
 4. Select bin/win32/x86/swt.jar and click OK
5. Click OK (in the lower right you should see some action briefly while it builds everything).

At this point I had to restart Eclipse before going on to step 7. I am not sure what the problem is but no matter how many times I tried to do this I always had to restart eclipse or I would be unable to set a Main Class.

7. Setup a build configuration for Rune.

1. Run -> Open Run Dialog...
2. Select Java Application and click New (top left button).
3. On the "Main" tab:
 1. Name: Rune
 2. Project: E-Source
 3. Main class: org.erights.e.elang.interp.Rune
4. (Optional) Go to the Common tab and check the box for "Run" under "Display in favorites menu".  This will make running Rune easier.
5. Apply and Close.

8. Verify it all worked.

1. Run -> Open Run Dialog...
2. Select Rune and click "Run".
3. (Optional) If you added it to the favorites menu you can just use the Run tool in the toolbar which should have "Rune" listed in the dropdown.
4. In the Console window you should see a '?' and nothing else.  Try typing the following followed by enter: 1 + 1
5. If all went well you should see # value: 2 followed by another '?'



Old Instructions

After further experimentation with Eclipse I have found a better way to go about this that involves the use Subclipse (subversion inside of eclipse). This eliminates the errors caused by .svn directories if you follow these directions. I have also learned how to get Eclipse to make a JAR of the E sources and have it launch your code using Rune. I'll post these additional instructions shortly.

1. Download and install JRE http://www.eclipse.org/downloads/

* If you prefer you can manually download JRE from http://java.com/en/download/manual.jsp

2. Download and install Eclipse http://www.eclipse.org/downloads/

* Choose "Eclipse IDE for Java Developers".
* "Install" it anywhere you want by just extracting it to some place on your hard drive.
* You may want to create a shortcut to eclipse.exe for easier access on your desktop or in your start menu.

3. Download and install TortoiseSVN from http://tortoisesvn.net/downloads

* Alternatively you could use the command line SVN tool from http://subversion.tigris.org/project_packages.html

4. Create a new folder somewhere called E-Source.

* You can name the folder whatever you want, I will reference it as C:\E-Source from here on out.

5. Checkout E into E-Source.

1. Right-click E-Source and select "SVN Checkout...".
2. For the "URL of repository:" put: svn://svn.synchrona.org/erights/e/trunk/src
3. Leave the other settings defaulted to:
 * Unchecked only check out the top folder.
 * Unchecked omit externals.
 * Head revision.
 * Checkout directory C:\E-Source

6. Launch Eclipse via eclipse.exe in the folder you extracted eclipse to.

7. When the Workspace Launcher appears give it a location you would like it to store it's data files at for you.

* I DO NOT recommend choosing E-Source.
* The default location of your Documents and Settings folder is reasonable.
* Feel free to select the box to not ask you for a workspace again.

8. On the Eclipse welcome screen click the "Workbench" button on the right side.

* You should now see the Java IDE with a traditional GUI IDE looking environment.

9. File -> New -> Java Project.

1. Project Name: E
2. Contents: Create project from existing source
3. Contents Directory: C:\E-Source
4. Next
5. Wait a bit while it does it's thing.

10. New Java Project Java Settings:

1. Under the source tab at the bottom set the Default output folder to: E/classes
2. Click on E/jsrc in the top part of the Source tab and then click on "Configure inclusion and exclusion filters" from the details below.
3. Click "Add..." for Exclusion patterns and enter: **/.svn
4. Under the Libraries tab click "Add Class Folder..."
5. Check the box next to esrc and safej.
6. Click Finish.
7. When prompted to remove E\bin choose NO.  Failing to do so will delete necessary files.
8. Wait a bit while it does it's thing.

11. Once back at the main IDE right-click on E in the Project Explorer and select Build Path -> Configure Build Path...

12. Under the Libraries tab click "Add Class Folder..." and check E/bin/resources.

13. Still under the Libraries tab click "Add JARs..." and add E/bin/win32/x86/swt.jar.

14. Click OK and your project should rebuild itself, this time the Problems tab will only show a bunch of warnnings but no errors.

15. Run -> Open Run Dialog...

1. Select Java Application and then click the New button above.
2. Name: My E Configuration
3. Project: E
4. Main class: Search...: Rune - org.erights.e.elang.interp
5. Apply.
6. Run.
*
* In the bottom of your window you should see a ?, you can type 1 + 1 <enter> and it will tell you what that equals. :)
*
Personal tools
more tools