Closed petermattia closed 7 years ago
Solved using jenv. Thanks!
How did you solve that? I've got the same problem :( @petermattia
Ok I solved it too using jenv - here's quick reference how to install and use it on macOS. http://www.jenv.be/
I've installed jenv, can someone walk me through the next steps?
@SixFingeredAmish I was able to run s3_website push
successfully after performing the following:
brew install jenv
mkdir -p ~/.jenv/versions
jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/
jenv versions
oracle64-1.8.0.162
)jenv global oracle64-1.8.0.162
brew cask uninstall java
Running java -version
then reported the following:
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
...and then I was able to run s3_website push
successfully.
Just to iterate on that.
Install jenv
with brew install jenv
Modify your profile script (I edited .bash_profile
) as Homebrew explains, to load jenv
:
if which jenv > /dev/null; then eval "$(jenv init -)"; fi
Re-start your shell, or source your profile, or run eval "$(jenv init -)"
to activate jenv
. (This is needed to first set up some directories in your home folder.)
Install Java 8 and tell jenv
about it:
brew tap caskroom/versions
brew cask install java8
jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/
Either use jenv global 1.8
to set the Java runtime globally or, as I prefer, just run jenv local 1.8
inside the directory you will run s3_website
from. This generates the .java_version
file which you may want to add to your Git repo.
Alternatively, can use asdf
as a meta-manager (ie not just for java).
brew install asdf
asdf plugin-add java
asdf list-all java
asdf install java oracle-8.142
asdf local java oracle-8.191
And make sure you uninstall JDK 9 as mentioned above.
Then I was able to run s3_website push
successfully too.
@natseg
But if JDK is uninstalled, we get this: No Java runtime present, requesting install.
Also, I couldn't find 'java orcale-8.142' from the asdf java list. So I went with an amazon corretto 8 version. That could be the problem?
I've been using s3_website for a few months now and really like it. I recently updated to macOS High Sierra and updated JDK to version 9. When I recently ran s3_website, I got the following error:
Exception in thread "main" java.lang.ExceptionInInitializerError at org.jruby.Ruby.newInstance(Ruby.java:266) at s3.website.Ruby$.rubyRuntime$lzycompute(Ruby.scala:4) at s3.website.Ruby$.rubyRuntime(Ruby.scala:4) at s3.website.model.Config$$anonfun$13.apply(Config.scala:218) at s3.website.model.Config$$anonfun$13.apply(Config.scala:216) at scala.util.Try$.apply(Try.scala:192) at s3.website.model.Config$.erbEval(Config.scala:216) at s3.website.model.Site$$anonfun$2.apply(Site.scala:28) at s3.website.model.Site$$anonfun$2.apply(Site.scala:27) at scala.util.Success.flatMap(Try.scala:231) at s3.website.model.Site$.parseConfig(Site.scala:27) at s3.website.model.Site$.loadSite(Site.scala:96) at s3.website.Push$.push(Push.scala:62) at s3.website.Push$.main(Push.scala:40) at s3.website.Push.main(Push.scala) Caused by: java.lang.RuntimeException: unsupported Java version: 9 at org.jruby.RubyInstanceConfig.initGlobalJavaVersion(RubyInstanceConfig.java:1878) at org.jruby.RubyInstanceConfig.<clinit>(RubyInstanceConfig.java:1585) ... 15 more
Looks like it's a problem with Java version 9? Thanks for your help!