Results 1 to 20 of 29
- 07-08-2011, 10:20 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 8
- Rep Power
- 0
javac is not recognized as an internal or external command error
I installed jdk and wrote my first program on notepad. When I try to compile with command "javac *.java" it shows "javac is not recognized as an ..........."
Then after reading some threads, I changed the path in Environment Variables, now it shows
Javac : file not found : *.java
usage : javac <options> <source file>
use - help for a list of possible options.
So I don't know where I'm wrong now. Where should I save *.java file?
Thanks in advance
- 07-08-2011, 10:59 PM #2
The OS can not find the javac command. You need to add the path to the folder containing the javac.exe file to the PATH environment variable.
The PATH environment variable is set from the Settings | Control Panel | System panel.
Select the Advanced tab and
Click on the Environment variable's button.
At the bottom in System Variables, find the PATH entry and click the Edit button
Add the new path using ; to separate it
Its a stupid small text field so be careful.
- 07-09-2011, 11:06 AM #3
Member
- Join Date
- Feb 2011
- Posts
- 8
- Rep Power
- 0
Thanks. So after I set the variable can I save *.java file anywhere in my computer? Or it should be in some particular folders?
- 07-09-2011, 12:48 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,397
- Blog Entries
- 7
- Rep Power
- 17
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 07-09-2011, 01:12 PM #5
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
If you don't know how to navigate on command line, use cd to move to the right directory(where the file is located), and then try executing
Java Code:javac -cp . *.java
- 08-10-2011, 03:17 AM #6
Member
- Join Date
- Aug 2011
- Posts
- 1
- Rep Power
- 0
i am getting this error pls help
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\MAHE>javac
'javac' is not recognized as an internal or external command,
operable program or batch file.
- 08-10-2011, 03:29 AM #7
Did you miss this post in #2 ???
The OS can not find the javac command. You need to add the path to the folder containing the javac.exe file to the PATH environment variable.
The PATH environment variable is set from the Settings | Control Panel | System panel.
Select the Advanced tab and
Click on the Environment variable's button.
At the bottom in System Variables, find the PATH entry and click the Edit button
Add the new path using ; to separate it
Its a stupid small text field so be careful.
- 03-17-2012, 05:04 AM #8
Re: javac is not recognized as an internal or external command error
So I entered into the System Variables ;C:\Program Files\Java\jdk7.0_03\bin\javac
and it still gives me the same answer when I am trying to convert java into a class file
what have I done wrong?
- 03-17-2012, 06:55 AM #9
Re: javac is not recognized as an internal or external command error
Which system variable?
If you can't express yourself clearly and just post vague reports of your actions, it's not going to be possible for anyone here to help you.
Lesson: Common Problems (and Their Solutions) (The Java™ Tutorials > Getting Started)
dbLast edited by DarrylBurke; 03-17-2012 at 06:58 AM.
Why do they call it rush hour when nothing moves? - Robin Williams
- 03-17-2012, 01:05 PM #10
Re: javac is not recognized as an internal or external command error
Did you read this:
You need to add the path to the folder containing the javac.exe file to the PATH environment variable.
You said you added:
;C:\Program Files\Java\jdk7.0_03\bin\javac
Is javac the folder containing the javac.exe file?
- 04-25-2012, 03:10 AM #11
Member
- Join Date
- Apr 2012
- Posts
- 5
- Rep Power
- 0
Re: javac is not recognized as an internal or external command error
So I'm having the exact same problem and I've triple checked everything.
Java_Home: E:\Program Files\Java\jdk1.7.0_03\bin
Path: ;%Java_Home%;
Computer will not see javac unless I'm in it's folder but I can't run my project from there.
Also tried path: ;%Java_Home%\bin;
- 04-25-2012, 03:22 AM #12
Re: javac is not recognized as an internal or external command error
Open a command prompt window and enter: Path
copy the contents here
To copy the contents of the command prompt window:
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The selection will show
Click in upper left again
Select Edit and click 'Copy'
Paste here.If you don't understand my response, don't ignore it, ask a question.
- 04-25-2012, 03:23 AM #13
Member
- Join Date
- Apr 2012
- Posts
- 5
- Rep Power
- 0
Re: javac is not recognized as an internal or external command error
I reinstalled JDK and that fixed it. But now after I ran javac and the program it made a class and I run that and it doesn't return with passed arguments, I'm new to java, yet when I run it with Netbeans it works.
- 04-25-2012, 03:31 AM #14
Re: javac is not recognized as an internal or external command error
Post the console that shows the problem. Add comments to the post saying what the problem is.
If you don't understand my response, don't ignore it, ask a question.
- 04-25-2012, 03:34 AM #15
Member
- Join Date
- Apr 2012
- Posts
- 5
- Rep Power
- 0
Re: javac is not recognized as an internal or external command error
E:\Users\George\Documents\NetBeansProjects\DumpArg s\src\dumpargs>java DumpArgs
Exception in thread "main" java.lang.NoClassDefFoundError: DumpArgs (wrong name:
dumpargs/DumpArgs)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknow n Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unkno wn Source)
I type java DumpArgs and it gives me that ^
- 04-25-2012, 03:44 AM #16
Re: javac is not recognized as an internal or external command error
You have a package statement putting the class in a package: dumpargsDumpArgs (wrong name: dumpargs/DumpArgs)
Remove that or change how you use the java command to use the package name with class name.
java dumpargs.DumpArgs
from the folder that contains the dumpargs folderIf you don't understand my response, don't ignore it, ask a question.
- 04-25-2012, 03:54 AM #17
Member
- Join Date
- Apr 2012
- Posts
- 5
- Rep Power
- 0
Re: javac is not recognized as an internal or external command error
Netbeans automatically put it in a package, how do I stop it from doing that?
- 04-25-2012, 03:56 AM #18
Re: javac is not recognized as an internal or external command error
Sorry, I don't use your IDE.
If you don't understand my response, don't ignore it, ask a question.
- 04-25-2012, 04:04 AM #19
Member
- Join Date
- Apr 2012
- Posts
- 5
- Rep Power
- 0
Re: javac is not recognized as an internal or external command error
Ok well, thank you anyways, I'll figure something out now.
Ok so I just put in a text program and saved as .java since I'm learning Java at this point.Last edited by Arcanexanth; 04-25-2012 at 04:07 AM.
- 04-25-2012, 09:23 AM #20
Moderator
- Join Date
- Apr 2009
- Posts
- 10,449
- Rep Power
- 16
Re: javac is not recognized as an internal or external command error
That's the best way.
Or you could use Notepad++ (google for it) which is a text editor, but it does code highlighting for you making it slightly easier to see what you;re doing.
You still need the command line to compile.Please do not ask for code as refusal often offends.
Similar Threads
-
'javac' is not recognized as an internal or external command...HELP!
By taymilll in forum New To JavaReplies: 25Last Post: 06-23-2012, 11:30 AM -
'Javac' is not recognized as an internal or external command or batch file
By FinalFatexX in forum New To JavaReplies: 19Last Post: 11-27-2010, 12:31 AM -
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 as an internal or external command
By sam_1032002@btopenworld.c in forum New To JavaReplies: 3Last Post: 10-18-2008, 02:40 AM


2Likes
LinkBack URL
About LinkBacks


Bookmarks