Frege/frege

How to run a Frege class file

halloleo opened this issue · 2 comments

Probably a very silly question, but how can I run a class file Frege has generated?

Here's what I've done:

  1. I wrote Frege source file hallo.fr:
greet name = "Hallo " ++ name

main = do
  println (greet "Duda")
  1. I compiled it with:
java -jar frege3.25.84.jar hallo.fr
  1. I got a Main.class file which I try to run via:
java Main

However I get the error

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: frege/prelude/PreludeText$CShow

The Frege jar is in the current directory, so I tried as well

java -cp "." Main

but I got the same error. Do I need another jar to run the class file?

Thanks for getting back to me!

I forgot that the JAR itself needs to be in the CLASSPATH property, not only the directory containing the JAR. -- This is somewhat similar to Haskell (where each module needs to be listed in package.conf.d).