1 Replies - 7768 Views - Last Post: 06 April 2011 - 10:14 AM Rate Topic: -----

#1 Big3Mik  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 18-October 09

javac // javacc? Windows?

Posted 06 April 2011 - 06:24 AM

Hello gents, I have a question that I am hoping y'all can help me with. I am just re-learning Java (its been 4 years since I coded with it), and I have NetBeans as a compiler. Now my problem is actually with Windows 7 and the cmd. GUI and something called "javac" or "javacc". I wrote a small program with Notepad and I tried to use the DOS Cmd GUI to get it to work all I keep getting is "javac is not recognized as an internal or external command, operable program or batch file"....I tried "javacc" as well. I tried to set the path manually in the cmd.exe GUI:

set PATH=%PATH%;C\Program Files\Java\jre6\bin\javac NotepadProgram.java

and still I get the same error "javac is not recognized....." If anyone has an idea of what could possibly be wrong I would be greatfull for your input.

*Micheal W. Smith
*CMP 2564
*Java Programming
*Exercise 2

import java.util.Scanner;

public class NotepadProgram {

public static void main(String[] args) {

// TODO code application logic here

System.out.println("Hello out there.");

System.out.println("I will add two numbers for you");

System.out.println("Enter two whole numbers on a line:");

int n1, n2;

Scanner keyboard = new Scanner(System.in);

n1 = keyboard.nextInt();

n2 = keyboard.nextInt();

System.out.println("The sum of those two numbers is");

System.out.println(n1 + n2);


Is This A Good Question/Topic? 0
  • +

Replies To: javac // javacc? Windows?

#2 sakshamkum  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 19
  • View blog
  • Posts: 232
  • Joined: 09-June 09

Re: javac // javacc? Windows?

Posted 06 April 2011 - 10:14 AM

sometimes it happens that javac is not recognised.
I have tried something that works but you should keep trying to change the path and try.

what I had done was to save the ".java" file in the bin directory of the jdk//where the javac is
and it had worked but you may not try it as it restricts you to choose the location of your source code
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1