instructure / pandarus

A Ruby library for the Canvas API (and code generator for other languages, eventually)
34 stars 25 forks source link

Doesn't build with Java 1.8 #20

Closed johnnaegle closed 6 years ago

johnnaegle commented 7 years ago

Java 1.8 has been out since 2014. This project fails to build with Java 1.8.

./build-all failed with:

[INFO] --- scala-maven-plugin:3.1.0:compile (default) @ client-generator ---
[INFO] /Users/johnnaegle/code/pandarus/codegen/src:-1: info: compiling
[INFO] Compiling 1 source files to /Users/johnnaegle/code/pandarus/target/classes at 1474985264938
[ERROR] error: error while loading CharSequence, class file '/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
[INFO] (bad constant pool tag 18 at byte 10)
[ERROR] /Users/johnnaegle/code/pandarus/codegen/src/RubyCanvasCodegen.scala:47: error: overloaded method value replace with alternatives:
[ERROR]   (java.lang.CharSequence,java.lang.CharSequence)java.lang.String <and>
[ERROR]   (Char,Char)java.lang.String
[ERROR]  cannot be applied to (java.lang.String, java.lang.String)
[ERROR]       replace("-", "_").
[ERROR]       ^
[ERROR] two errors found

When I switch to 1.7 it works fine. However, its not easy to have multiple version of Java working with Maven on OSX.

  1. Install JENV
  2. Install Multiple versions of Java
  3. Add this to ~/.mavenrc JAVA_HOME=$(/usr/libexec/java_home -v $(jenv version-name))
  4. Pick your 1.7 version and restart your shell
  5. mvn -verson to make sure you are using 1.7

Since 1.8 has been out for a few years, I think its reasonable to expect that thats the default version that most people will have and pandrus should build with it.

simonista commented 6 years ago

fixed in ad507f09d1354f337835d72f22455d5a60e89231