Installing JDK and DrJava

From CompSciWiki
Revision as of 18:12, 21 March 2007 by Ummisura (Talk | contribs)

Jump to: navigation, search

COMP 1010 Home > User-Defined_Methods


Introduction

To start programming in Java, you will need to install the Java Development Kit (JDK) and Textpad. This section describes how to do this, and gives a brief overview of the Textpad development environment.

   

{{{Body}}}

How to Install

To create and run Java programs on your home computer, you will need to download the Java Development Kit (JDK) and Textpad. JDK allows your computer to create and run Java programs, and Textpad is used for writing and running your programs.

IMPORTANT: Install the JDK first! If you install it after you have already installed Textpad, you will need to manually set up Textpad to compile and run Java programs.

Below are links with the downloads and installation instructions.

Helpful Textpad Options

Introduction

Textpad is a very basic text editor for Windows. It is much like Notepad but with a few more bells and whistles.

Main Environment

Menu Bar

The menu bar is located at the top of the window. It contains the following menu items: File, Edit, Search, View, Tools, Macros, Configure, Window and Help. To see a description of each menu item, move your mouse over the item name and look at the bottom-left of the Textpad window for a description. Try fiddling around with them and get a good understanding of what they all do.

Toolbar

The toolbar is located directly under the menu bar and contains buttons for commonly used tools. To customize which buttons appear:

  1. Right click on the tool bar
  2. Select Customize
  3. Click on the "Commands" tab
  4. Select the category desired
  5. Click and drag the icon to the desired location on the toolbar

Document Chooser

The document chooser displays all of the files that are currently open. To change which file you are looking at in the editing area simply click on the file's name. To close a file, right click on the file name and select "Close document(s)".

Clip Library

The clip library (located under the document chooser) is used as an easy way to insert strings of text into the document. Simply double click on the string of text desired and it will be inserted wherever the text cursor is located. To change the current clip library that is being displayed, pick the one you want from the dropdown menu which is located at the top of the clip library window. You can download and add more clip library at: http://www.textpad.com/add-ons/cliplibs.html

Editing Area

The editing area is where all the text is entered. To view line numbers, click on the "View" menu item and select "Line numbers".

Additional Helpful tips

Changing the Font for Java Documents

  1. Select the menu-item "Configure, and then select "Preferences".
  2. Click on the plus sign (+) beside "Document Classes".
  3. Click on the plus sign (+) beside "Java".

Now you can change how Textpad displays files that end with .java

Handy Keyboard Shortcuts

Textpad has many helpful keyboard shortcuts. Here is a brief list of the most helpful commands:

Ctrl+M
Find the matching {} or ().
F5
Search
Ctrl+F2
Set/delete a bookmark on the current line (makes it easier to find later).
F2
Go to next bookmark.
Ctrl+1
Compile Java program.
Ctrl+2
Run Java Program (You must compile before running).

Where to Find More Keyboard Shortcuts

  1. Select Help Topics from the Help menu.
  2. Click on the plus sign (+) that appears beside Referencing Information
  3. Select "The Keyboard"

This will list all of the keyboard shortcuts.

Common Problems

Textpad Does Not Have the Options to Compile and Run

First, make sure that you have installed the JDK. Then uninstall Textpad, and install it again. To uninstall Textpad:

  1. Click on the Start button at the bottom left corner of the screen.
  2. Click Control Panel
  3. Double click on Add or Remove Programs
  4. Scroll down the list until you find Textpad
  5. Click on the Change/Remove button
  6. Follow the prompts to uninstall Textpad

I Get A Popup When I Try To Save

If you get a popup that asks if you would like to register or continue evaluation, simply click on "Continue Evaluation". The trial period of Textpad will never run out.

Sample Code Does Not Compile

If your instructor has given you a code example which does not compile on your machine, you may have a different version of the JDK than they do. Please contact your instructor for instructions on getting the code to compile.