Results 1 to 9 of 9
Thread: Javac not recognized
- 06-29-2010, 06:54 AM #1
Member
- Join Date
- Jun 2010
- Posts
- 3
- Rep Power
- 0
Javac not recognized
Hello everyone, I'm a newbie to Java;), just started a course last week and ya~ having a classical trouble trying to make javac run on my home machine.
so when I type "javac *.java" in the command prompt, I get " 'javac' is not recognized as an internal or external bla bla bla..." I have looked around for solutions and typed other pieces of command and here's the results:
C:\>java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HostSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
C:\>echo %path%
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32 \Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Java\jdk1.6.0_20\bin
so it looks like the path is correct (my java sdk is indeed in that directory, and there is a javac.exe in the bin folder). I don't know what else can be wrong... I actually installed java sdk twice: after doing it once and then javac doesnt work, I restarted... tested again... and then reinstalled it (without manually uninstalling because I didn't find an unstall.exe) (the install.exe did ask "are you reinstalling?" and I assume it takes care of deleting duplicated files and setting all variables correctly).
Please help!
Thanks
btw I'm using windows xpLast edited by OscarLiu; 06-29-2010 at 07:01 AM.
- 06-29-2010, 07:20 AM #2
Member
- Join Date
- Jun 2010
- Posts
- 3
- Rep Power
- 0
okay... I seem to have found where the problem is... but the way I tried to fix it doesn't work:
so when I type "echo %path%" what comes out is different, the java bin directory returned in the command prompt is "C:\Program Files\Java\jdk1.6.0_02\bin" which is something I copied from my course website ealier (and different from the real java version i have).
So when I try to change that from control panel -> systems -> advanced -> environmental variables -> path, my "echo %path%" command will always return the same list of directories I had, so it looks like editing the environmental variables from the control panel no longer works on my computer... ... Can someone tell me another way to set it? I think all I need to do is to change that 02 to a 20
- 06-29-2010, 07:28 AM #3
Member
- Join Date
- Jun 2010
- Posts
- 3
- Rep Power
- 0
phew.... okay guys... it seems like restarting the cmd window after changing the setting in the control panel will give the correct result and javac works now... that was a lot of me typing my own story here lol~
- 06-29-2010, 08:37 AM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
- 06-29-2010, 01:17 PM #5
The JDK install process copies java.exe to one of the Window's folders that is on the PATH.
So java.exe would work but javac.exe wouldn't be found until the user sets the PATH.
Do a Search for java.exe to see.
- 06-29-2010, 01:38 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
- 06-29-2010, 02:22 PM #7
Member
- Join Date
- Apr 2010
- Posts
- 9
- Rep Power
- 0
Follow these steps given below:
1.Keep your code (code.java) in the given path
C:\Programs files\Java\Jdk..\bin\code.java
2.Search cmd.exe
3.copy cmd.exe to the path
C:\Programs files\Java\Jdk..\bin\cmd.exe
4.Double click on cmd.exe
5.See that path is specified to the bin
6.write---javac code.java
7.PRESS ENTER
8.if there is no error write---
java code
9.Press ENTER
10.Now it will works...
- 06-29-2010, 03:00 PM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Copying code into the java bin directory?
Might I suggest to anyone thinking that that is a good idea not to actually do it.
You'll end up with a complete mess in there...never mind copying cmd.exe there as well.
- 06-29-2010, 03:10 PM #9
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
javac not recognized as an internal or external command
By kotoko in forum New To JavaReplies: 28Last Post: 10-26-2010, 04:39 AM -
javac is not recognized as an internal or external command... and vista
By tsaund in forum New To JavaReplies: 13Last Post: 09-17-2009, 07:56 AM -
Javac is not recognized?
By Java idiot in forum New To JavaReplies: 4Last Post: 08-03-2009, 06:54 PM -
javac command not recognized
By sunshine39 in forum New To JavaReplies: 7Last Post: 03-04-2009, 03:54 AM -
'javac' is not recognized as an internal or external command
By sam_1032002@btopenworld.c in forum New To JavaReplies: 3Last Post: 10-18-2008, 02:40 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks