E Under Eclipse

= 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.
 * May 31, 2009: Directions executed successfully on MacOS X 10.5.7. (In section 6.4.4: select the appropriate bin/mac/.../swt.jar )

Installation / Setup

 * 1) Download and install a JRE http://www.eclipse.org/downloads/
 * 2) If you prefer, you can manually download JRE from http://java.com/en/download/manual.jsp
 * 3) Download and install Eclipse http://www.eclipse.org/downloads/
 * 4) Choose "Eclipse IDE for Java Developers".
 * 5) "Install" it anywhere you want by just extracting it to some place on your hard drive.
 * 6) Run Eclipse.
 * 7) Execute eclipse.exe from the folder you extracted it to above.
 * 8) When the Workspace Launcher appears give it a location you would like it to store it's data files at for you.
 * 9) On the Eclipse welcome screen click the "Workbench" button on the right side.
 * 10) Install the Subclipse plug-in.
 * 11) Follow the directions found at http://subclipse.tigris.org/install.html
 * 12) When you get to step 6, uncheck the "Integrations (Optional)" box, if you don't the install will fail due to missing dependancies.
 * 13) Checkout the latest E source code.
 * 14) Window -> Show View -> Other...
 * 15) SVN -> SVN Repository
 * 16) Add SVN Repository (button in top right of SVN Repository window).
 * 17) Url: svn://svn.synchrona.org/erights/e/trunk/src
 * 18) Right-click the top level of the source tree you just created and select "Checkout..."
 * 19) Select "Check out as a project configured using the New Project Wizard" from the Checkout dialog and click Finish.
 * 20) At the New Project wizard choose Java -> Java Project (Next)
 * 21) Project Name: E-Source
 * 22) Create new project in workspace
 * 23) Use default JRE
 * 24) Create separate folders for sources and class files
 * 25) Configure defatult (we change these because the defaults conflict with the E repository folder names)
 * 26) Source folder name: Source
 * 27) Output folder name: Output
 * 28) As JRE library use: JRE container
 * 29) (Next)
 * 30) Source Tab: Click on the folder "Source" and select "Remove source folder 'Source' from the build path".
 * 31) Finish.
 * 32) Confirm Overwrite: OK
 * 33) Wait for the SVN Checkout to complete, this may take several minutes.
 * 34) Setup E Project.
 * 35) In the Package Explorer window right-click E-Source (root of your newly checked out tree).
 * 36) Build Path -> Configure Build Path...
 * 37) Source Tab:
 * 38) Add Folder...
 * 39) Check "jsrc" and click OK.
 * 40) Libraries Tab:
 * 41) Add Class Folder...
 * 42) Check esrc, safej, bin/resources and click OK.
 * 43) Add JARs...
 * 44) Select bin/win32/x86/swt.jar and click OK
 * 45) Click OK (in the lower right you should see some action briefly while it builds everything).
 * 46) At this point I had to restart Eclipse before going on to the next step.  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.
 * 47) Setup a build configuration for Rune.
 * 48) Run -> Open Run Dialog...
 * 49) Select Java Application and click New (top left button).
 * 50) On the "Main" tab:
 * 51) Name: Rune
 * 52) Project: E-Source
 * 53) Main class: org.erights.e.elang.interp.Rune
 * 54) (Optional) Go to the Common tab and check the box for "Run" under "Display in favorites menu".  This will make running Rune easier.
 * 55) Apply and Close.
 * 56) Verify it all worked.
 * 57) Run -> Open Run Dialog...
 * 58) Select Rune and click "Run".
 * 59) (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.
 * 60) In the Console window you should see a '?' and nothing else.  Try typing the following followed by enter: 1 + 1
 * 61) If all went well you should see # value: 2 followed by another '?'

Creating a JAR File
1. Follow the directions above for Installation/Setup.

2. File -> Export...

3. Java -> JAR file (Next)

4. Under E-Source check: jsrc, esrc, safej, bin/resources

5. JAR file: E-Source/e.jar

''You will get several warnings, some of which are Java compiler warnings regarding generics which need to be resolved in the E source tree and a few at the end are regarding duplications found in the output. The latter may also require fixes in the build tree, further investigation is required though.''

6. Finish

Hello World

 * 1) Follow the directions above for Installation/Setup and JAR file creation.
 * 2) File -> New -> Java Project
 * 3) Project name: Hello World
 * 4) Contents: Create new project in workspace
 * 5) JRE: Use default JRE
 * 6) Project layout: Create separate folders for sources and class files
 * 7) Next
 * 8) Libraries tab:
 * 9) Add JARs...
 * 10) Select E-Source/e.jar and click OK
 * 11) Finish
 * 12) File -> New -> File
 * 13) Hello World/Source
 * 14) File name: HelloWorld.e
 * 15) Finish
 * 16) In the HelloWorld.e edit window enter this code and save the file:  println("Hello World")
 * 17) Run -> Open Run Dialog...
 * 18) Select Java Application
 * 19) Click the "New" button (top left)
 * 20) Main tab:
 * 21) Name: Hello World
 * 22) Project: Hello World
 * 23) Main Class: org.erights.e.elang.interp.Rune
 * 24) Arguments tab:
 * 25) Program arguments: HelloWorld.e
 * 26) Working directory: Other: Workspace...: Hello World/Output
 * 27) Apply and Run
 * 28) If all went well you should see "Hello World" in the console window.

Tips

 * For learning E, create a Run configuration just like you did for Hello World but in the arguments put "${file_prompt}" (no quotes). Doing this will make it so when you run that configuration it will prompt you for a file and pass that filename as an argument to Rune.  This will make it so you can create numerouse .e files in your project and only have to have one Run configuration (just use the open dialog to specify which .e file you want to pass to Rune).