• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Java Installation Problem  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! I just bought a Windows 10 laptop, and am trying to install Java 8.1 SE, followed by netbeans. I downloaded jdk-11.0.1_windows-x64_bin and executed it, and it seemed to complete OK. In fact, if I try to execute that installer again, it says: "This software  has already been installed on your computer...". But if I bring up a command window and type "java -version", it complains: " 'java' is not recognized as an internal or external command, operable program or batch file." And if I try to install netbeans by executing netbeans-8.2-javase-windows, it complains: "JDK 8 or newer is required for installing the NetBeans IDE...". In Windows Explorer, I see that the files are there in C:\Program Files\Java\jdk-11.0.1. I suppose this is a matter of setting environmental variables, but I could use some help understanding what to set to what. Could you either explain all that, or direct me to a good web site that will tell me? Thanks!
 
Master Rancher
Posts: 915
17
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you still have to set your systemvariables. Go to your systemproperties and click on Enviorement variables, check for the path or PATH variable and add ; followed by the path to your java bin folder to the end of it.
Then create a new variable called JAVA_HOME and do the same.
You can also first create the JAVA_HOME variable and add %JAVA_HOME% to your PATH variable
 
Marshal
Posts: 62231
193
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

You said you wanted to install Java8, but have installed Java11. Stay with 11. But you can't find the executable file from the command line without another stage: provide a PATH. The easiest way to do that is to set a system PATH. Look at our FAQ. Scroll about halfway down. As far as I know Windows10 uses the same procedure as Windows7.
You will want something like
JAVA_HOME="c:\Program Files\Java\jdk11.0.1"
PATH=%JAVA_HOME%\bin;%PATH%

You need quotes after JAVA_HOME because of the space in the middle.
Bookmark the Java™ Tutorials, and thenl find this section.
 
Campbell Ritchie
Marshal
Posts: 62231
193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the thumbsup; I presume that means you got Java® to work.
 
Campbell Ritchie
Marshal
Posts: 62231
193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, if yoiu follow the Java™ Tutorials link I gave you last night, does it tell you to add the new PATH element at thee end; that isn't actually correct. You are usually better off adding the new PATH to Java® to the beginning of the PATH.
 
Campbell Ritchie
Marshal
Posts: 62231
193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Last night, I used %PATH% as an abbreviation of the PATH as it stood before. I have just realised that might be confusing; you end up with a PATH starting JAVA_HOME... and then followed by all the other elements.
 
Michael Shulman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell, Ritchie, I feel like my head is going to explode! I know enough about this to know that the advice you gave me is correct, yet it isn't working right. I set the environmental variables, and indeed an "ECHO PATH" and an "ECHO JAVA_HOME" both showed me "C:\Program~1\Java\jdk-11.0.1". (PATH had more stuff, of course.) But "java -version" still claimed that "java" was unknown. So I changed the environmental variables, to end with "\bin", like this: "C:\Program~1\Java\jdk-11.0.1\bin". Then "java -version" works just fine, showing [java version "11.0.1" 2018-10-16 LTS]. But when I tried to run the netbeans installer, it gave me this popup: "Java SE Development Kit (JDK) was not found on this computer". Is that because of my final "\bin"? Am I stuck with either having netbeans, or command line java tools, but not both?
 
Campbell Ritchie
Marshal
Posts: 62231
193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The PATH entry used by the OS starts with the drive letter (on windows®), usually c, and ends with bin (on all OSs). You can therefore use JAVA_HOME with bin added in the PATH. NetBeans also requires a JAVA_HOME variable, starting with the drive letter and ending one place before bin.
 
Michael Shulman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that clears up one element of confusion on my part: I had thought that the Java clause of PATH was supposed to be identical to JAVA_HOME. Now I understand (from you) that the clause in PATH has the final \bin, while JAVA_HOME does not. Unfortunately, netbeans is still refusing to install, claiming that there is no JDK. In my desperation, I even moved \Java from Program Files to C: (that is, made it a top-level directory) and adjusted both PATH and JAVA_HOME accordingly. I also tried a command-line installation of netbeans-8.0.1-javase-windows.exe, using the -javahome switch. No good. It still said that there is no JDK. I will move this problem to a netbeans forum, but when (or if) I get it right at last, I'll come back here and report on the fix.
 
Campbell Ritchie
Marshal
Posts: 62231
193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Michael Shulman wrote:. . . . I will move this problem to a netbeans forum . . .

We have one of them, too, so I shall duplicate your discussion there; it will be hepful if you report the soluton as you said
 
Marshal
Posts: 5633
147
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the NetBeans folder is a folder called etc, and in that folder is a file called netbeans.conf, and in that text file is a section like this:
Note that if netbeans_jdkhome is commented out, the launcher decides where the JDK is.  Hopefully this helps.
 
Campbell Ritchie
Marshal
Posts: 62231
193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using the # character for commenting out? Does that work on Windows®?
 
Knute Snortum
Marshal
Posts: 5633
147
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not a batch file; it's a config file that gets read and interpreted by Netbeans.
 
Campbell Ritchie
Marshal
Posts: 62231
193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aaaaaaaaaaaaaaaaaaaaah! Thank you
 
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!