• Post Reply Bookmark Topic Watch Topic
  • New Topic

Installation Issues  RSS feed

 
David R James
Greenhorn
Posts: 10
1
Android Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am new here. I found out about this site through the Head First Java book. I am currently installing Java on to my machine in order to follow along with the book and learn Java but I am having some issues with installing. I am running Windows 10 and I am starting my command prompt and typing the command "% javac" but I am getting back '%' is not recognized as an internal or external command, operable program or batch file. I have installed the Java SDK and JRE in a Java folder on my D drive. I'm not to sure if I have done something wrong, I have been learning Android Studio and believe to have everything set up correctly because I have been able to compile in Android Studio with no issues. I also have my PATH environment variable set up and point to the SDK bin directory on my D drive within my Java folder.

Just looking for some help

Thanks,

Dave.
 
Rajith Pemabandu
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you tried in the cmd ? what is the out put you get. if the output  you get is correct with the version you have installed suppose you are good to go.
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have the book, but is there a reason you're typing the % character before the command? Does the book tell you to do that, or does it look like it's telling you that?
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And, welcome to the Ranch!
 
David R James
Greenhorn
Posts: 10
1
Android Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

Thanks very much for the quick replies!

@Rajith Pemabandu. When I type java -version in cmd it comes back with java -version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)".

That is the correct version I installed.

@Paul Clapham. In the book where there is a section called "Setting Up Java" and in there its telling me to type "% javac" in cmd so the terminal knows where to find the javac compiler.
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I asked because when you want to run the "java" command you type "java" followed by some parameters. This is true in all command-line shells that I know about. It's also the case that most command-line shells prompt you to start typing by displaying something at the beginning of the line where you're going to type. Some shells use "%" for this prompt. That's why I asked whether the book explicitly told you to type the % sign or whether it just had a picture from which you might infer that typing the % would be a good idea.
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Davey James wrote:. . . java -version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)".

That is the correct version I installed. . . .
Oh, is JDK8u131 available? I only have 8u121; I had better see about upgrading.
I am afraid I am a little suspicious of that output; when I try that I get
java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
Are you getting the last line about HotSpot? What happens when you try this instruction?
javac -version
That shou‍ld return a version number and little else. If you don't get the javac version number (which shou‍ld be the same as above, 1.8.0_131), please check whether you have installed a JRE instead of a JDK.

And welcome to the Ranch again.
 
David R James
Greenhorn
Posts: 10
1
Android Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Campbell Ritchie. When I run java -version I do get the HotSpot version at the end too, I didn't copy and paste properly in my last post lol.

I get a version when I use "javac -version" too (it's javac 1.8.0_102) so it looks like it's there but the "% javac" command still doesn't seem to work
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16059
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As already mentioned above, you are not supposed to type the "%" in front of the "javac" command.
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Davey James wrote:. . . I get a version when I use "javac -version" too (it's javac 1.8.0_102) . . .
There is something odd there. You have managed to set the PATH so your JDK is older than your JRE. Please show us your PATH:-
echo %PATH%
The folder with the 8u131 JDK installation in shou‍ld come at the beginning of the PATH, so you may need to edit your PATH. You will probably go a long time before you notice any problems, but that is the correct way to set a PATH. More information in our FAQ. What did you find out about your CLASSPATH? Remember not to write the prompt character before your instructions. In the case of %PATH% the percent signs are part of the argument to the instruction.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!