Menu

JmlEclipseSetup

Anonymous

[JmlEclipse] Developer Setup

These notes are intended for JML developers willing to test and/or contribute to the [JmlEclipse] project.

Getting and setting up Eclipse

  • Obtain the latest 3.5 version of Eclipse from here or here.
  • Install the Subclipse plug-in, e.g., using the update site: http://subclipse.tigris.org/update_1.6.x (See note ![1].)
  • If you are planning on viewing and/or editing the JDT grammar and you would like syntax highlighting, hyperlinks, etc., then install gedit_1.0.2. Follow the link to get a jar file, then drop the .jar in your Eclipse plugins directory. (See note ![2].)

Setting up your workspace

The following needs to be done every time you create a new workspace.

  • [IMPORTANT] Open the Eclipse Preferences, under General >> Workspace >> Linked Resources: define a new variable named WORKSPACE linked to your Eclipse workspace that will contain the [JmlEclipse] related projects.
  • Ensure that your default Java runtime for Eclipse is JDK 1.6, as follows:
    • Navigate to Window >> Preferences >> Java ... >> Installed JREs (or Eclipse >> Preferences >> Java ... >> Installed JREs on OS X).
    • Ensure that you have a Java 6 JDK installed. (This is a JDK, not a JRE.)
    • Select the check box for the jdk1.6 (so that it will be used by default).
  • Ensure that the compiler compliance level is set to 1.6 (Window >> Preferences >> Java ... >> Compiler).
  • optional Open the SVN perspective and add a new SVN repository using the URL: https://jmlspecs.svn.sourceforge.net/svnroot/jmlspecs
    For more information about JmlSpecs subversion access see here. (This step is optional because importing the project set file mentioned below will create the necessary CVS and SVN repository entries for you.)

Checking out and building [JmlEclipse]

The easiest way to load [JmlEclipse] and all of the required test files is to:

  • Download the jmleclipse-from-sf-svn.psf project set file.
  • Import this project set file using File >> Import ... Team >> Team Project Set.

Project building is automatic (by default).

[IMPORTANT] A small code change to the JDT APT project (org.eclipse.jdt.compiler.apt) is needed. Since this change is very small we have chosen to not mirror the JDT APT through our vendor branch and keep a local modified copy -- the overhead is not worth it at this point. Hence you need to apply the change manually.

  • In the org.eclipse.jdt.compiler.apt project, add the following lines of code to end of the org.eclipse.jdt.internal.compiler.lookup.AptSourceLocalVariableBinding constructor body:

    // <jml-start id="JIR"/>
    this.jml.setJmlModifiers(localVariableBinding);
    // <jml-end id="JIR"/>
    

Notes

  • ![1] If your Eclipse does not have the Mylyn plug-in, then you will want to unselect the "integration with mylar, mylyn, etc" when you get the error concerning the missing org.eclipse.mylar* plug-in. You will have to expand the tree to see the options.
  • ![2] If you relaunch Eclipse and you do not get syntax highlighting (i.e. color) when viewing java.g, then you need to exit and relaunch Eclipse again, but this time add you might have to provide it with the -clean flag.

Related

Wiki: EclipseCvsRepository
Wiki: JmlEclipse

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.