V22.0002.001 Software download and Instructions
- Using and Installing software used in class
Instructions for installing the Java and the IDE (in this class, we will be using JCreator for Windows and NetBeans - BlueJ Edition for MAC :)
Instructions for Window users ONLY:
Step 1: Install the Java Development Kit (JDK) from Sun:
- Windows users will need to install JDK first (the Java Development Kit from Sun). JDK is available from Sun at:
- Go to : JDK 6 update 7 and click the DOWNLOAD button.
- On the same page under Select Platform for you download drag down until Windows is selected. Click the square at the middle of the page to agree to the licensing agreement. Then hit Continue.
- On the next page, double click the link ""jdk-6u7-windows-i586-p.exe" the Windows Off-line Installation. A dialog box will open with Save it to Disk clicked. Click OK. The system will automatically choose a directory for you for the download, or you may choose your own.
- After some time the download is complete. Then after closing all applications, go to the jdk directory or the one the program setup for you, and click the jdk-1_6_7-win icon. Click the Wizard button at the upper right of the Winzip window. This will automatically unzip the jdk bundle.
- Follow the wizard instructions, clicking next and yes when appropriate; also choose the desired directory and hit save. Finally click finish.
Step 2: Install one of the following IDE: JCreator :
- Download JCreator: Install v3.50 under "JCreator Classics". This is the version found in the ITS labs at this time.
- Click here for JCreator instructions.
Instructions for Mac Users ONLY:
On Mac OS X systems, Java (JDK) is already available so you do not need to install it.
- Install NetBeans - BlueJ Edition:
- Click here to donwload NetBeans - BlueJ Edition
- Then select and click "NetBeansBlueJ-5.0Beta-060510-macosx.tar.gz" to Download for the MAC OS .
Click here for further information on this IDE and others.
Instructions for using the IDE: Netbeans - BlueJ edition
Getting Started: writing and running programs:
For a new project (and getting started):
- FILE / NEW PROJECT / BlueJ / Empty BlueJ Project / Enter a project name & file location / FINISH
Then to start programming:
- FILE / NEW FILE / JAVA CLASSES / EMPTY JAVA FILE / NEXT / Enter a file name at the top of the screen; leave "Package" blank / FINISH.
- Now you can start typing your code or copy and paste from a model that we have done in class.
Adding line numbers to your screen:
- use F9 to compile the current file on Windows (on the Mac use the menu: BUILD / COMPILE FILE)
- use Shift + F6 to execute the current file (both Windows and Mac)
- Note: In Windows ... you can use the "BlueJ View" under Projects to right-click on your file and select "Compile" or "Run".
- Click on the line number of the first line in main (after the opening brace) to set a breakpoint; this should color the line in a dark pink.
- use Run / Run Other / Debug <filename> or CTRL + shift + F5 to start a debugging session in your file
- use F8 to step through your program, line by line within main. To step through additional methods, use F7.
Note: It is cumbersome to try to debug through a JOptionPane statement; it is easier to comment out the JOptionPane statement and follow it with an initialization, such
/* String sentence=JOptionPane.showInputDialog(null, "Type in a sentence",
"Input Sentence Window", JOptionPane.QUESTION_MESSAGE); */
String sentence = "The caT is AsleEp." ;
- Use Run / Finish Debugger Session to end
- Click on the line number of your breakpoint line to remove the breakpoint
- Use Window / Debugger Window to seleect the Watch window
- Right-click on the PC with your cursor in the Watch window or use CTRL+Shift+F7 to add variables to the Watch Window
- If you can't step through a program: Try assigning literals to your variables and comment out the JOptionPane dialogue boxes for data entry when you wish to step through a program; this will simplify the process. When your program works to your satisfaction, you can remove the comments and query the user for the input values.
- If you run out of memory, it could be that there are too many processes running simultaneously. This can happen if you run a program and it crashes but the process has not been terminated or if you omit the line System.exit(0) .... save your work, exit, and re-start.
- Use the menus rather than shortcuts (for example, use BUILD / COMPILE FILE rather than "F9"
- Be sure to create a new folder on your system to hold your programs rather than trying to use the default folder. (NetBeans uses a hidden folder for the default directory location.) Use FILE / MOUNT FILESYSTEM to be able to use that folder for your programs.
- Try CTRL-C and CTRL-V to copy and paste ... rather than using the command key.
- Use F7 and F8 to step through programs just as you would on the PC.
- In order to add variables to a watch window, use CTRL+click to obtain the menu.