How to run a Frege class file
halloleo opened this issue · 2 comments
halloleo commented
Probably a very silly question, but how can I run a class file Frege has generated?
Here's what I've done:
- I wrote Frege source file
hallo.fr
:
greet name = "Hallo " ++ name
main = do
println (greet "Duda")
- I compiled it with:
java -jar frege3.25.84.jar hallo.fr
- 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?
Ingo60 commented
One needs to have the Frege jar in the classpath, please read the how to
get started document.
halloleo ***@***.***> schrieb am Mo., 12. Sept. 2022, 09:08:
… 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?
—
Reply to this email directly, view it on GitHub
<#395>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAF725XICP4JWCHVATZ6I33V53JGPANCNFSM6AAAAAAQKFLKFM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
halloleo commented
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
).