How to Run Java Program with Tester Library Using Eclipse IDE

How to Run Java Program with Tester Library Using Eclipse IDE

<p>How to run Java program with tester library using Eclipse IDE.</p><p> Download and install Eclipse.</p><p> Decide where you will keep your work and define two folders/directories, one for the project workspace and one for the libraries you will use. We will name them EclipseWorkspace and EclipseJars.</p><p> Start Eclipse, when it asks you for the workspace, use the EclipseWorkspace folder.</p><p> In the Windows menu select Open Perspective... then select Java (possibly within the Other sub-menu). Your workspace should look like this:  In File menu select New then Java Project. A window will open:</p><p> Choose the project name (e.g. Project1), select to Create separate folders for sources and class files and Finish.  In the Project Explorer you can see your project. Click on the triangle next to the project name and you should see the following:</p><p> Highlight the src line, then select in the File menu New then File and you should see the following:  Type in the name of the file, for example Shapes.java, and Finish.</p><p> Copy and paste the file Shapes.java into the center pane that now has a label Shapes.java. You should see the following in the center pane:</p><p> Save the file, by selecting Save in the File menu, or by using the Save button in the toolbar.</p><p> You can edit the file as you wish – maybe adding a comment about the author, or today’s date.</p><p> However, your program still shows a number of errors. You need to tell the Project where to find the tester library. Highlight the project or src or (default package) in the Project Explorer window then select Properties in the Project menu.</p><p> In the left pane select Java Build Path.</p><p>  In the top bar of the main pane select Libraries, then select on the left Add External JARs.  In the browser that opens, select the tester.jar you have saved in the EclipseJars folder. If you want to use the World libraries, select also the three additional jars: draw.jar, geometry.jar, and colors.jar.</p><p> To run the program, you need to set up the Run Configuration as follows:</p><p> In the Run menu select Run Configurations...</p><p> In the left pane select Java Application.</p><p> You will see the following. Fill in the name of your project and give your configuration a new name (usually the same as the project name).  Then select the main class by hitting the Search button. You will get a number of choices. Select Main – tester.  You are now back in the Run Configurations window. Select Apply, then Run.</p><p> Next time you want to run, you can just hit the green Run button in the toolbar, as long as your Java program file is currently showing in the main pane.</p><p> Here are the results you will see in the Console window at the bottom. At any time, if you double-click inside of one of the windows (Java file, Console), it will appear as a full size window. If you double-click again, it will return back to its original position and size within the Eclipse workspace.</p><p> You now need to fix the problems. All checkExpect tests should be using double data. Change all exact values to doubles.</p><p> Run the program again. You should now succeed. </p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    10 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us