Sbt: Error on building with java 8

Created on 18 Dec 2014  路  3Comments  路  Source: sbt/sbt

Hey,

I'm getting the following error:

Pedros-Air:quickcheck pedrorijo$ sbt
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384m; support was removed in 8.0
error: error while loading CharSequence, class file '/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
(bad constant pool tag 18 at byte 10)

I'm using Java 1.8.0_25 in Mavericks

Pedros-Air:quickcheck pedrorijo$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

Also, sbt 0.13.6

Pedros-Air:quickcheck pedrorijo$ sbt --version
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384m; support was removed in 8.0
sbt launcher version 0.13.6

And, among other definitions my build.sbt contains

name <<= submitProjectName(pname => "progfun-"+ pname)

version := "1.0.0"

scalaVersion := "2.11.4"

scalacOptions ++= Seq("-deprecation", "-feature")

As far as I've looked, there are some know issues with scala 2.10 and java 8, but I've configured to scala 2.11x, so what is wrong ?

ps: I'm trying to build 1st assignment (QuickCheck) from coursera at https://class.coursera.org/reactive-001/assignment

Thanks

All 3 comments

the error message definitely looks like a too-old scala version not ready for java 8.

be aware in sbt you're dealing with two different scala versions: the one used by sbt for the build process (depending on the sbt version) and the one used to compile your code agains (configured with e.g. scalaVersion := "2.11.4" above).

still, not sure what's happening here. could it be you have an older sbt.version in project/build.properties so the sbt launcher (which seems to be 0.13.6) reverts to that?

you were right, there was another sbt.version in other file. Now sbt builds correctly. There are still some issues in the dependencies, but that's fixable ;)

Thnaks

[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.millenniumit.surveillance:StatModule:jar:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 225, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building StatModule 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://nexus.millenniumit.com/content/groups/public/org/scala-lang/scala-library/2.11.4/scala-library-2.11.4.jar
Downloaded: http://nexus.millenniumit.com/content/groups/public/org/scala-lang/scala-library/2.11.4/scala-library-2.11.4.jar (5408 KB at 6691.8 KB/sec)
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ StatModule ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO]
[INFO] --- maven-scala-plugin:2.11:compile (default) @ StatModule ---
[WARNING] scala library version define in dependencies doesn't match the scalaVersion of the plugin
[INFO] Checking for multiple versions of scala
[WARNING] Multiple versions of scala libraries detected!
[INFO] Compiling 31 source files to D:\survnextgen\StatModule\target\classes
[INFO] use scala command with args in file
error: error while loading CharSequence, class file 'C:\Program Files\Java\jdk1.8.0_74\jre\lib\rt.jar(java/lang/CharSequence.class)' is broken
(bad constant pool tag 15 at byte 1501)
error: error while loading LocalDateTime, class file 'C:\Program Files\Java\jdk1.8.0_74\jre\lib\rt.jar(java/time/LocalDateTime.class)' is broken
(bad constant pool tag 15 at byte 10336)
error: error while loading package, class file needed by package is missing.
reference value apply of object Symbol refers to nonexisting symbol.
error: class file needed by SparkSession is missing.
reference value internal of package org.apache.spark refers to nonexisting symbol.
four errors found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.792s
[INFO] Finished at: Tue Nov 06 11:08:35 IST 2018
[INFO] Final Memory: 27M/358M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.scala-tools:maven-scala-plugin:2.11:compile (default) on project StatModule: command line returned non-zero value:1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Process finished with exit code 1

could you please help me to resolve this

Was this page helpful?
0 / 5 - 0 ratings