plasma-umass / doppio

Breaks the browser language barrier (includes a plugin-free JVM).
http://plasma-umass.github.io/doppio-demo
MIT License
2.17k stars 176 forks source link

User-unfriendly error message when main class not present #500

Open hhuynh opened 7 years ago

hhuynh commented 7 years ago

Failed to run provided example (Mac, node 6.11.2)

% ../../doppio -cp example example.App

Encountered error: TypeError: Cannot read property 'getLoader' of undefined TypeError: Cannot read property 'getLoader' of undefined at a.getLoader (/Volumes/Unix/workspace/doppio/src/threading.ts:709:49) at a.throwNewException (/Volumes/Unix/workspace/doppio/src/threading.ts:1159:44) at b.a.throwClassNotFoundException (/Volumes/Unix/workspace/doppio/src/ClassLoader.ts:341:12) at a.cb (/Volumes/Unix/workspace/doppio/src/ClassLoader.ts:554:14) at a.run (/Volumes/Unix/workspace/doppio/src/threading.ts:552:12) at a.run (/Volumes/Unix/workspace/doppio/src/threading.ts:851:12) at Immediate. (/Volumes/Unix/workspace/doppio/src/threadpool.ts:84:16) at runCallback (timers.js:672:20) at tryOnImmediate (timers.js:645:5) at processImmediate [as _immediateCallback] (timers.js:617:5)

ttjordan commented 7 years ago

I have the same issue

jvilk commented 7 years ago

I've confirmed and reproduced the issue! I'll take a look when I have time. Thanks for reporting.

jvilk commented 7 years ago

Oof, this is an unfortunate non-error message.

You're actually specifying your classpath incorrectly! If you try:

java -cp docs/examples/example example.App

...notice that it doesn't work. Instead, you need to do:

java -cp docs/examples example.App

Thus, run the following command instead:

../../doppio -cp docs/examples example.App

With that said, this should really give you a better error message!

ttjordan commented 7 years ago

Thank you a lot for a quick reply! It worked!

hhuynh commented 7 years ago

yes that was it. Though if you're inside the docs/examples folder, the correct command is:

%> ../../doppio -cp . example.App