We have an FAQ which will probably help.
I also went to the you tube videos and did all their suggestions, and it did not help. I then tried to contact java/oracle by chat and email, but they have no response, and their websites do not mention this problem. I then contacted my computer company. The technicians suggested it was a microsoft windows7 software issue that was put into the windows7 operating system, and they will go into my computer's operating system and fix it, so that my computer will properly install java jdk. They said they are very familiar with it, and do it all the time for people, and I got 2 price quotes, $80 and $89. I then contacted Microsoft, asking them to fix it for free, and their technician said they would fix it for a price quote of over $100.
I then tried again, again using the info at CodeRanch, using the environmental variables info, with JAVA_HOME and Path, into system variables. But it still does not help. At this time, I don't know how to properly install the jdk myself, free of charge.
I request wise advice about what to do. Thanks for helping!
It sounds like you've installed the JDK correctly, but you expect to see some GUI program, which is not what the JDK is. There will be nothing visible in your Start menu after installing the JDK; that's normal.
Oracle's Hello World Tutorial shows you how to use the Java compiler from the Windows command line.
Did you carefully follow the installation instructions for JDK 7 - especially Updating the PATH variable? Note that you need to close and re-open the command prompt after modifying the PATH (forgetting this is a common mistake that first-time JDK users make).
When I try to do the HelloWorld, and type cd C:\java, I don't get the correct response.
What response DO you get? What response are you EXPECTING? I don't even know what you mean by "try to do the HelloWorld". Are you having problems writing the .java file? Saving it? Compiling it?
What I get is a message saying...
Paraphrasing a response doesn't help. Those error messages are VERY specific, and tell you exactly what the problem is. You don't go to a doctor and say "i'm sick". You say "I cut my finger off" or "I have a fever of 104F." What the doctor does is specific to the problem. Computer problems are even MORE so.
SOMETHING works...you just haven't tried it and/or don't know what that is.
So please...make it easy for us to help you. Tell us ALL the information, ALL the details, what you EXPECT to happen, and what really does happen.
when I type javac,
the response I get is
Javac is not recognized as an internal or external command, operable program, or batch file.
I have tried repeatedly to do and redo Path and JAVA_HOME in environmental variables, and I don't know what is wrong. I moved Path and JAVA_HOME to system variables, away from user variables, which was one of the online recommendations.
This is what both JAVA_HOME and Path are set at:
No matter what I try to do, the only response I get is
not recognized as an internal or external command, operable program, or batch file.
Tamar Osher wrote:
This is what both JAVA_HOME and Path are set at:
Your JAVA_HOME and PATH are two very different environmental variables. From what you've provided, your JAVA_HOME should be set to "C:\Program Files\Java\jdk1.7.0". Your JAVA_HOME should contain both the "bin" and "lib" folder needed to run & compile java programs. Your PATH needs to point to that "bin" folder where javac resides (which is what you have above).
If you still are getting the "javac is not recognized ..." message, try executing "echo %JAVA_HOME%" and "echo %PATH%" just to double-check it's actually pointing where you expect.
Do I have two different JAVA_HOME, one for \bin and the other for \lib?
When I point to "bin", do I have \bin?
Please help. THANKS!
To solve the problem "javac is not recognized as an internal or external command", you need to add the bin directory of the JDK to the PATH environment variable, as is explained in the JDK installation instructions.
How exactly to change the PATH variable permanently depends on the version of Windows that you're using (it's slightly different for XP, Vista and Windows 7). You can easily find on the web how to set environment variables for your specific version of Windows.
If, for example, you have installed the JDK in C:\Java\jdk1.7.0_02 then you need to add the directory C:\Java\jdk1.7.0_02\bin to the PATH.
1. Open a new cmd prompt (black box) window after setting the path variable.
2. Append the JDK bin path at the start of the path variable. E.g if your existing path is like -> %SystemRoot%\system32;... then add the jdk's path to the front like -> C:\Program Files\Java\jdk1.7\bin;%SystemRoot%\system32;...
Tamar Osher wrote:I have already done those things. The \bin is there. I have done is so many times, so many ways, with the \bin, environmental variables, user variables, system variables, Path and JAVA_HOME, trying out all kinds of possible solutions. What can I do? Please help.
If it still isn't working, then you must have done something wrong.
So let's do this with baby steps.
1. Open a command prompt window.
2. Type in this command: echo %PATH%
3. Copy the output and post it here.
4. Tell us in which directory you installed the JDK.
C:\WINDOWS\system 32;C:\WINDOWS;C:\Program Files\Java\jdk1.7.0\bin
JDK installed in directory:
Location: C:\Users\Tamar Internet\Java Folder
Thanks for helping. I look forward to hearing from you!
But you installed the JDK in: C:\Users\Tamar Internet\Java Folder\jdk-7-windows-x64
Is that correct? Or is C:\Users\Tamar Internet\Java Folder\jdk-7-windows-x64.exe just where you saved the installer?
Did you actually run the installer? Do you indeed have a directory named C:\Program Files\Java\jdk1.7.0\bin on your harddisk?
If you really installed the JDK in a directory named C:\Users\Tamar Internet\Java Folder\jdk-7-windows-x64, then what you need to add to the PATH is: C:\Users\Tamar Internet\Java Folder\jdk-7-windows-x64\bin
and not C:\Program Files\Java\jdk1.7.0\bin
Both JAVA_HOME and Path have this in them: C:\Users\Tamar Internet\Java Folder\jdk-7-windows-x64\bin
When I type javac, I get, not recognized as an external or internal command.
Just a moment ago, I finished chatting with a Java expert at LivePerson.com. He went inside my computer to search and fix, but he did not know what the problem was, and he said I needed to install the 32bit, saying the 64bit always has problems.
However, I previously installed the 32 bit, and I got the same results when typing javac, not recognized as an external or internal command. I have not yet installed the 32bit again, because I doubt that is my particular problem. What do you think?
Please advise. I am very eager to get it fixed.
cd \Users\Tamar Internet\Java Folder\jdk-7-windows-x64\bin
If you get "The system cannot find the path specified." then that is NOT where you have the JDK installed.
if that works, do this:
If you get something like
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
then we're getting close
your PATH variable basically holds a list of directories. When you type something on the command line, the OS uses that list to search for the program you are trying to run. If the program is not found in any of those directories, you get the "unrecognized command" error. So the problem is that the file "java.exe" is not actually in any of the directories listed in your PATH.
If all else fails, open a windows explorer window, and search for "java.exe". You may get several hits depending on what all has been installed on your PC, but if so, post what you find here.
Your last post gave me ideas that I had not thought of, and on the second try, it worked. What I was not previously doing, was deleting both JAVA_HOME and Path, when I uninstalled and deleted the jdk.
This last try, I recorded the exact place jdk wanted to be installed, and I then added \bin to the new JAVA_HOME and Path. Then, I typed in javac and it was working.
" 'javac' is not recognized as an internal or external command, operable program or batch file. "
yet when I type "java -version" I get the following....
java version "1.7.0_02"
Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot(TM) 64-Bit Server VM (build 22.0-b10, mixed mode)
So I assume my PATH and and JAVA_HOME values are correct.
I installed the 64bit JDK 7, and have yet to try the 32bit version so mabye that could be the problem. However I'm lost at this point.
As of right now I have JAVA_HOME in my user variables targeted to "C:\Program Files\Java\jdk1.7.0_02"
and Path in my system variables targeted to "C:\Program Files\Java\jdk1.7.0_02\bin;" in front of the default path as specified in the MooseGreetings tutorial here on coderanch.
Help would be much appreciated, I am new to programming in general, and am just trying to complete the MooseGreetings (Hello World) application.
No, you are mistaken there. If you had to navigate to the folder where you put the MooseGreetings.java file, you must have put the .java file in ProgramFiles, which is the wrong place to put it. I recommend you create a java folder or similar and put all your work in that. Also check your PATH very carefully. Details in our FAQ.
John Judeth wrote: . . . So I assume my PATH and and JAVA_HOME values are correct. . . . .
You might find the PATH problem has sorted itself spontaneously. That is because you have opened a new command prompt; the environment variables are not recognised until you open a new command line.
[Edit]The PATH you showed in your post looks correct at a one-second glance[/edit]
And yes I believe I had the environment variables correct the whole time, I just was not insightful enough to realize I had to navigate to the folder in which my java file was located, I had thought I could just open command prompt, and instantly type javac MooseGreetings.java so I was assuming something was wrong with my variables when I got the javac error.
I went ahead and made a java folder for my work as suggested!
Thanks for the feedback!
Your post was moved to a new topic.