COMP112 2018 Tri 1: Using Java at Home
To do your COMP 102/112/103 Java programming on your PC (Windows, Mac, or unix) at home, you will need to
- Install a copy of the Sun JDK on your PC
- Install a copy of Bluej on your PC
- Install the ecs100 library on your PC
- Configure your PC correctly, particularly Bluej and the Java classpath
- Copy the Assignment files to your PC
The instructions below describe what you need to do with a Windows PC. Also, the ECS software distribution is only for a Windows PC. For a Mac, the locations for installing things will be a bit different, and you will need to download Mac versions of the JDK and BlueJ from the web.
Installing BlueJ and the ecs100 library file on your computer
You can use the BlueJ IDE (integrated development environment - an application to write, run, and debug programs). BlueJ is designed for new Java programmers. You may choose to use a more sophisticated IDE if you wish (eg, NetBeans or Eclipse).
Note that the ecs100 library is a little different from what was used in previous years: make sure you get the new version.
Installing on a Windows PC:
You can download and install the 4.1.2 version of BlueJ that includes JDK from
https://www.bluej.org/download/files/BlueJ-windows-412.msi.
To write and run the programs for this course, you will need the ecs100 library file, which
contains essential resources for the programs. (You will need this whether or not you are using BlueJ.)
Copy the file
ecs100.jar to your PC in
"Program Files\Bluej\lib\userlib\"
(right click on the link, and choose "save
as".) (Note that the location of the Bluej directory will be different if you have a mac or a unix computer).
Sometimes this doesn't work correctly. One cause is that when downloading ecs100.jar from
the website using internet explorer, the file may be saved as ecs100.zip. If
this is the case bluej will not load it. To fix, simply rename the file back to
ecs100.jar
.
You can also manually add the ecs100 class into Bluej if it's not doing so automatically:
- In BlueJ go to Tools --> preferences
- Click on the libraries tab.
- Click add and select ecs100.jar
Copy the file
ecs100.tmpl to
Program Files\Bluej\lib\english\templates\newclass\ecs100.tmpl
(Just right click on
the link, and choose "save as".) This will give you a template for creating
new COMP102/112/103 classes in Bluej.
Installing on a Mac:
Install Bluej. You can download the latest installer for MacOS X 10.7.3+ that includes JDK from
https://www.bluej.org/download/files/BlueJ-mac-412.zip.
To write and run the programs for this course, you will need the ecs100 library file, which
contains essential resources for the programs. (You will need this whether or not you are using BlueJ.)
Download the file
ecs100.jar to your computer.
To install it into BlueJ,
- Open the Applications folder (where you would have installed BlueJ)
- Right click on the BlueJ icon and select "show package contents"
- In the Contents, open resources, then Java, then userlib.
- Copy or move ecs100.jar from where you downloaded it into the userlib folder.
- If BlueJ is open, restart it.
You can check that BlueJ can access the file by opening preferences (inside BlueJ) and chosing the "Libraries" tab. The ecs100.jar file should be listed at the bottom of the window. If not, you can add it by clicking "add" and browsing to find the ecs100.jar file.
You may copy the file
ecs100.tmpl into BlueJ, just as you did for ecs100.jar, except that you need to open
resources
, Selectclick, open
Java
, open
english
, open
templates
open
newclass
. This will give you a template for creating new comp102/112/103-style classes in Bluej.
The files can also be found on the CD.
Installing JDK on your own PC from the web.
If you want to use a different IDE than BlueJ, you will need to install JDK8.
See
The Oracle java site to get JDK 8 (we recommend you use the same version as the one currently available in our labs) and instructions. (Note, you need JDK, not just the JRE.)
You will need to set up the
CLASSPATH
environment variable.
(See the
Readme
file of instructions for the CDs above)
Transferring files between your home computer and your directory at VUW
Most of the files that we provide can be downloaded to your home computer
from the course web pages (particularly the lecture and assignments pages).
If you want to transfer the files you have written, you may use a USB memory
stick (or CD) to carry the files between computers. You can also transfer files
to/from home via the internet using an application that supports the scp secure
copy protocol. WinSCP is good for Windows. See the
Working From Home technical note page for
more details.