Troubleshooting

The jGRASP wedge2 error: command "javac" not found PATH Error

I've found that there is sometimes a weird problem with jGRASP that it doesn't install properly on some 64-bit machines. Sometimes people are finding that when they try to compile a program, they get an error message similar to this:

----jGRASP wedge2 error: command "javac" not found.
---- This command must be in the current working directory
---- or on the current PATH to use this function.
---- PATH is
---- "C:\videos;C:\Windows\system32;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;
      C:\hp\bin\Python;C:\Program
---- Files (x86)\UWICK\SSH Tectia\SSH Tectia AUX;C:\Program Files
---- (x86)\UWICK\SSH Tectia\SSH Tectia AUX/Support binaries;C:\Program Files
---- (x86)\UWICK\SSH Tectia\SSH Tectia Broker;C:\Program Files
---- (x86)\UWICK\SSH Tectia\SSH Tectia Client".
----
---- Make sure you have the full JDK (J2SE SDK or other), not just the JRE,
---- installed.
---- The J2SE SDK is available from java.sun.com.
----jGRASP: operation complete.

Here's what you might do to fix this:

  1. Double check the folder name where the JDK is stored. You can do this by opening up Computer, then opening C:\, then opening Program Files, and then opening Java. Look for a folder with "jdk" in its name. On my Windows 7 computer, the folder is called "jdk1.8.0"
  2. Click Start and choose Control Panel
  3. Type environment variable into the search box in the upper right-hand corner

    (Note: You could have also accessed this by clicking through the Control Panel: Start > Control Panel >
    Security and System > System > Advanced System Settings > Advanced tab > Environment Variables)

  4. Click on Edit the System environment variables
  5. In the System Properties popup window, you should be in Advanced (if not, select the Advanced tab)
  6. Click on the Environment Variables... button

    System Properties - Advanced

  7. Now you should see a screen that is divided into two parts. On top are the User variables. Down below are the System variables. Under the top "User variables" section, click on the "New" button to add a new user variable.

    User variables

  8. This will bring up a New User Variable dialog box with two things to fill in.

    You should type something like this:

    Variable name: path
    Variable value: %path%;c:\program files\java\jdk1.8.0\bin

    Notice that the variable value section includes the directory name "jdk1.8.0". If you found that the JDK is stored on a different directory when you checked, then use that directory name instead of this one. Everything else should appear exactly as it is listed above with no spaces (except between "program files").

    Variable path

What we are doing in setting up this environment variable is telling the system to look into the "bin" folder (short for "binary") of the JDK installation when it looks for programs like "javac", which is the Java compiler.

Once this change is made, you should completely exit and restart jGRASP and it should work.

jGRASP Path Setting

If you are still having problems, you can also try going into jGrasp and manually pointing it to the path there.

In jGrasp, select Settings from the menubar, and then jGrasp startup settings.

jGrasp Path

Instead of [Default], click the Browse button and then select:
Oracle JDK 1.8.0 (C:\Program Files\Java\jdk1.8.0\bin\java.exe, then OK.

jGrasp Default
Change Default
jGRASP Java 8

This may give you a warning about Java 8 being untested with jGRASP in your Windows 7 system, but you can ignore this. It works fine with jGrasp (they just haven't updated the warning message yet). Make sure and select the option to never show the warning message again, or you may get it every time you start jGRASP (and that would be a bummer!)

Other Things to Try

If you've tried all of the above and you are still having issues, other possibilities are that the initial JDK installation was not complete, or there was an installation hiccup, or the registry is mucked up (happens every so often). If any ofg these are the case, you may need to try reinstalling the Java SE Development Kit 8 again and then jGrasp again. A real pain in the posterior, I know, but occassionally these things happen. Welcome to the wonderful world of programming!

If you have any other problems with jGRASP, please see me in class or email me with a description of what you are seeing.

Good luck! Hope this helps!

Craig