Bash syntax error in rings.repl
tueda opened this issue · 3 comments
I tried for brew install PoslavskySV/rings/rings.repl
on Scientific Linux CERN 6.8, which also installed java 1.9. I understand rings.repl
doesn't work on java 1.9:
/localstore/theorie/tueda/build/linuxbrew/bin/rings.repl: line 10: [[: "9.0.1": syntax error: operand expected (error token is ""9.0.1"")
Loading...
Compiling (synthetic)/ammonite/predef/interpBridge.sc
java.lang.ExceptionInInitializerError
ammonite.interp.CompilerLifecycleManager.init(CompilerLifecycleManager.scala:75)
ammonite.interp.CompilerLifecycleManager.preprocess(CompilerLifecycleManager.scala:49)
...
but the shell script also contains a syntax error (the first line in the above), though it is just ignored by bash and so harmless in practice.
Perhaps this is due to my old bash version. The error comes with
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
which gives
$ [[ "0.9.1" < 8 ]]; echo $?
0
$ [[ "0.9.1" -lt 8 ]]; echo $?
bash: [[: 0.9.1: syntax error: invalid arithmetic operator (error token is ".9.1")
1
Thanks for reporting! I'll fix it later today.
your bash is OK, that was my omission, Java has changed the version string since Java9. I have now fixed this issue.
Unfortunately, Ammonite REPL which is used by the rings.repl doesn't work with java 9 yet, hope it will be fixed very soon.
The current workaround for using REPL in your case may be to downgrade with Homebrew:
brew uninstall --ignore-dependencies jdk
brew install jdk@8
export PATH="/home/_your_user_name_placeholder_/linuxbrew/.linuxbrew/opt/jdk@8/bin:$PATH"
This should work fine, I have just tested it in Docker with SLC6. Please let me know whether it works for you or not.
The Rings library itself should work with Java9 fine (though there is one place where sun.misc
is used), but, in any way, I've created a separate issue to check compatibility with Java9 rigorously #27.
Thanks!
Thanks! Your suggestion with jdk8 worked. For reference, actually what I did is:
brew install jdk@8
export PATH=$(brew --prefix jdk@8)/bin:$PATH
Then rings.repl
did the job.