Results 1 to 16 of 16
Thread: 'Javac' Not Recognized Error
- 04-30-2012, 04:50 AM #1
Member
- Join Date
- Apr 2012
- Posts
- 88
- Rep Power
- 0
'Javac' Not Recognized Error
I am attempting to write my 1st Java program, but when I try to run my program, I get this error
'javac' is not recognized as an internal or external command operable program or batch file
What am I doing wrong here? It's probably very simple, but I'm new and don't know :)
-
Re: 'Javac' Not Recognized Error
Change your system's path to include the directory that holds your javac.exe program.
- 04-30-2012, 04:59 AM #3
Member
- Join Date
- Apr 2012
- Posts
- 88
- Rep Power
- 0
Re: 'Javac' Not Recognized Error
How do I do that?
If it helps, this is what I downloaded:
http://www.oracle.com/technetwork/ja...s-1591156.htmlLast edited by Rahim2312; 04-30-2012 at 05:03 AM.
- 04-30-2012, 07:16 AM #4
Re: 'Javac' Not Recognized Error
You downloaded an HTML file?
dbIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
- 04-30-2012, 07:16 AM #5
Re: 'Javac' Not Recognized Error
If you're forever cleaning cobwebs, it's time to get rid of the spiders.
- 04-30-2012, 03:30 PM #6
Member
- Join Date
- Apr 2012
- Posts
- 88
- Rep Power
- 0
- 04-30-2012, 03:37 PM #7
Senior Member
- Join Date
- Aug 2011
- Posts
- 116
- Rep Power
- 0
Re: 'Javac' Not Recognized Error
How do I set or change the PATH system variable?
That should help you
- 04-30-2012, 04:32 PM #8
Member
- Join Date
- Apr 2012
- Posts
- 88
- Rep Power
- 0
Re: 'Javac' Not Recognized Error
If I SET the path location before I try to execute my java file it works, but when I tried to actually change the path following these instructions:
To set the PATH variable permanently, add the full path of the jdk1.7.0\bin directory to the PATH variable. Typically, this full path looks something like C:\Program Files\Java\jdk1.7.0\bin. Set the PATH variable as follows on Microsoft Windows:
Click Start, then Control Panel, then System.
Click Advanced, then Environment Variables.
Add the location of the bin folder of the JDK installation for the PATH variable in System Variables. The following is a typical value for the PATH variable:
C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.7.0\bin
It gave me the same error about javac not being recognized etc etc.
- 04-30-2012, 04:36 PM #9
Re: 'Javac' Not Recognized Error
Look in Windows Explorer and get the actual path to the bin folder. If you downloaded the SDK recently, it won't be 1.7.0
dbIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
- 04-30-2012, 04:37 PM #10
Member
- Join Date
- Apr 2012
- Posts
- 88
- Rep Power
- 0
Re: 'Javac' Not Recognized Error
This is the location of my javac file
C:\Program Files\Java\jdk1.7.0_04\bin
- 04-30-2012, 04:41 PM #11
Senior Member
- Join Date
- Aug 2011
- Posts
- 116
- Rep Power
- 0
Re: 'Javac' Not Recognized Error
in command prompt type this
set path=C:\Program Files\Java\jdk\bin
obviously the file path will completely depend on where your file is stored, above is just an example.
- 04-30-2012, 04:43 PM #12
Member
- Join Date
- Apr 2012
- Posts
- 88
- Rep Power
- 0
Re: 'Javac' Not Recognized Error
My javac file is in the above path...the .java file I am trying to run is in a different path. Would it be easier if I just moved my .java file to C:\Program Files\Java\jdk1.7.0_04\bi
- 04-30-2012, 04:50 PM #13
- 04-30-2012, 04:52 PM #14
Member
- Join Date
- Apr 2012
- Posts
- 88
- Rep Power
- 0
Re: 'Javac' Not Recognized Error
Whew, glad I asked before I tried it!
My PATH variable from the Control Panel is:
C:\Program Files\Java\jdk1.7.0_04\bin
EDIT ---
Missed the 1st part of my path variable
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\Sy stem32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShel l\v1.0\; C:\Program Files\Java\jdk1.7.0_04\binLast edited by Rahim2312; 04-30-2012 at 05:04 PM. Reason: Missed the 1st half
- 04-30-2012, 07:18 PM #15
Re: 'Javac' Not Recognized Error
Do you have a space before C:\Program Files\Java\jdk1.7.0_04\bin? You shouldn't.
dbIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
- 04-30-2012, 09:27 PM #16
Member
- Join Date
- Apr 2012
- Posts
- 88
- Rep Power
- 0
Similar Threads
-
javac is not recognized as an internal or external command error
By learning_grjava in forum Other IDEsReplies: 28Last Post: 06-10-2012, 04:48 AM -
'javac' is not recognized
By adm in forum New To JavaReplies: 2Last Post: 01-31-2012, 10:24 AM -
Javac not recognized
By OscarLiu in forum New To JavaReplies: 8Last Post: 06-29-2010, 04:10 PM -
Javac is not recognized?
By Java idiot in forum New To JavaReplies: 4Last Post: 08-03-2009, 07:54 PM -
javac command not recognized
By sunshine39 in forum New To JavaReplies: 7Last Post: 03-04-2009, 04:54 AM
Bookmarks