| <?xml version="1.0" encoding="iso-8859-1" ?> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <!--http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd--> |
| <html xmlns="http://www.w3.org/1999/xhtml" |
| > |
| <head><title>Setting up the Workspace for Java Projects</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
| <meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" /> |
| <meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" /> |
| <!-- xhtml,3,next,html --> |
| <meta name="src" content="etrice-doc.tex" /> |
| <meta name="date" content="2013-10-21 12:44:00" /> |
| <link rel="stylesheet" type="text/css" href="etrice-doc.css" /> |
| </head><body |
| > |
| <!--l. 1--><div class="crosslinks"><p class="noindent">[<a |
| href="etrice-docse5.html" >next</a>] [<a |
| href="etrice-docse3.html" >prev</a>] [<a |
| href="etrice-docse3.html#tailetrice-docse3.html" >prev-tail</a>] [<a |
| href="#tailetrice-docse4.html">tail</a>] [<a |
| href="etrice-docch2.html#etrice-docse4.html" >up</a>] </p></div> |
| <h3 class="sectionHead"><span class="titlemark">2.2 </span> <a |
| id="x8-270002.2"></a>Setting up the Workspace for Java Projects</h3> |
| <!--l. 3--><p class="noindent" ><span |
| class="ec-lmssbx-10">Objectives for this tutorial:</span> </p> |
| <ul class="itemize1"> |
| <li class="itemize">create all needed library projects (runtime.java and modellib.java) |
| </li> |
| <li class="itemize">create the tutorial project with the examples |
| </li> |
| <li class="itemize">create the project with a traffic light simulator |
| </li> |
| <li class="itemize">test the workspace setup by running one of the examples</li></ul> |
| <!--l. 11--><p class="noindent" > |
| </p> |
| <h4 class="subsectionHead"><span class="titlemark">2.2.1 </span> <a |
| id="x8-280002.2.1"></a>Create Library, Tutorial and Simulator Projects</h4> |
| <!--l. 13--><p class="noindent" >After installation of eTrice in Eclipse, your workspace should look like this (note the eTrice item in the main |
| menu): |
| </p><!--l. 15--><p class="noindent" ><img |
| src="images/013-SetupWorkspace01.png" alt="PIC" |
| /> |
| </p><!--l. 17--><p class="noindent" >Select the menu <span |
| class="ec-lmsso-10">File->New->Other</span> |
| </p><!--l. 19--><p class="noindent" ><img |
| src="images/013-SetupWorkspace02.png" alt="PIC" |
| /> |
| </p><!--l. 21--><p class="noindent" >Open the <span |
| class="ec-lmsso-10">eTrice </span>folder and select <span |
| class="ec-lmsso-10">eTrice Java Runtime</span> |
| </p><!--l. 23--><p class="noindent" >Press <span |
| class="ec-lmsso-10">Next </span>and <span |
| class="ec-lmsso-10">Finish </span>to install the Runtime into your workspace. |
| </p><!--l. 25--><p class="noindent" ><img |
| src="images/013-SetupWorkspace03.png" alt="PIC" |
| /> |
| </p><!--l. 27--><p class="noindent" >Do the same steps for <span |
| class="ec-lmsso-10">eTrice Java Modellib</span>, <span |
| class="ec-lmsso-10">eTrice Java Tutorials </span>and <span |
| class="ec-lmsso-10">eTrice Trafficlight for Tutorials</span>. To avoid temporary |
| error markers you should keep the proposed order of installation. The resulting workspace should look like |
| this: |
| </p><!--l. 31--><p class="noindent" ><img |
| src="images/013-SetupWorkspace04.png" alt="PIC" |
| /> |
| </p><!--l. 33--><p class="noindent" > |
| </p> |
| <h4 class="subsectionHead"><span class="titlemark">2.2.2 </span> <a |
| id="x8-290002.2.2"></a>Perform Setup Test</h4> |
| <!--l. 35--><p class="noindent" >To check the correct setup of your workspace we run a little testproject contained in the tutorial project. |
| </p><!--l. 37--><p class="noindent" >The tutorial models are available in the <span |
| class="ec-lmsso-10">org.eclipse.etrice.tutorials.java </span>project. All tutorials are ready to generate and run |
| without any changes. To test the code generator and the workspace setup simply run <span |
| class="ec-lmsso-10">gen_SetupTestJava.launch </span>as |
| <span |
| class="ec-lmsso-10">gen_SetupTestJava</span>: |
| </p><!--l. 41--><p class="noindent" ><img |
| src="images/013-SetupWorkspace05.png" alt="PIC" |
| /> |
| </p><!--l. 43--><p class="noindent" >The successful generation ends with <span |
| class="ec-lmsso-10">Info: – finished code generation </span>in the Console. |
| </p><!--l. 45--><p class="noindent" ><img |
| src="images/013-SetupWorkspace051.png" alt="PIC" |
| /> |
| |
| |
| </p><!--l. 47--><p class="noindent" >For each tutorial in the folder src-gen a java package is generated including a java file called <span |
| class="ec-lmsso-10">SubSys<...>Runner.java</span>. |
| To run the generated application simply run this file as a Java application. Try this with the file |
| <span |
| class="ec-lmsso-10">src-gen/SetupTest_Model/SubSysClass1Runner.java </span>: |
| </p><!--l. 51--><p class="noindent" ><img |
| src="images/013-SetupWorkspace06.png" alt="PIC" |
| /> |
| </p><!--l. 53--><p class="noindent" >To stop the application type <span |
| class="ec-lmsso-10">quit </span>in the console window. If your Console contains the lines |
| |
| |
| </p> |
| <div class="verbatim" id="verbatim-1"> |
| ****************** |
|  <br />*** Setup OK *** |
|  <br />****************** |
| </div> |
| <!--l. 58--><p class="nopar" > your setup should be ok. |
| </p><!--l. 61--><p class="noindent" ><img |
| src="images/013-SetupWorkspace07.png" alt="PIC" |
| /> |
| </p><!--l. 63--><p class="noindent" >Now the workspace is set up and you can perform the tutorials or start with your work. |
| |
| |
| </p> |
| <!--l. 1--><div class="crosslinks"><p class="noindent">[<a |
| href="etrice-docse5.html" >next</a>] [<a |
| href="etrice-docse3.html" >prev</a>] [<a |
| href="etrice-docse3.html#tailetrice-docse3.html" >prev-tail</a>] [<a |
| href="etrice-docse4.html" >front</a>] [<a |
| href="etrice-docch2.html#etrice-docse4.html" >up</a>] </p></div> |
| <!--l. 1--><p class="noindent" ><a |
| id="tailetrice-docse4.html"></a> </p> |
| </body></html> |