Extend the Help Menu:

traderainSoftware and s/w Development

Aug 15, 2012 (5 years and 29 days ago)

422 views

Installing the JDK and NetBeans



Step 1: Download the JDK with NetBeans Package

As of this writing, the product we need to download is "
JDK 7u2+NetBeans Bundle
". If the Oracle
website or version number has changed and you have any trouble finding the JDK/Ne
tBeans package,
please consult your instructor. It can currently be downloaded at this link:


http://www.oracle.com/technetwork/java/javase/downloads/index.html


Click the D
ownload button (see image).




Step 2: Click Download Link

Begin the download by clicking the Download link (see image).





Step 3: Choose Your Platform

Continue by choosing the "Windows" Platform and check the box to accept the license agreement.
Click the Continue button.





Step 4: Save the installer file

Click the file name "jdk
-
6u22
-
nb
-
6_9_1
-
windows
-
ml.exe" and save the file to your Desktop (or a
download folder of your choosing
--

be sure you
can find the downloaded installer file!). The download
process will vary depending on your web browser. The filename may also be slightly different if the
JDK or NetBeans has been updated.




Step 5: Run the Installer

Find the downloaded file on your computer and double
-
click it to start the installation. The
introductory screen should look like the ima
ge below. The installation can take several minutes. Click
Next to continue.





Step 6: Choose the

JDK Install Folder

We recommend installing the JDK to its default folder in your Program Files folder. Continue clicking
"Next" to go through the various dialogs.





Step 7: Choose the NetBeans Install Folder

Leave the NetBeans install folder at its default location in Program Files. The JDK folder indicated
should be the same as in Step 6. Click "Nex
t" as required to proceed with the installation and "Finish"
when the process has completed.




Y
our installation of the Java Development Kit is now complete. If the installer asks about anonymous
collection of usage data or registration, you may accept or decline (neither is required). Although
NetBeans is not specifically required for assignments in

this course, it is an IDE very similar to Visual
C++ and you may decide to familiarize yourself with it.


Please continue with the installation of the BlueJ IDE, which uses the JDK you just installed.



Installing the BlueJ IDE



Step 1: Download BlueJ

To
get the latest version of BlueJ, please visit this link:

http://www.bluej.org/download/download.html


As shown in the image below, you must have the Java JDK installed before using BlueJ. Click th
e
filename to begin the download. Save the installer file to your Desktop or another location where you
can find it. Note the filename may be different if BlueJ is updated (as of this writing, version 3.0.4 is
current).




Step 2: Run the Installer

Double
-
click the installer file (and allow it to run if prompted by Windows Vista or Windows 7). The
def
ault install location for BlueJ is your C:
\

drive. Click "Next" to continue.

Note: Advanced users may choose a subfolder if desired, but ensure the path name has no spaces or
punctuation characters.




Step 3: Allow File Association

You should allow the option to associate files ending in ".bluej" with the BlueJ IDE. The desktop icon is
optional. Clic
k Next to continue and wait for the installation to finish (should be quick for BlueJ!).





Step

4: Run BlueJ

Start BlueJ by double
-
clicking the desktop icon or by finding it in your Start menu. The interface
should look like the image below.

Note: If BlueJ detects more than one JDK version installed on your computer, it will ask you to choose
one. P
ick the most recent version you just installed. If BlueJ detects no JDK installed, please install the
JDK first. If you have done so and still receive an error message, consult your instructor.





Step 5: Check the JDK Path

Click the Help menu and click "About BlueJ". View the dialog and ensure the JDK path ("Java Home" in
the image below) matches th
e folder to which you installed the JDK. Click OK to close the dialog.




Step 6: Open an Example

Project

To ensure BlueJ is working with the JDK properly, we will open one of the example projects that is
packaged with the program. Click the "Project" menu in BlueJ and click "Open Project". Browse to the
BlueJ installation folder (default was C:
\
BlueJ
). Inside the BlueJ folder, there is a folder named
"examples" (see image). Select this folder.




Step 7: Open the "hello" Project

When browsing Windows folders with BlueJ, it automatically detects which folders contain BlueJ
projects. These folders are shown with a "blue bird" icon. Choose the "hello" project in the examples
folder and click "Open".






Step 8: Compile the Project

With the "hello" project open, you should now see a box (repres
enting a Java class) with "Hello"
displayed in BlueJ. Click the Tools menu and click Compile to compile the project.





Step 9: Execute the main Method

Right
-
click on the "Hello" class (the tinted rectangle) and click the main method as shown in the
image.




Step 10: Click "OK" on the Method Call

Click OK to call the main method with an empty argument list, as we are not passing any arguments
in this test.




Step 11: View the Output

You should see the BlueJ Terminal Window appear with the message "Hello, world". If you see this
message,
BlueJ is properly set up with the Java Development Kit!



If you have any trouble setting up t
he software for the CS4 course, please contact your instructor
right away.










Download the BlueJ version of GridWorld:


1.

Visit
http://www.bluej.org/help/ap.html

to download the “BlueJ version of
GridW
orld”

2.

Save and unzip it in the

C:
\
BlueJ folder.
This will create a folder named
“GridWorldCodeBlueJ.”

3.

Add gridworld.jar (located in the GridWorldCodeBlueJ folder) to the BlueJ libraries.

a.

Open the

BlueJ
program

b.

Go to

Tools/
Preferences/
Libraries

c.

Select

Add,

select

the

gridworld.jar
file in
C:
\
BlueJ
\
GridWorldCodeBlueJ
,
and click
O
k

d.

Restart
the
BlueJ
program

4.

Test by opening a project in

C:
\
BlueJ
\
GridWorldCodeBlueJ/projects

a.

Click
Project
,
Open Project

b.

select
firstProject

from the
C:
\
BlueJ
\
GridWorldCodeBlueJ/pr
ojects
folder
from the

Look in:

drop down menu


c.

Click
Open

d.

Select

BugRunner
and click
Compile


e.

Right click

BugRunner
and select
void main
, click

Ok


f.

If you see the following screen, you have success!




Download the TurtleGraphics packages for the TextB
ook:

1.

Go to:
http://faculty.cs.wwu.edu/martin//Software%20Packages/BreezyGUI/legal_stuff.ht
m

2.

Download
the TurtleGraphics files
http://faculty.cs.wwu.edu/martin//Software%20Packages/TurtleGraphics/TurtleGra
phics.zip

3.

Save and unzip it in the

C:
\
BlueJ folder.
This will create a folder named
“GridWorldCodeBlueJ.”

4.

Add
TurtleGraphics
.jar (located in the BlueJ folder) to the BlueJ libraries.

g.

Open the

BlueJ
program

h.

Go to

Tools/Preferences/Libraries

i.

Select

Add,
select

the

TurtleGraphics.jar
file in
C:
\
BlueJ
\
lib,
and click
Ok

j.

Restart
the
BlueJ
program

5.

Test by opening a

project in

GridWorldCodeBlueJ/projects



Add GridWorld/
AP library documentation to the
Help
M
enu:


1.

Open the
bluej.defs

from the

C:
\
BlueJ
\
lib

folder

using notepad

2.

Search in
bluej.defs

for
bluej.help.items


3.

Add the following

lines to the help items section
:



bluej.help.items=myCustomLib courseInfo

bluej.help.myCustomLib.label=AP Java Libraries

bluej.help.myCustomLib.url=http://www.cs.duke.edu/csed/ap/subset/doc/

bluej.help.courseInfo.label=GridWorld Documentation

bluej.help.courseInfo.url=
C:/BlueJ
/GridWorld
CodeBlueJ/javadoc/index.html




4.

Open
BlueJ
Program to check that the two help menu options were added to the list



5.

Test that each open correctly


Java Class Library:


GridWorld Documentation: