Computer Hope

Microsoft => Microsoft Windows => Windows 8 => Topic started by: tkoch96 on January 15, 2014, 08:09:31 PM

Title: Help Please
Post by: tkoch96 on January 15, 2014, 08:09:31 PM
Hi, I have an HP envy m6 sleekbook with AMD A10-5745M APU with Radeon(tm) HD Graphics 2.10 GHz and am running on windows 8.1

I'm wondering why the command in cmd "javac" wont work, this is the message it displays: http://puu.sh/6mtGY.png

I've checked to make sure I have the JDK downloaded, proof here: http://puu.sh/6mvck.png

I've also set the paths in environment variables to the jdk's bin location, which is what every other website told me to do, but I still get the same old message in command prompt saying it isn't recognized.

Please help:)
Title: Re: Help Please
Post by: Squashman on January 16, 2014, 05:33:29 AM
open up a cmd prompt and echo the path variable.  Copy and paste the output to here.  You don't need to send a screen shot.  Just copy and paste the text from the cmd window.
Title: Re: Help Please
Post by: briandams on January 16, 2014, 05:36:24 AM
very easy, if you not sure whether you have javac, just do a
Code: [Select]
dir /S <your_supposed_java_installation_directory or your whole drive> | findstr "javac.exe"
to see if you have the javac program installed. If found, make you sure you put that into your PATH
Title: Re: Help Please
Post by: Allan on January 16, 2014, 05:54:59 AM
tkoch96 - in the future please use a subject that relates to your problem rather than some thing like "please help". Thank you.
Title: Re: Help Please
Post by: tkoch96 on January 17, 2014, 06:26:49 PM
I'm not sure what you want me to do when you say echo the path variable
Title: Re: Help Please
Post by: Squashman on January 18, 2014, 09:40:08 PM
I'm not sure what you want me to do when you say echo the path variable
Windows has all kinds of environmental variables that are set when the computer boots up.  You are familiar with the command prompt so I assumed you knew what these were.  To see what your PATH variable is set to from the cmd prompt type one of the following commands.
Code: [Select]
echo %path%
set path
Title: Re: Help Please
Post by: tkoch96 on January 19, 2014, 08:51:02 PM
okay here it is :

C:\Program Files\Java]jdk1.7.0_51
Title: Re: Help Please
Post by: Squashman on January 20, 2014, 09:45:18 AM
okay here it is :

C:\Program Files\Java]jdk1.7.0_51
If that is all that is in your path variable then you have some other serious issues. Can't say I have ever seen anyone use a right bracket for the folder installation path either.
Title: Re: Help Please
Post by: Squashman on January 20, 2014, 09:55:18 AM
Maybe you meant to do this.
http://docs.oracle.com/javase/7/docs/webnotes/install/windows/jdk-installation-windows.html#path
Title: Re: Help Please
Post by: tkoch96 on January 20, 2014, 10:12:08 AM
Sorry that bracket is supposed to be a "\", just a typo on my part

I've already done everything in that link but "javac" is still not recognized as a command
Title: Re: Help Please
Post by: BC_Programmer on January 20, 2014, 10:28:11 AM
Quote
C:\Program Files\Java\jdk1.7.0_51
it should be C:\Program Files\Java\jdk1.7.0_51\bin as described in the document Squashman linked.
You want the path to point to the location of the executables you want to run. Not the directory containing the bin folder itself.
Title: Re: Help Please
Post by: Squashman on January 20, 2014, 11:34:29 AM
Sorry that bracket is supposed to be a "\", just a typo on my part

I've already done everything in that link but "javac" is still not recognized as a command
How could it possibly be a typo.  If you just copy and paste the output from the cmd prompt there would be no issue at all. As BC_Programmer has stated, the link I provided shows you the correct path you need to use and you aren't using it.
Title: Re: Help Please
Post by: Geek-9pm on January 20, 2014, 12:46:43 PM
Just for reference. The javac the OP refers to is a compiler from Oracle.
http://en.wikipedia.org/wiki/Javac
Quote
javac (pronounced "java-see", or often "javack") is the primary Java compiler, included in the Java Development Kit (JDK) from Oracle Corporation
Title: Re: Help Please
Post by: tkoch96 on January 20, 2014, 03:34:50 PM
I didn't copy and paste, I just typed it

here is what my computer is showing me, I thought I did everything in that link

http://puu.sh/6sbPs.png
Title: Re: Help Please
Post by: Salmon Trout on January 20, 2014, 03:48:37 PM
The Windows %path% environment variable should by default consist of this:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem

If all that has been nuked by a Java install (this is known to happen sometimes, by the way) you have problems, as has been noted. Typically, this is caused by an installer over-writing the path variable when it should be appending to it. I believe this can happen with systems where the previous path string was over a certain number of characters (some installers barf at 512, others at 2048)
Title: Re: Help Please
Post by: Salmon Trout on January 20, 2014, 03:49:01 PM
I didn't copy and paste, I just typed it

Why?
Title: Re: Help Please
Post by: BC_Programmer on January 20, 2014, 03:49:48 PM
javac is not a folder.

The Windows %path% environment variable should by default consist of this:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem

If all that has been nuked by a Java install (this is known to happen sometimes, by the way) you have problems, as has been noted. Typically, this is caused by an installer over-writing the path variable when it should be appending to it. I believe this can happen with systems where the previous path string was over a certain number of characters (some installers barf at 512, others at 2048)

I'd be more inclined to think they nuked it themselves by editing the path.
Title: Re: Help Please
Post by: Squashman on January 20, 2014, 03:57:57 PM
javac is not a folder.

I'd be more inclined to think they nuked it themselves by editing the path.
I agree on both comments.
Title: Re: Help Please
Post by: tkoch96 on January 20, 2014, 05:22:58 PM
By default it did consist of that, but I changed it to what it currently is because that is what websites told me I needed to do in order to make the command "javac" work
Title: Re: Help Please
Post by: Squashman on January 20, 2014, 05:49:24 PM
By default it did consist of that, but I changed it to what it currently is because that is what websites told me I needed to do in order to make the command "javac" work
I do not know what website you were following but I posted the link to the official documentation and it says ADD to the path, not replace. Nor does it tell you to add JAVAC to the path. The path ends at the BIN folder.
Title: Re: Help Please
Post by: tkoch96 on January 20, 2014, 07:17:27 PM
okay so what should i do? how do i get my default path back?
Title: Re: Help Please
Post by: BC_Programmer on January 20, 2014, 07:52:21 PM
okay so what should i do? how do i get my default path back?

Whatever you had before, you destroyed when you deleted it. You can set it to what Salmon Trout provides, which is the default, and then add the path to the java bin folder.
Title: Re: Help Please
Post by: tkoch96 on January 21, 2014, 06:15:33 PM
Thank you everyone, I figured it out