Setting up DrJava on your Platform

DrJava can be set up to handle files similarly to other applications on your platform. For example, Windows allows you to associate types of files with particular applications.

Associating Java files to DrJava, on Windows

To set up DrJava as your default editor for .java files in Windows, you will need a few pieces of information:

  1. The complete path to your Java executable, likely in C:\Program Files. We recommend using javaw.exe, since it launches programs without displaying a command prompt window.

  2. The complete path to your DrJava Jar file. To simplify upgrading, we recommend renaming the Jar file to drjava.jar each time you download it, and always keeping it in the same folder.

Using the above information, you can change the file associations for .java files:

  1. Find the Folder Settings dialog. Depending on your version of Windows, it might be in one of several locations:

    • The "Settings" group of the Start Menu

    • The "Tools" menu in Windows Explorer

    • An icon in the Control Panel

  2. Within the Folder Settings dialog, click on the File Types tab.

  3. Search the list of file types for the .java extension. If it is not already in the list:

    1. Click the "New" button to create a new file type.

    2. Type in "java" as the extension and click OK.

  4. Select the .java extension from the list and click on the "Advanced" button. The "Edit File Type" dialog will be displayed.

  5. If the File Type does not have a name in the top text field, type in "Java Source File".

  6. Click the "New" button next to the list of Actions to display the "New Action" dialog.

  7. Type "open" as the action.

  8. For the application to perform the action, type:

    "C:\PATH\javaw.exe" -jar "C:\PATH\drjava.jar" "%1"

    (Replace C:\PATH\javaw.exe with the full path to your Java executable, and C:\PATH\drjava.jar with the full path to your DrJava Jar file, as found in the first few steps.)

  9. Optionally select an icon for all .java files, then click OK.

  10. Click the "Close" button.

  11. All .java files should now be associated with DrJava, so double-clicking on one will open it in a new copy of DrJava.