• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

Version error OpenJDK 15.0.1 on Windows 10

Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Edit: I found the issue - another path in the PATH variable: C:\ProgramData\Oracle\Java\javapath. When I moved it to the bottom of the list, then ran java -version, I got the version I installed, 15.0.1.

I've had various versions of java on my machine over the years.

Today I downloaded OpenJDK version 15.0.1 and extracted to C:\
I set HOME_JAVA to C:\jdk-15.0.1
I added the following to the PATH variable: %JAVA_HOME%\bin

When I ran java -version from the command prompt, the version shown was 13.0.1.
I checked the PATH variable, and C:\Program Files\Java\jdk-13.0.1\bin was above %JAVA_HOME%\bin, so I moved the 13.0.1 path to the bottom of the list.

I closed and reopened the command prompt, and now when I run java -version I get
Error: could not open `C:\Program Files (x86)\Java\jre1.8.0_161\lib\i386\jvm.cfg'

So what do I need to do? Remove all previous versions? Why isn't 15.0.1 being seen?

Posts: 71070
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure your up to date version appears first in the system PATH. Many people edit the PATH entry or JAVA_HOME, in which case they only have one entry at any time. There is no point in having a second Java┬« entry. You can always reset the PATH from a command window, something like set PATH="C:\Program Files\Java\jdk1.8.0.272\bin";%PATH%, which would let you use Java8u272 only from that command window.
I just had the craziest dream. This tiny ad was in it.
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic