Difference between revisions of "Installing JDK and DrJava"

From CompSciWiki
Jump to: navigation, search
Line 11: Line 11:
 
** Download and installation: http://java.sun.com/javase/downloads/index.jsp
 
** Download and installation: http://java.sun.com/javase/downloads/index.jsp
  
 
+
==Installing a development environment==
 
After installing JDK you are now ready to install a development environment. A development environment is where you do the actual writing and running of your programs.
 
After installing JDK you are now ready to install a development environment. A development environment is where you do the actual writing and running of your programs.
  
==For Windows users==
+
===For Windows users===
 
The development environment you need to install is the textpad development environment.  
 
The development environment you need to install is the textpad development environment.  
  
Line 25: Line 25:
 
** Installation: http://www.textpad.com/download/index.html#instructions
 
** Installation: http://www.textpad.com/download/index.html#instructions
  
==For Mac users==
+
===For Mac users===
 
The development environment you need to install is DrJava development environment.  
 
The development environment you need to install is DrJava development environment.  
  

Revision as of 02:10, 28 November 2007

COMP 1010 Home > Getting Started


Introduction

To start programming in Java, you will need to install the Java Development Kit (JDK) first.You will also need to install a development environment where you can write and run your java programs. The development environment you need to install depends on the operating system your computer runs on. This section is subdivided to guide you through installing the right softwares for your computer.

   

{{{Body}}}

Installing your softwares

Installing JDK

JDK is the first thing you need to install before creating and running Java programs on your home computer. The JDK is a free software that contains the minimal set of tools you need to develop Java programs, it allows your computer to create and run Java programs.

Below is the link to download JDK and installation instructions.

Installing a development environment

After installing JDK you are now ready to install a development environment. A development environment is where you do the actual writing and running of your programs.

For Windows users

The development environment you need to install is the textpad development environment.

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 the links to download textpad and installation instructions.

For Mac users

The development environment you need to install is DrJava development environment.

Below is the link to download JDK and installation instructions.

For a guide on using DrJava, simply click on the "Documentation" or "QuickStart Guide" link on the lefthand side pane on http://drjava.org/



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.