Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Where is JRE 11 for JDK 11?  RSS feed

 
Biniman Idugboe
Ranch Hand
Posts: 153
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dowloaded jdk 11 , actually jdk-11.0.1_windows-x64_bin and installed it.  It did not come with jre 11 and I did not see jre 11 at the Oracle download site.  Now, I am not able to run codes compiled with jdk 11.

D:JavaStuff\CompiledCodes>java TradersAndTransactions
Error: LinkageError occurred while loading main class TradersAndTransactions
       java.lang.UnsupportedClassVersionError: TradersAndTransactions has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 54.0


I suppose I am required to install jre 11, but where can I find an authentic copy of jre 11?
 
Campbell Ritchie
Marshal
Posts: 62819
203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They have stopped supplying a separate JRE, but it is included in the JDK anyway. The problem you have got is probably caused by retaining an old (?Java10) version of the JRE in your PATH. That is why you shoiuld always write the Java® PATH entry at the beginning of your PATH.
Please show us your PATH and the results of the following two instructions at the command line/terminal:-
 
Biniman Idugboe
Ranch Hand
Posts: 153
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
D:JavaStuff\CompiledCodes>java -version
java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)

D:JavaStuff\CompiledCodes>javac -version
javac 11.0.1
 
Biniman Idugboe
Ranch Hand
Posts: 153
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, should I just uninstall the jdk 10?
 
Campbell Ritchie
Marshal
Posts: 62819
203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably only need to correct your PATH, which you didn't show us.
 
Biniman Idugboe
Ranch Hand
Posts: 153
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See my Java Path:
Java-Path.png
[Thumbnail for Java-Path.png]
 
Campbell Ritchie
Marshal
Posts: 62819
203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first line says \Oracle\JavaPath. Investigate that carefully; you may find a Java10 JRE in there. Move your Java11 PATH entry to the beginning of the PATH.
 
Biniman Idugboe
Ranch Hand
Posts: 153
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oracle 11g is installed in the computer.  There is no JRE in the path \Oracle\JavaPath.
No-JRE-in-path.PNG
[Thumbnail for No-JRE-in-path.PNG]
 
Paweł Baczyński
Bartender
Posts: 2212
47
Firefox Browser IntelliJ IDE Java Linux Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is java.exe in the path \Oracle\JavaPath.
Windows chooses this executable when you invoke java in the console.
Move your jdk11 path to the top.
 
Campbell Ritchie
Marshal
Posts: 62819
203
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paweł Baczyński wrote:There is java.exe in the path \Oracle\JavaPath. . . .

That counts as a JRE.
 
Biniman Idugboe
Ranch Hand
Posts: 153
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java path has been moved to the to of the list, but problem remains.
Java-path-moved-to-top.png
[Thumbnail for Java-path-moved-to-top.png]
 
Campbell Ritchie
Marshal
Posts: 62819
203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you started a new command line?
 
Biniman Idugboe
Ranch Hand
Posts: 153
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apology.  I relaunched the command prompt and the code runs now.
 
Biniman Idugboe
Ranch Hand
Posts: 153
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
Campbell Ritchie
Marshal
Posts: 62819
203
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a pleasure

Would you like to click the resolved button?
 
a fool thinks himself to be wise, but a wise man knows himself to be a fool - shakespeare. foolish tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!