SE450: Installing Eclipse and Related Tools

Contents [0/10]

Using Eclipse: Install Java, Eclipse and Graphviz [1/10]
Using Eclipse: Install code for this class [2/10]
Using Eclipse: Enable JUnit, Disable some warnings [3/10]
Using Eclipse: Downloading homework [4/10]
Using Eclipse: Uploading homework [5/10]
Using Eclipse: Uploading a manually created zip file [6/10]
Using Eclipse: Installation problems? [7/10]
Using Eclipse: What to do if you cannot see package explorer in Eclipse [8/10]
Using Eclipse: Run problems? [9/10]
Using Eclipse: Useful stuff in eclipse [10/10]

Using Eclipse: Install Java, Eclipse and Graphviz [1/10]

There is a video walking through these steps on windows: Java/Eclipse/Graphviz installation

Quick links:

Step-by-step:

Using Eclipse: Install code for this class [2/10]

There is a video walking through these steps on windows: SE450 workspace movie

Quick links:

Step-by-step:

Using Eclipse: Enable JUnit, Disable some warnings [3/10]

Using Eclipse: Downloading homework [4/10]

Follow these instructions:

hw-zip-get1
hw-zip-get2
hw-zip-get3
hw-zip-get4

Using Eclipse: Uploading homework [5/10]

After you have completed the assignment, save your work in eclipse and then follow these instructions:

hw-zip-put1
hw-zip-put2
hw-zip-put3
hw-zip-put4
hw-zip-put5
hw-zip-put6
hw-zip-put7
hw-zip-put8
hw-zip-put9
hw-zip-put10
hw-zip-put11
hw-zip-put12

Using Eclipse: Uploading a manually created zip file [6/10]

Some of you are not using eclipse and so are submitted zip files. That's fine, but please be sure that the zip files have the correct folder structure:

            
myhw1/
  |-- InventorySet.java
  |-- InventoryTEST.java
  |-- Record.java
  |-- RecordTEST.java
  |-- VideoObj.java
  |-- VideoTEST.java

Please unzip your file and make sure it has this structure. There should not be more or fewer directories

Here are some correct examples from unzip -l

CORRECT (this is what eclipse creates):
  Length     Date   Time    Name
 --------    ----   ----    ----
       25  09-22-15 13:50   META-INF/MANIFEST.MF
     2969  09-22-15 13:42   myhw1/InventorySet.class
     4352  09-22-15 13:41   myhw1/InventorySet.java
      936  09-22-15 13:42   myhw1/RecordTEST.class
      396  09-22-15 13:41   myhw1/RecordTEST.java
     2506  09-22-15 13:42   myhw1/InventoryTEST.class
     2749  09-22-15 13:41   myhw1/InventoryTEST.java
     1773  09-22-15 13:49   myhw1/VideoObj.class
     2978  09-22-15 13:49   myhw1/VideoObj.java
     1095  09-22-15 13:42   myhw1/Record.class
     1590  09-22-15 13:41   myhw1/Record.java
     1949  09-22-15 13:47   myhw1/VideoTEST.class
     1549  09-22-15 13:47   myhw1/VideoTEST.java
 --------                   -------
    24867                   13 files

CORRECT (This is what a manual zip should create):
  Length     Date   Time    Name
 --------    ----   ----    ----
     4682  09-21-15 21:18   myhw1/InventorySet.java
     2800  09-21-15 21:41   myhw1/InventoryTEST.java
     1590  09-20-15 14:07   myhw1/Record.java
      397  09-20-15 23:02   myhw1/RecordTEST.java
     3593  09-20-15 21:16   myhw1/VideoObj.java
     3261  09-20-15 20:55   myhw1/VideoTEST.java
 --------                   -------
    16323                   6 files

Here are some incorrect examples from unzip -l

NOT CORRECT (too many directories!):
  Length     Date   Time    Name
 --------    ----   ----    ----
     4682  09-21-15 21:18   se450/src/myhw1/InventorySet.java
     2800  09-21-15 21:41   se450/src/myhw1/InventoryTEST.java
     1590  09-20-15 14:07   se450/src/myhw1/Record.java
      397  09-20-15 23:02   se450/src/myhw1/RecordTEST.java
     3593  09-20-15 21:16   se450/src/myhw1/VideoObj.java
     3261  09-20-15 20:55   se450/src/myhw1/VideoTEST.java
 --------                   -------
    16323                   6 files

NOT CORRECT (too few directories!):
  Length     Date   Time    Name
 --------    ----   ----    ----
     4608  09-21-15 22:49   InventorySet.java
     3209  09-21-15 22:55   InventoryTEST.java
     1590  09-16-15 19:36   Record.java
      396  09-16-15 19:36   RecordTEST.java
     3939  09-21-15 22:08   VideoObj.java
     3449  09-20-15 15:08   VideoTEST.java
 --------                   -------
    17191                   6 files

Using Eclipse: Installation problems? [7/10]

If you have errors after installing eclipse and the code from class, please watch this: Eclipse problems

Uninstall everything and try again.

If that does not work, email me ASAP. Don't waste time trying to fix a broken eclipse install.

Here is some advice that has worked in the past.

It has happened for some students that suddenly eclipse shows a bunch of
errors, whereas previously everything was fine.

First thing to try is to clean all projects using

Project -> Clean

Then look at the previous slide to see if it matches your situation.
You maybe can adjust the compiler settings to get it to work.

If you still have problems, you should just start with a fresh workspace.

Exit eclipse.

Using the finder, go to your workspace.
Rename it to oldworkspace and create a new folder called "workspace"
Inside workspace, create a new folder called "se450"
Move the following folders from oldworkspace/se450 to workspace/se450

lib
data
src

Now start eclipse in the new "workspace".
It should be as though you are starting eclipse for the first time.
Follow the instructions provided earlier to add the "se450" project
and to turn off the warnings for unused variables and private fields.

Some more advice that has worked in the past.

It may happen that eclipse shows compiler errors in the code that I have provided.
For example, it may say something like:

-- The method printf(String, Object[]) in the type PrintWriter is not
   applicable for the arguments (String, int, long)
-- The method put(ThreadReference, Stack<HashMap<LocalVariable,Value>>) in
   the type HashMap<ThreadReference,Stack<HashMap<LocalVariable,Value>>> is
   not applicable for the arguments (ThreadReference, Stack<Object>)

These are compiler issues, indicating that you are not using the correct
language compliance level.
To fix this, do the following:


Check that Project Specific Settings are NOT checked in the following places

Project -> Properties -> Java build path
Project -> Properties -> Java compiler

Then check 

Preferences -> Java -> Compiler
Preferences -> Java -> Installed JREs

to make sure that compliance level is set to 1.8 
and that a Java SE 8 runtime is checked.

Then got to 

Project -> Clean

and clean all projects.

Using Eclipse: What to do if you cannot see package explorer in Eclipse [8/10]

To show the package explorer, do this:

package-explorer1

Once it is showing, you can adjust the view using the buttons:

package-explorer2

Using Eclipse: Run problems? [9/10]

You may get this Run As box in eclipse, like this:

install-run1

Or this:

install-run2

If so, then try selecting the program you want to run in the package explorer and using a right click to bring up a context menu. You can select run from there:

install-run3

The run button is context sensitive in eclipse. It's behavior varies depending upon where the mouse was last clicked and what the last command to be run was. This problem usually sorts itself out. So try the run button again later.

Using Eclipse: Useful stuff in eclipse [10/10]

To stop copy paste from inserting bogus imports

  "Preferences" > "Java" > "Editor" > "Typing" > (Under "When Pasting") 
  uncheck "Update Imports"

To get autocompletion when typing characters other than .

  "Preferences" > "Java" > "Editor" > "Content Assist" > (Under "Auto Activation")   
  paste the following in the textfield for "Auto activation triggers for Java"

  ._abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789

  Use uparrow/downarrow to go through the suggestions
  Use enter/return to accept a suggestion
  Use escape to dismiss the suggestions


Revised: 2008/09/22 19:32