Skip to content

Latest commit

 

History

History
93 lines (73 loc) · 4.19 KB

eclipse.md

File metadata and controls

93 lines (73 loc) · 4.19 KB
title keywords sidebar toc permalink folder
Running RinSim examples using Eclipse
installation
eclipse
installation_sidebar
false
/installation/eclipse/
installation

{% include note.html content="Are you having trouble with running RinSim? See the troubleshooting tips." %}

Prerequisites:

Instructions:

  1. Open Eclipse, choose File -> New -> Project...
    ![New]( {{ "images/installation/eclipse/1a.png" | relative_url }}) ![Project]({{ "images/installation/eclipse/1b.png" | relative_url }})

  2. Choose Maven Project and click Next >
    ![New]({{ "images/installation/eclipse/2a.png" | relative_url }})

  3. Check Create a simple project (skip archetype selection) and click Next > ![New]({{ "images/installation/eclipse/2b.png" | relative_url }})

  4. For Group Id: choose a unique personal identifier, often a reversed Internet domain name is used for this. For Artifact Id: choose an identifier for your project.
    Click Finish
    ![New]({{ "images/installation/eclipse/2c.png" | relative_url }})

  5. In your Package Explorer you should see the following:
    ![New]({{ "images/installation/eclipse/3.png" | relative_url }})


Note that by default Maven uses (the ancient) Java 1.5. Since RinSim requires at least Java 1.7 we will change this in the next steps.
  1. Open the pom.xml file with the Maven POM Editor. Choose the pom.xml tab in the bottom.
    ![New]({{ "images/installation/eclipse/4a.png" | relative_url }})

  1. You will see an XML view of the file. Add (paste) the following XML code between the project tags. Make sure to not overwrite the existing XML tags.

    <dependencies>
        <dependency>
            <groupId>com.github.rinde</groupId>
            <artifactId>rinsim-example</artifactId>
            <version>x.y.z</version>
        </dependency>
    </dependencies>
    
    <build>
    	<plugins>
    		<plugin>
    			<groupId>org.apache.maven.plugins</groupId>
    			<artifactId>maven-compiler-plugin</artifactId>
    			<version>2.1</version>
    			<configuration>
    				<source>1.7</source>
    				<target>1.7</target>
    			</configuration>
    		</plugin>
    	</plugins>
    </build> 
  2. Replace x.y.z with the current latest version (the latest version is shown here). The pom file should now look similar to this:
    ![New]({{ "images/installation/eclipse/4b.png" | relative_url }})

    Check that the JRE System Library as shown by Eclipse is version 1.7 (or higher), if this isn't the case it often helps to force Maven to update the project: right click on your project -> Maven -> Update Project... If that doesn't work it may be that Eclipse can't find a correct Java version in which case you need to update your Eclipse settings.

  3. Maven will now start downloading the dependencies. When it is done, make sure your can find the rinsim-example-x.y.z.jar in your Package Explorer:
    ![New]({{ "images/installation/eclipse/5a.png" | relative_url }})

  4. Right click rinsim-example-x.y.z.jar -> Run As -> Java Application
    ![New]({{ "images/installation/eclipse/5b.png" | relative_url }})![New]({{ "images/installation/eclipse/5c.png" | relative_url }})

  5. You will see the following window, select SimpleExample and click Ok
    ![New]({{ "images/installation/eclipse/5d.png" | relative_url }})

  6. You should now see the following window:
    {% include image.html file="examples/simple-example.gif" alt="Simple example" caption="This is an animation of the simple example." url="/learn/examples/simple/" %} Congratulations, Your setup is complete, you can start working with RinSim! Click Control -> Play to start the simulation. For more information about the other available examples, click here.

{% include tip.html content="you can download the sources of RinSim and all other dependencies by right clicking your project -> Maven -> Download Sources" %}