LS-Lab / KeYmaeraX-release

KeYmaera X: An aXiomatic Tactical Theorem Prover for Hybrid Systems (release)
http://keymaeraX.org/
GNU General Public License v2.0
77 stars 39 forks source link

SBT fails to load when using JDK 11 #53

Closed nrfulton closed 4 years ago

nrfulton commented 5 years ago

The ultimate fix is to eventually upgrade to SBT 1.0.0, which should be done regardless because 0.13.6 is quite old.

I tried to perform this update but ran into some issues.

Unfortunately, upgrading to a more recent SBT release will require updating the versions of the plugins. Updating the plugins -- most notably assembly and unidoc -- will require various updates to the build.sbt files that use those plugins.

On a related note, while this upgrade is being done, I recommend consolidating project dependencies and getting rid of stuff we don't need (e.g., the eclipse plugin).

Also notice that when we do this upgrade we will get some messages about improper/insecure reflection during the build process (this is referring SBT or one of its plugins, not our own code). So that issue should also be fixed, because the warning indicates future releases will simply break the build process when this sort of reflection happens instead of giving a warning.

In the mean time, we definitely need to provide instructions for at least Ubuntu and MacOS on how to downgrade and -- in particular -- which version of java we work best with.

nrfulton commented 5 years ago

Regarding the reflection thing:

WARNING: Illegal reflective access by sbt.ivyint.ErrorMessageAuthenticator$ (file:/<redacted>/.sbt/boot/scala-2.10.4/org.scala-sbt/sbt/0.13.6/ivy-0.13.6.jar) to field java.net.Authenticator.theAuthenticator
WARNING: Please consider reporting this to the maintainers of sbt.ivyint.ErrorMessageAuthenticator$
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

These warnings are a result of upgrading to newer java versions, not of upgrading sbt/scala versions.

nrfulton commented 5 years ago

Note: On Mac, he best work-around is to install an alternative version of the JVM and then select 1.8 using jenv. See https://stackoverflow.com/a/29195815

nrfulton commented 4 years ago

If you get an error like: java.lang.RuntimeException: /pageackagfes cannot be represented as URI you should double check if you use OpenJDK. In that case, switching to Oracle Java 8 (and adding it to jenv) should fix the issue.

aplatzer commented 4 years ago

We're just in the process of making KeYmaera X play along more nicely with different JDKs and operating system configurations etc, of which there are always what seems like infinitely many. So thanks for reporting something like that. Can you clarify what the symptom and problem is in your case and whether there's a systematic counteraction?

nrfulton commented 4 years ago

Install java 8 on a new mac with no previous java version installed:

brew tap adoptopenjdk/openjdk &&
brew cask install adoptopenjdk8 &&
brew install scala &&
brew install sbt

If you then attempt to sbt compile, you'll get an error:

[error] java.io.IOError: java.lang.RuntimeException: /packages cannot be represented as URI

Installing Oracle Java 8 instead of OpenJDK Java 8 fixes the issue:

  1. install jenv
  2. install Oracle Java 8 (requires going to Oracle's website and creating an account)
  3. jenv add /path/to/oracle/java/8
  4. jenv shell oracle_java_8_version_string (you can find the version string by running jenv versions)

Confusingly, OpenJDK works just fine on Ubuntu with identical Scala and SBT versions. Unfortunately, all I can do is describe the symptoms and the work-around. Not really sure what's going on here.

@saramagliacane might remember additional details I'm leaving out.