Logo of the Java RMI Plug-in for Eclipse

RMI Plug-in for Eclipse
version 2.0

Configuring the JDK in Eclipse

The RMI Plug-in for Eclipse relies on the JDK "rmic" command and its implementation to generate the stub files. If you don't have a JDK, or it is not configured properly in Eclipse, the RMI Plug-in won't be able to generate any stubs. Such situation is common on the Windows platform if you've downloaded the Eclipse ZIP file, extracted it into a new directory and ran it by double clicking on the Eclipse icon. In such case it is very likely that Eclipse will pick a wrong location for the default JRE. This is a known problem of Eclipse on Windows and it has been reported as bug 86710.

The best way to check your settings is to open a java.lang class, such as "java.lang.Integer" (using the Navigate->Open Type menu). If you see the source code of the "Integer" class, then your configuration is fine. If you see the "Source not found" editor then you have a misconfigured JDK. The RMI Plug-in for Eclipse will also detect this misconfiguration at runtime and will prompt you to resolve it.

The following section describes the steps for properly setting up the JDK on Windows (java version builds on this page may not represent the latest versions available).

Setting up the JDK

  1. Make sure you have downloaded the full Java SDK (JDK) from Sun's website. If you don't have the full JDK installed, go to the download page for JDK 1.5.0 (or JDK 1.4.2) and select the option titled "JDK 5.0 Update 9" (or "J2SE v1.4.2_12 SDK"). Do NOT select any option that has "Java Runtime Environment", "Netbeans" or "J2EE" in its title. Download the JDK and install it.
  2. The next instructions assume that you have installed JDK 5.0 in the default
    C:\Program Files\Java\jdk1.5.0_09 directory.

(1. click to go to Java website)
  1. Start Eclipse and open the Preferences page (Window -> Preferences ...)
  2. Go to the "Java->Installed JREs" preference page. You can get there quickly by typing "JRE" in the filter field (on the top of the page).

(4. click to enlarge)
  1. If you see that the default JRE was found somewhere in the "C:\Program Files\Java\jre1.5.0_09" or similar directory (the "jre" or "j2re" is the important part), then your JDK is not configured properly. If you see there your installation directory (e.g., C:\Program Files\Java\jdk1.5.0_09), then your Eclipse configuration is fine.

(6-bad. click to enlarge)

(6-good. click to enlarge)
  1. If you have to change the default JRE location, select the checked row (it will be probably the only row in the list), and press "Edit..."
  2. Type "jdk-1.5.0" in the JRE name field and "C:\Program Files\Java\jdk1.5.0_09" in the "JRE home directory" field. Press "OK" to complete.
  3. Alternatively, you can press the "Search" button to locate all installed JDKs. After the search has completed, check the row that contains "jdk1.5.0_09".
(8. click to enlarge)

Problems? Get more help on the forums.

© 2002-18 Genady Beryozkin, rmi-info@genady.net. Read our Privacy policy. Hosted on RimuHosting. Visit Javalobby.