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 |
David M. Karr 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 #1780974 is a reply to message #1780892] |
Tue, 30 January 2018 17:41 |
miguel angel ramirez escobar 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
|
|
| |
Goto Forum:
Current Time: Wed Apr 24 18:59:09 GMT 2024
Powered by FUDForum. Page generated in 0.02679 seconds
|