Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » With JDK set to jdk1.8.0_152, Tomcat in Eclipse tries to use JRE1.8.0_144 and fails
With JDK set to jdk1.8.0_152, Tomcat in Eclipse tries to use JRE1.8.0_144 and fails [message #1780221] Thu, 18 January 2018 17:47 Go to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
I maintain a couple of webapps that run in Tomcat. When I test changes in them, which I don't have to do often, I run Tomcat 8.5 in Eclipse. This has been working fine.

Today I tried to run the server and I got this in the console:
Error occurred during initialization of VM
java.lang.UnsatisfiedLinkError: java.io.FileInputStream.available()I
	at java.io.FileInputStream.available(Native Method)
	at sun.nio.cs.StreamDecoder.inReady(Unknown Source)
	at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
	at sun.nio.cs.StreamDecoder.read(Unknown Source)
	at java.io.InputStreamReader.read(Unknown Source)
	at java.io.BufferedReader.fill(Unknown Source)
	at java.io.BufferedReader.readLine(Unknown Source)
	at java.io.BufferedReader.readLine(Unknown Source)
	at sun.misc.MetaIndex.registerDirectory(Unknown Source)
	at sun.misc.Launcher$ExtClassLoader$1.run(Unknown Source)
	at sun.misc.Launcher$ExtClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.misc.Launcher$ExtClassLoader.getExtClassLoader(Unknown Source)
	at sun.misc.Launcher.<init>(Unknown Source)
	at sun.misc.Launcher.<clinit>(Unknown Source)
	at java.lang.ClassLoader.initSystemClassLoader(Unknown Source)
	at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)


I thought perhaps my Tomcat installation was corrupted, so I installed the latest 8.5 distro, created a new runtime in Eclipse, telling it to use my JDK1.8.0_152 JVM, created a new server with that runtime, added my two webapps to it, and started it. Same error.

I then manually tried to run Tomcat from the shell. It started up fine.

I then edited the server run configuration, adding "-verbose:class" to it. When I restarted the server, I saw that the first line of output (with many similar lines after it) was this:

[Opened C:\Program Files\Java\jre1.8.0_144\lib\resources.jar]


I don't know for sure, but I'm guessing that having it run with a JRE instead of a JDK is what's causing this error.

Besides the JDK that I have installed, I also have a JRE. However, as far as I can tell, I'm not specifying to use that JRE anywhere. I checked the Eclipse process, and it's using the 152 JDK.

I verified that in the Installed JREs list, the 152 JDK is checked, and the 144 JRE is not. I even just tried removing the 144 JRE from the list of Installed JREs.

I verified that the Tomcat runtime in Eclipse is specified to use the 152 JDK. What is making it use the 144 JRE?
Re: With JDK set to jdk1.8.0_152, Tomcat in Eclipse tries to use JRE1.8.0_144 and fails [message #1780225 is a reply to message #1780221] Thu, 18 January 2018 18:36 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
Well, never mind. I don't know how it got into this state, but I finally noticed that in the definition of my JDK 152 runtime, all the libraries were from the 144 JRE. Once I deleted that and recreated it, Tomcat worked fine.
Re: With JDK set to jdk1.8.0_152, Tomcat in Eclipse tries to use JRE1.8.0_144 and fails [message #1780828 is a reply to message #1780225] Mon, 29 January 2018 03:36 Go to previous messageGo to next message
miguel angel ramirez escobar is currently offline miguel angel ramirez escobarFriend
Messages: 2
Registered: January 2018
Junior Member
Hi, How did you make those changes? I also have the same problem you had, but I can not understand your solution, I am really self-taught in the programming topic, I would appreciate your help
Re: With JDK set to jdk1.8.0_152, Tomcat in Eclipse tries to use JRE1.8.0_144 and fails [message #1780892 is a reply to message #1780828] Mon, 29 January 2018 16:20 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
In Eclipse, bring up the Preferences window. Navigate to "Java"->"Installed JREs". Click on the JRE with the issue. Click the "Edit" button. To first verify that you actually have the same problem, inspect the path in the "JRE home" field, and compare that path to the paths in the list of "JRE system libraries" at the bottom of the dialog. If the path in the "JRE home" is not the prefix of all the paths in the below list, then you have the same problem.

To fix this, the likely easiest way is to click on the "Restore Default" button on the same dialog. That likely will remove the "errant" library references and replace them with the library references inside the given "JRE home" value.
Re: With JDK set to jdk1.8.0_152, Tomcat in Eclipse tries to use JRE1.8.0_144 and fails [message #1780974 is a reply to message #1780892] Tue, 30 January 2018 17:41 Go to previous messageGo to next message
miguel angel ramirez escobar is currently offline miguel angel ramirez escobarFriend
Messages: 2
Registered: January 2018
Junior Member
hello david, thank you for responding to my concern, I changed the jre for the jdk, i'm really using the jdk 1.8.0 161, when I changed it I used to throw a console exception where they told me that I had to change "com.mysql.jdbc.Driver "by" com.mysql.cj.jdbc.Driver ", I did it but now it only appears by console connection not established as an exception of the connection catch and in the debug I figure the exception the source attachment does not contain the source for the file launcher.class, but really if you have it, what can I do about it?, thanks
Re: With JDK set to jdk1.8.0_152, Tomcat in Eclipse tries to use JRE1.8.0_144 and fails [message #1780978 is a reply to message #1780974] Tue, 30 January 2018 18:44 Go to previous message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
Post a new question with full details of your problem.
Previous Topic:What's the purpose of "bindingKeys" in the "createASTs" method for the "AST
Next Topic:Add fragment part to views shortlist
Goto Forum:
  


Current Time: Wed Apr 24 18:59:09 GMT 2024

Powered by FUDForum. Page generated in 0.02679 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top