provegard / ncdbg

A debugger for Nashorn that uses Chrome DevTools as frontend
BSD 3-Clause "New" or "Revised" License
31 stars 5 forks source link

java.lang.NoClassDefFoundError: com/sun/jdi/Bootstrap #105

Closed hugsyy closed 5 years ago

hugsyy commented 5 years ago

Hello, There is a closed issue without conclusion here with the same error. I successfully got it working on another computer but on this one I got following error. How can I fix this? Thanks

NCDbg version: 0.8.3
NCDbg built with Java version: 1.8
Local Java version: 1.8.0_181
Exception in thread "main" java.lang.BootstrapMethodError: java.lang.NoClassDefF
oundError: com/sun/jdi/VirtualMachine
        at com.programmaticallyspeaking.ncd.boot.Broker.connect(Broker.scala:27)

        at com.programmaticallyspeaking.ncd.boot.Boot$.delayedEndpoint$com$progr
ammaticallyspeaking$ncd$boot$Boot$1(Boot.scala:38)
        at com.programmaticallyspeaking.ncd.boot.Boot$delayedInit$body.apply(Boo
t.scala:16)
        at scala.Function0.apply$mcV$sp(Function0.scala:34)
        at scala.Function0.apply$mcV$sp$(Function0.scala:34)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:
12)
        at scala.App.$anonfun$main$1$adapted(App.scala:76)
        at scala.collection.immutable.List.foreach(List.scala:389)
        at scala.App.main(App.scala:76)Connecting to localhost:7777...

        at scala.App.main$(App.scala:74)
        at com.programmaticallyspeaking.ncd.boot.Boot$.main(Boot.scala:16)
        at com.programmaticallyspeaking.ncd.boot.Boot.main(Boot.scala)
Caused by: java.lang.NoClassDefFoundError: com/sun/jdi/VirtualMachine
        ... 12 more
Caused by: java.lang.ClassNotFoundException: com.sun.jdi.VirtualMachine
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 12 more
Exception in thread "Thread-1" java.lang.NoClassDefFoundError: com/sun/jdi/Boots
trap
        at com.programmaticallyspeaking.ncd.nashorn.Connections$.getConnector(Co
nnections.scala:13)
        at com.programmaticallyspeaking.ncd.nashorn.Connections$.connect(Connect
ions.scala:9)
        at com.programmaticallyspeaking.ncd.nashorn.NashornDebuggerConnector.con
nect(NashornDebugger.scala:26)
        at com.programmaticallyspeaking.ncd.nashorn.NashornDebuggerConnector.$an
onfun$connect$1(NashornDebugger.scala:18)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.sun.jdi.Bootstrap
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 5 more
provegard commented 5 years ago

I think this is caused by the fact that tools.jar is not on the class path. Which are the differences between the two computers?

provegard commented 5 years ago

Note that tools.jar is a runtime dependency, i.e. not part of the release bundle, because we want the tools.jar that belongs to the JDK that runs NCDbg, not the JDK that compiled it.

hugsyy commented 5 years ago

It is working on pc with jdk 1.8.0_192 but not working on pc which has jre 1.8.0_181.

provegard commented 5 years ago

JRE doesn't include tools.jar, so it won't work.

hugsyy commented 5 years ago

Ok thanks! I will change java to jdk