Open andersonDadario opened 7 years ago
Pull request highly appreciated!
And thank you for the report :)
Btw @laurilehmijoki , thank you for s3 website. It`s a great project :)
Also getting the same issue... would love to get this working as it would be my first time using it. Thank you!
——————
Downloading https://github.com/laurilehmijoki/s3_website/releases/download/v3.4.0/s3_website.jar into /Users/clementyeung/.gem/ruby/2.4.2/gems/s3_website-3.4.0/s3_website-3.4.0.jar 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$15.apply(Config.scala:229) at s3.website.model.Config$$anonfun$15.apply(Config.scala:227) at scala.util.Try$.apply(Try.scala:192) at s3.website.model.Config$.erbEval(Config.scala:227) 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:100) 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
java --version java 9.0.1 Java(TM) SE Runtime Environment (build 9.0.1+11) Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
A workaround is to use jenv: https://github.com/laurilehmijoki/s3_website/issues/298
Could this be as simple as upgrading JRuby in build.sbt
?
https://github.com/jruby/jruby/issues/4558#issuecomment-295303107
My experience figuring out how to use jenv
as a workaround, for anyone having trouble:
https://github.com/laurilehmijoki/s3_website/issues/298#issuecomment-361029914
I just used Docker, problem solved.
Here is what I did:
Dockerfile
FROM ruby:2.3.3
RUN apt-get update -qq && \
apt-get install --assume-yes -y \
build-essential \
libpq-dev \
openjdk-7-jre \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Use en_US.UTF-8 as our locale
ENV LC_CTYPE en_US.UTF-8
ENV LANG en_US.UTF-8
# Run bundle
RUN gem install s3_website && s3_website install
RUN mkdir /app
VOLUME /app
WORKDIR /app
CMD bash
build.sh
#!/bin/bash
docker build -t utils/s3_website .
deploy.sh
#!/bin/bash
docker run --rm \
--name s3_website \
-it \
-v "$(cd .. && pwd):/app" \
utils/s3_website \
s3_website push
And I still keep the s3_website.yml file in my app root folder. The app container will access it through a shared volume.
The process is simple:
Note: I am sure that this process can be optimized, e.g., let --dry-run be parameter for deploy.sh, but so far it works well for me.
I tried and failed to make a PR to fix. I know basically nothing about Scala or Java, so no real surprise. Notes:
./sbt assembly
, failed with error around Missing dependency 'object java.lang.Object in compiler mirror'
. Googling seems to suggest this is likely a result of sbt being too old for java 9 (0.13.2).project/sbt-launch.jar
with 0.13.7
downloaded from SBT website. Failed with error module not found: org.scala-sbt#sbt;0.13.17
. This appears to be same actual error as https://github.com/laurilehmijoki/s3_website/issues/312, workaround posted there. Command now works, but "assembly" not a valid command.s3_website
with path:
option in bundler. Still getting error: scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
when trying to publish.project/build.properties
which was locking SBT version (./sbt sbtVersion
) to 0.13. Updated that to 1.1.6 (latest). No cannot resolve sbt-assembly and sbt-idea dependencies, pretty sure those are specified somewhere in this project.error: not found: object AssemblyKeys
(this will very likely burn me later), sbtVersion now reports 1.1.6.object java.lang.Object in compiler mirror not found
:(https://github.com/laurilehmijoki/s3_website/issues/300#issuecomment-345417806 I would also recommend using asdf to manage different versions of java
on your mac. It's a meta manager so it can also manage ruby, nodejs, elixir, erlang, ...
That's how I "fixed" this issue on my machine.
For searchability:
Caused by: java.lang.RuntimeException: unsupported Java version: 10
Got a colleague with the same problem except their runtime exception message is unsupported Java version: 11
Your build dependencies currently indicate that jRuby 1.7.11 is required. jRuby's Github indicates that the latest versions support up to v10: https://github.com/jruby/jruby/blob/ce15c9d63e7312c47c7d86c2852e93a406459c7b/core/src/main/java/org/jruby/RubyInstanceConfig.java
For my future self: Problem:
Caused by: java.lang.RuntimeException: unsupported Java version: 11
at org.jruby.RubyInstanceConfig.initGlobalJavaVersion(RubyInstanceConfig.java:1878)
Solution:
PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin/:$PATH s3_website push
Can confirm that @losomo's workaround worked for me on Ubuntu 18.04 with openjdk-8-jre-headless
package installed.
> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
> dpkg -S /usr/lib/jvm/java-1.8.0-openjdk-amd64
openjdk-8-jre-headless:amd64: /usr/lib/jvm/java-1.8.0-openjdk-amd64
So which Java versions are supported? Can we at least mention that in the Readme? I'd hate to download and install one after the other until I hit one that's supported...
I ended up brew
ing down to adoptopenjdk8
(Java 8) in order to get this plugin to work.
Annoying because I had to completely uninstall adoptopenjdk11
.
I'm stunned that there is a Java dependency locked at 8? I wonder if @alandipert upgrade of JRuby comment would fix this.
I've sent in https://github.com/laurilehmijoki/s3_website/pull/329 that should allow our beloved s3_website on recent versions of Java. I would love a review!
Tried to use s3_website on Mac and unfortunately it does not run with Java 9
Java version