MTNLegit
MTNLegit

Reputation: 29

How to fix the compiler error in this program?

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?

Upvotes: 2

Views: 27264

Answers (2)

ViKtOR
ViKtOR

Reputation: 61

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

Upvotes: 0

Grant
Grant

Reputation: 51

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.

Upvotes: 5

Related Questions