munificent / magpie

The Magpie programming language
http://magpie-lang.org
Other
360 stars 34 forks source link

Error on REPL launch #12

Closed ghost closed 13 years ago

ghost commented 13 years ago

On magpie I see: java.io.IOException: Couldn't find module magpie.core at com.stuffwithstuff.magpie.app.MagpieAppHost.loadModule(MagpieAppHost.java:42) at com.stuffwithstuff.magpie.interpreter.Interpreter.(Interpreter.java:19) at com.stuffwithstuff.magpie.Magpie.(Magpie.java:17) at com.stuffwithstuff.magpie.app.ConsoleRepl.(ConsoleRepl.java:11) at com.stuffwithstuff.magpie.app.ColorRepl.(ColorRepl.java:5) at com.stuffwithstuff.magpie.app.MagpieApp.main(MagpieApp.java:37) Exception in thread "main" java.lang.NullPointerException at com.stuffwithstuff.magpie.interpreter.Module.readSource(Module.java:30) at com.stuffwithstuff.magpie.interpreter.Module.createParser(Module.java:77) at com.stuffwithstuff.magpie.interpreter.Interpreter.evaluateModule(Interpreter.java:284) at com.stuffwithstuff.magpie.interpreter.Interpreter.(Interpreter.java:39) at com.stuffwithstuff.magpie.Magpie.(Magpie.java:17) at com.stuffwithstuff.magpie.app.ConsoleRepl.(ConsoleRepl.java:11) at com.stuffwithstuff.magpie.app.ColorRepl.(ColorRepl.java:5) at com.stuffwithstuff.magpie.app.MagpieApp.main(MagpieApp.java:37)

munificent commented 13 years ago

Ouch. A couple of questions:

  1. What platform is this on?
  2. What directory were you invoking magpie from?
  3. Can you put a breakpoint where that exception is being thrown and see what appDir is?
ghost commented 13 years ago

I'm on Mac, using Homebrew to manage my packages. The package manager is using ant to build, then placing the magpie and magpie.jar executable in Homebrew's global bin directory.

munificent commented 13 years ago

Oh, eek. That probably won't work. You also need the standard library (the lib/ dir). Right now, it expects that to be in the same directory as magpie.jar.

ghost commented 13 years ago

Ah, so it would probably a better idea for Homebrew to link all the source files into the same directory as the binary then?

munificent commented 13 years ago

It won't need the Java source files (stuff under src/) or any of the other supporting stuff like docs and the spec. But it will need the lib/ directory.

ghost commented 13 years ago

OK, cool. Sorry if I wasted your time; I don't know anything about Java.

munificent commented 13 years ago

Not a waste of time, thanks for trying it out!