wiki:Developers/SetUpEclipse

Guide to set up Eclipse for the GOAL project

Setting Eclipse for building the GOAL project from github (https://github.com/goalhub) is easy.

  • Download the latest Eclipse from https://eclipse.org/downloads/.
  • Install a Maven SCM Handler for EGit (m2e-egit) from the Eclipse market place (available from the Help menu) so you have support for maven-git integration in Eclipse.
  • Select File > Import > Maven > Check out Maven projects from SCM and copy the HTTPS clone URL on github for the project you want to build.

OLD instructions for using SVN hosted by Interactive Intelligence

The steps for setting up Eclipse for developing code for the GOAL project are documented here. Please read and follow them carefully.

You need an account to login to the repository. If you do not have an account, please register to obtain an account.

Important: Requirements

GOAL does not run on all platforms. Although the GOAL project itself has been developed using Java only, it has depencies on other software components that do impose specific requirements on platforms.

Step 1: Check whether you meet the following requirements:

  • GOAL uses SWI Prolog as the knowledge representation technology that agents use to reason about environments. Currently version 6.0.2 of SWI Prolog needs to be installed.
  • Check whether the platform that you use is supported. Please first go here to check this.
  • Finally, note that the ANTLR plugin that needs to be installed requires Eclipse 4.3 or later.

Step 2: Install SWI Prolog version 6.0.2 by clicking on the link and following instructions.

  • On Windows, Check and make sure that the Path variable is set properly by inspecting the Environment Variables under the System Properties (to be accessed via Control Panel). For Windows 7 64bit, it should contain a reference to C:\Program Files (x86)\pl\bin.

Note: we use the JPL interface to connect to SWI Prolog from Java. This may be relevant if you build from sources.

Setup Instructions

Step 3: InstallSubclipse install the Subclipse plugin

Subclipse is a plugin required by Eclipse and is needed to access the code base on the svn repository. Remark: You may need to install GEF first (if eclipse complains it cannot find draw2d). See http://wiki.eclipse.org/index.php/GEF_Developer_FAQ#Download_and_Install for details on how to do that.

Step 4: Check out the source code for GOAL:

  • Go to Window>Open Perspective>Other..., select SVN Repository Exploring, and press Ok.
  • Select the SVN Repositories tab if the tab is not visible.
  • Right click inside the tab and select New>Repository Location...
  • Insert the url link: https://ii.tudelft.nl/svn/goal/GOAL.
  • Press Finish.
  • Browse the repository and locate and select the GOAL folder.
  • Right click on the folder and select Checkout. The check out dialogue window appears.
  • Select Check out as project in the current workspace. Press Finish.

Step 5: Add the required jars to the build path of the project:

  • Switch to Java Perspective in Eclipse.
  • Select the GOAL project, right click on the project, and select Properties.
  • Click on Java Build Path and go to the Libraries tab.
  • If no jars have been added yet, select Add Jars and add all jar files in the folders GOAL/dep

Step 6: Grammar builders:

  • If you are on Windows, no action should be required. If grammar files are not compiled (e.g. GOALParser/GOALLexer in the goal.parser namespace), select the GOAL project, right click on the project, and select Properties. In the Builders section, several custom builders (e.g. MASgrammar_win) should be visible. If not, or if the files have errors, see the first known issue below, and finally contact Vincent for troubleshooting.
  • If you are on Mac or Linux, close Eclipse, and go to the main GOAL SVN folder in a file explorer. There, the files .project and unix.project should be present. Replace the .project file with the unix.project file, and make sure not to commit this change (Subclipse shouldn't commit this automatically). Open Eclipse again now, and validate everything is working using the step above; the suffixes should be _unix instead of _win now.
  • Please note that your Java installation must be present at %JAVA_HOME%\bin (Windows) or /usr/bin/java (Unix). This should be automatically the case when using a JRE/JDK.

Step 7: Create a new Run configuration in Eclipse:

  • Select menu Run>Run Configurations....
  • Select Java application.
  • Set the following: name = SimpleIDE, project = GOAL, main class = goal.tools.SimpleIDE.SimpleIDE.
  • Go to the Arguments tab, and insert the following VM argument:
    • ON WINDOWS 32BIT: -Djava.library.path="C:\Program Files (x86)\pl\bin" (or similar, check the actual locations on your machine!).
    • ON WINDOWS 64BIT: -Djava.library.path="C:\Program Files\pl\bin" (or similar, check the actual locations on your machine!).
    • ON MAC: -Djava.library.path=/usr/local/lib/swipl-6.0.2/lib/i386-darwin10.7.0 (or similar, check the actual locations on your machine!).
  • Go to Classpath and select User Entries.
  • Select Add jars. Go to the dep directory, and select and add all jars in the folders goal\dep, and osx_adapter. (In the Helios version of Eclipse these will already have been added).

Step 7a: Create a new Unit Test Run configuration in Eclipse:

  • Select menu Run>Run Configurations....
  • Select JUnit application.
  • Select Run al tests in the selected project, package or source folder. Click search and select GOAL/src/test/java.
  • Select Test runner JUnit4.
  • Go to the Arguments tab, and insert the following VM argument:
    • ON WINDOWS 32BIT: -Djava.library.path="C:\Program Files (x86)\pl\bin" (or similar, check the actual locations on your machine!).
    • ON WINDOWS 64BIT: -Djava.library.path="C:\Program Files\pl\bin" (or similar, check the actual locations on your machine!).
    • ON MAC: -Djava.library.path=/usr/local/lib/swipl-6.0.2/lib/i386-darwin10.7.0 (or similar, check the actual locations on your machine!).

Step 8: We use Java 1.7 for developing the GOAL platform. Check that your version of Eclipse uses the Java 1.7 compiler by selecting (as above) Project properties, Java Compiler and check that 1.7 is used.

Step 9: Set up the tab space of Eclipse for proper layouting:

  • Go to Preferences and then to Java>Code Style>Formatter.
  • Select Eclipse [built-in] as active profile. This will set tab space to 4.

A final remark: GOAL needs SWI Prolog to run. Of course, if you have installed Prolog somewhere else than in C:\Program Files\pl then you need to change the location accordingly in the instructions above.

You're done''' Have fun using GOAL and thanks for helping to develop it!




Known Issues

Issue: Eclipse build problems

Cause: the Subclipse plug-in sometimes does not update project files, or Eclipse does not recognize changes properly

Solution:

  • Close Eclipse and do a full SVN-update outside of Eclipse using a tool like TortoiseSVN.
  • Open Eclipse again, right-click the project (GOAL folder), and click Refresh.
  • Select Project in the menu, click Clean, and press OK.

Issue: UnsatisfiedLinkError: .\..\jpl.dll: Can't find dependent libraries.

Cause: the Windows system can not find the other dll's that jpl.dll requires. http://dev.eclipse.org/newslists/news.eclipse.technology.equinox/msg01581.html

Solution:

  • Open Control Panel/Performance? and Maintenance/System? (or right-click on My Computer and choose "Properties"). In the box that opens, click the "Advanced" tab to obtain the dialog box shown below. Next, click the button "Environment Variables".

Add the following to the PATH variable (use the semicolon ';' as separator):

  • Any directory with jvm.dll either C:\Program Files\Java\jre6\bin\client, C:\Program Files\Java\jdk1.6.0_12\jre\bin\server or C:\Program Files\Java\jdk1.6.0_12\jre\bin\client
  • The location of the prolog binaries C:\Program Files\pl\bin
  • restart Eclipse

Issue: OSX: JavaHL library missing When you install subclipse from Eclipse, you may encounter problems with it. See this note and the workarounds for it on subclipse: http://subclipse.tigris.org/wiki/JavaHL

Attached is the Subversion-1.6 installer for OSX-6.64

Last modified 2 years ago Last modified on Jun 28, 2015, 9:24:26 PM

Attachments (5)