laurilehmijoki / s3_website

Manage an S3 website: sync, deliver via CloudFront, benefit from advanced S3 website features.
Other
2.24k stars 187 forks source link

No support for JDK 9? #298

Closed petermattia closed 7 years ago

petermattia commented 7 years ago

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!

petermattia commented 7 years ago

Solved using jenv. Thanks!

9teen90nine commented 7 years ago

How did you solve that? I've got the same problem :( @petermattia

9teen90nine commented 7 years ago

Ok I solved it too using jenv - here's quick reference how to install and use it on macOS. http://www.jenv.be/

steakscience commented 6 years ago

I've installed jenv, can someone walk me through the next steps?

lucascantor commented 6 years ago

@SixFingeredAmish I was able to run s3_website push successfully after performing the following:

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.

rgov commented 6 years ago

Just to iterate on that.

  1. Install jenv with brew install jenv

  2. Modify your profile script (I edited .bash_profile) as Homebrew explains, to load jenv:

if which jenv > /dev/null; then eval "$(jenv init -)"; fi
  1. 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.)

  2. 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/
  3. 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.

natseg commented 5 years ago

Alternatively, can use asdf as a meta-manager (ie not just for java).

And make sure you uninstall JDK 9 as mentioned above.

Then I was able to run s3_website push successfully too.

jijo-sunny commented 4 years ago

@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?