This returns the version of Java, if any, you already have installed on your computer. If it returns 'java version 1.6.XXX,' this means that you already have Java 6 installed on your computer. Skip ahead to Step 2: Installing DrJava. If it returns 'java version 1.5.XXX' (or 1.4) this means that you have an older version of Java installed.
After upgrading to a newer version of Mac OS X (Yosemite 10.10 and El Capitan 10.11) or macOS (Sierra 10.12 and High Sierra 10.13), you may end up getting an annoying new pop-up message whenever you start your computer. It says, “To use the java command-line tool, you need to install a JDK.” It asks you to click “More Info” and visit the JDK (Java Developer Kit) download website.
The reason you’re receiving this message is due to the removal of Java support in newer versions of OS X for security reasons. Older software such as Adobe Photoshop and Illustrator requires legacy Java support. Without a compatible Java command-line tool for these software, you’ll get this pop-up every time you turn on your Mac computer.
When you visit the download website to update Java, you find that the issue isn’t resolved! You’re still getting the same pop-up. This isn’t a complicated issue to fix, but it is an indirect one. The problem is that you’re not being routed to the correct download website when you click “More Info.”
Apple could have remedied this issue by programming the “More Info” button to direct you to the right fix. Here are the steps you can take to finally rid yourself of this pop-up:
Fix Java Command-Line Tool Pop-Up on Mac OS X
- Download Java for OS X 2017-001 aka Apple’s version of Legacy Java Command-line tool.
- Mount the .dmg disk image file and install Java 6 runtime for OS X.
- Restart your Mac and enjoy the absence of this Java command-line tool error pop-up!
Downloading and setting up DrJava
DrJava is a free environment for writing and running Java programs. It is installed on CIT's computers throughout the campus and in the ACCEL lab.
Please note that there are two versions of Java. The older version, Java 1.4.2, and the newer version, Java 1.5. For most of the semester, it will not matter which version you are using. We will not make use of the new features in Java 1.5.
You need a Java virtual machine
You will need the Java software development kit (JDK) from the Sun website. THIS MAY ALREADY BE ON YOUR COMPUTER. Don't attempt to download and install it unless you know you don't have it. If you have a Macintosh running Mac OS X, you almost certainly have it. If you have a PC, this site can check whether you have it:
If you need the Java software development kit (JDK) get it from this website:
See the Popular Downloads link on the right side of that page. Choose J2SE 5.0. Also, choose the J2SE JDK or SDK (not just the JRE and not the 'bundles' that include other programming environments, such as netBeans). Warning: this is a big download!
Can't execute jar files
If you cannot double-click on a jar file to start it running, or if you cannot execute any of the commands java, javac, javadoc, or jar, you probably have not set your path correctly. We explain this for Windows 2000; older windows systems are similar.
Your system contains a variable that lists directories with executable files in them. Type 'path' in a command-line window. The line that is printed contains path names separated by semicolons. For example, one path name may be:
C:WINNTsystem32
There should be a path that looks like this: C:j2sdk1.4.1_02bin. This is a directory called bin inside the directory where you installed the sdk. It may be different on your computer. If such a path is not there, you have to add it. Bring up the help in your Windows system, open the index, and look for 'path'. There, you will find instructions on appending another directory to variable path. It may be something like this (but read the instructions):
path %path%;C:j2sdk1.4.1_02bin
Downloading DrJava
The easiest thing for you to do is to download this version of DrJava drjava-stable-20080106-0744. This version is supposed to work whether you have Java 1.4.2 or Java 1.5, and we advise using it.
If you want, open this web page (by clicking the link) in your browser and choose another version of DrJava to download. Get the latest version. Note that DrJava won't run unless you have a Java 2 v1.3 (or later) virtual machine already installed.
Warning: you may get a dialog saying something about a 'JAR archive security check'. If you do, just right-click on the DrJava download link and select 'Save Link As' (or the equivalent in your browser).
We know that all this setup can be annoying, but you have to do it only once!
A common DrJava problem: finding tools.jar
Question: I downloaded Sun's J2SE SDK and DrJava. When it came to actually running DrJava, the following window kept popping up even though somehow DrJava still managed to run without me finding the file --what should I do?:
Compiler not found. The file you chose did not appear to contain the compiler. Would you like to pick again? The compiler is generally located in 'tools.jar', in 'lib' subdirectory under your JDK installation director. (If you say 'No', DrJava will be unable to compile programs.)
Answer: First, make sure you installed the Java SDK, not the JRE. (See above.)
Next, file tool.jar comes with the JDK. The usual location is
C:Program FilesJavajdk1.5.0_02libtools.jar
Why Can't I Install Java
if you have followed the default options during the JDK download process. You can also use a desktop tool to search for this file on your computer. You simply need to set DrJava's Preferences to the correct path. To do so, follow these menu items: Edit - Preferences - Resource Locations - Tools.jar Location then type or browse to the correct location.
Running DrJava
There are several ways to run DrJava:
I Can't Download Dr Java On Mac Windows 10
- From the command line, you can type java -jar drjava-stable-20061025-1556.jar
- On many platforms, you can simply double-click the jar file to start DrJava.
- On OS X, you can download the drjava-stable-20061025-1556.jar-osx.tar.gz package. You can then run DrJava as a normal application.
Documentation --how to use DrJava
The demos given in class and in the demo sessions should help, if you take notes. However, here is documention on using DrJava (http://drjava.sourceforge.net/userdocs/) on the web.
Wrong-version error.
Do you get a message that looks like this?
Download Dr Java For Mac
Error: cannot access javax.swing.JFrame
bad class file: C:Program FilesJavajre1.5.0librt.jar(javax/swing/JFrame.class)
class file has wrong version 49.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
Download Dr Java Compiler
It may mean that your computer has two different systems on it and is an inconsistent state. If your computer has jre5.0, then it cannot use SDK 4.7. Uninstall SDK4.7 and download JDK 5.0 and use its tools.jar.