2

So i'm a student in high school new to the Java language and i'm using this program called jgrasp, which we use to program java. I just got the program for home to try to finish off a lab I was working on and when I compile, this shows up:

 ----jGRASP exec: javac -g EqualToThree.java

 ----jGRASP wedge2 error: command "javac" not found.
 ----   This command must be in the current working directory or
 ----   on the current system PATH or jGRASP PATH to use this function.
 ----   System + jGRASP PATH is "C:\Program       Files\Java;C:\WINDOWS\system32;C:\WINDOWS\system32\wbem;C:\Program Files\QuickTime\QTSystem;C:\Documents and Settings\Andrew\My Documents\Downloads;C:\WINDOWS\system32;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTime\QTSystem\".

 ----   Use   Settings > PATH/CLASSPATH > Workspace   (PATHS tab)
 ----   to add directories to the jGRASP PATH.

 ----jGRASP: operation complete.

I just recently upgraded my java to the latest version, and I honestly have no idea how to fix this. I did go to the class path, and selected the selected files it wants, but still no luck. Any idea?

MTNLegit
  • 29
  • 1
  • 1
  • 4
  • 1
    Did you actually install the JDK? – Ben Feb 11 '14 at 23:14
  • 4
    That's not a compiler error, it's a saying it can't even find the compiler. Make sure you installed the JDK (the compiler) and not just the JRE (the runtime), and that it's in `Program Files\Java`, not `Program Files (x86)\Java`. Even better, if you can, use a real IDE like Eclipse or NetBeans, which will handle most of this for you. – chrylis -cautiouslyoptimistic- Feb 11 '14 at 23:15
  • I did actually, forgot to mention that. Still pops up though. – MTNLegit Feb 11 '14 at 23:15
  • 1
    @Ben is right. "javac" not found probably means you have no JDK. The JDK (required to compile Java) is separate from the JRE (required to run Java). Here's a link: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html – aebabis Feb 11 '14 at 23:16
  • Ohh okay, so once I download this, is that it? Or do I still have to locate the file in jgrasp or just open it separately? – MTNLegit Feb 11 '14 at 23:17
  • 2
    @JonathonReinhart Path is posted in the question, and jGRASP is apparently running on a JVM in `C:\Program Files\Java`. – chrylis -cautiouslyoptimistic- Feb 11 '14 at 23:22

2 Answers2

4

I had a similar problem, I do not know if it is specific to windows 7 or what.

I had installed several copies of the JDK thinking that would automatically fix it. It did not. Jgrasp somehow had multiple paths to the Java Compiler (javac), and the first one it went to was the JRE.

I solved it this way:

  1. I went to SETTINGS/ PATH/CLASSPATH / PATH(tab) / PATH(tab)
  2. click New
  3. (in a seperate windows explorer window I verified the correct path to the JDK) and added C:\Program Files\Java\jdk1.8.0_11\bin
  4. click Apply
  5. click Ok

That fixed it, and made the bad frustration go away.

msrd0
  • 7,816
  • 9
  • 47
  • 82
Grant
  • 41
  • 1
  • 2
0

I'm with the same problem and then found the jGRASP install documentation. It suggest the following:

Go to the Settings > CLASS/CLASSPATH > Workspace Select the CLASSPATH tab, if is not already selected, then click 'New' In the dialog, click the Browse button for 'PATH or JAR file' and navigate to the JAR file or the folder containing the target Java package root, and click the Choose button.

I found all that in the documentation: https://www.jgrasp.org/tutorials187/01_Installing.pdf

ViKtOR
  • 41
  • 1
  • 3