small medium large xlarge

Generic-user-small
20 May 2015, 23:33
Sabashtion Crowley (11 posts)

Im on page 18, just after you make the creeper test. It has you check for java and javac. Commands are, $ java -version and $ javac -version. My computer finds java no problem, but it wont find the javac. I keep getting this error: sh: javac: not found. I noticed it saved JDK in a different spot then JRE, so I moved it to the same place, also tried javac.exe in the command, still no luck. Any ideas?

Andy-talking_pragsmall
21 May 2015, 13:48
Andrew Hunt (226 posts)

Personally, I’d uninstall both and start over, and just install the JDK. I’ve seen Java get quite twisted in the shorts and confused otherwise. But ultimately javac.exe needs to be in your PATH.

/\ndy

Generic-user-small
21 May 2015, 21:12
Sabashtion Crowley (11 posts)

I think ive tried that, I deleted and reinstalled. Ill try it again with just the JDK and see if that helps

Generic-user-small
22 May 2015, 00:01
Sabashtion Crowley (11 posts)

Tried everything again, still no luck. The aforementioned commands are both giving me the error now. I can resolve the java error by reinstalling JRE, but my computer refuses to see JDK or javac. I tried javac.exe again, tried moving the files to desktop and all other things I could think of. I am stumped.

Andy-talking_pragsmall
22 May 2015, 00:31
Andrew Hunt (226 posts)

Don’t install the JRE, that screws things up. Uninstall completely and reboot, then make sure all the pieces are gone.

Then install the JDK per Oracles instructions.

If that still doesn’t work, check the troubleshooting on Oracles site.

Again, both java.exe and javac.exe must be installed (not moved) in a directory that is listed in your PATH variable.

That is actually all there is to it.

/\ndy

Generic-user-small
22 May 2015, 01:29
Sabashtion Crowley (11 posts)

Tried it, twice. I tried every thing I can think of, it will not see java or javac. It will only see java if I install JRE, it wont register java from the JDK download.

Im stuck.

Generic-user-small
26 May 2015, 16:37
Detlev Beutner (12 posts)

Hi Sabashtion,

We also had some issues with the path. I never had realized that Oracle has changed the way to include the Java binaries into the path in comparison how the standard approach was with SUN. Oracle creates a folder with symbolic links (something not very common in the windows world) and integrates this path (“C:\ProgramData\Oracle\Java\javapath”) into the “Path” variable. But it does this only for the JRE, not for the JDK (but at least also for the JRE that is coming with the JDK!).

So, one easy way out of this trouble is just to follow the old approach. Create one environment variable “Java” pointing to your JDK root directory (for example “C:\Java\jdk1.8.0”), and then add “;%Java%\bin” as one value to the “Path” env variable (the semicolon is just the separator of values).

Hope it helps

Detlev

Generic-user-small
27 May 2015, 23:16
Sabashtion Crowley (11 posts)

OK, I’m going to try to figure that out, but I’m not real familiar with what I’m doing here. That last line is confusing and I don’t understand it at all, the C: prompt is familiar from when I did DOS, but that’s about it.

Generic-user-small
03 Jun 2015, 22:42
Sabashtion Crowley (11 posts)

I’m still not having much luck. I’m going to reinstall the JDK, I’m looking at the ones on this page:

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Can you tell me which of these JDK’s you would recommend I download? Also, the book has me using the busybox shell, so I got the “$” prompt, will this make a difference? Do I need to be in regular CMD for those prompt’s you gave me to work?

Generic-user-small
08 Jun 2015, 12:54
Detlev Beutner (12 posts)

Hi Sebashtion,

Use JDK 8, the latest.

About setting environment variable, you can also check out https://java.com/en/download/help/path.xml

BusyBox and with that the Linux shell is used to simplify the setup, which works with this for all supported systems (Win, Linux, Apple). If you are used to work the the windows command shell, don’t be afraid - it’s just a bit different (and by the way you learn – just a little bit – using a linux shell).

Best regards

Detlev

Generic-user-small
14 Jun 2015, 23:26
D Visser (13 posts)

Hi, This is all new to me. I am having troubles too. Some of the stuff you suggested I do not quite understand but getting there. Here is where I am at….I go to Oracle and download the Windows x64 of jdk-8u45-windows-x64.exe . This all goes well. Then if I double click on the download Java 8 installs - I have uninstalled Java and just have JDK on my computer now. So I have located javac in C:\Program Files\Java\jdk1.8.0_45\bin . I have tried to follow the link above, but as I do not understand what I am doing I am reluctant to follow this through. Do I just go ahead and delete everything that is in the value part and type in what you suggested? I might need you to be more specific. Thanks

Generic-user-small
15 Jun 2015, 03:56
D Visser (13 posts)

Hi again, Okay, after much “research” I now understand the PATH stuff more, but still does not work. I located javac in the program files but couldn’t access it, nor could I access program files via the shell.bat (despite seeing it when I did ls). I put a copy of jdk on Desktop, did the cd command all the way to the bin file and found javac.exe. But it could still not find javac even when I did javac -version from there….hope this is helpful. Should I also have ordinary Java downloaded too?

Generic-user-small
15 Jun 2015, 04:44
D Visser (13 posts)

Sorted…..worked though it and just edited the PATH to exactly what the computer told me it was when I searched for javac…phew

Generic-user-small
10 Dec 2015, 00:26
Tom Jenkins (4 posts)

Hi, this is all new to us too. We’re stumped and we’re going to try what you did. It might work but things happen.

We are going to try again to set the Path variable. First we will pull JDK out of Program Files, or rather, uninstall and reinstall it, because it does not want to let us move things like that. We will put the JDK somewhere like the Desktop instead. Then, running a search for javac.exe maybe Windows will find it (right now Windows does not find it - where can it possibly be hidden?).

Copying the directory and file name exactly, plus some %% thingies and the magic word “bin” maybe it will all work.

Wish us luck!

Generic-user-small
17 Jan 2017, 19:44
Sophia Brabenec (2 posts)

My soultion with the same problem: https://www.java.com/en/download/help/path.xml

You must be logged in to comment