Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbuild doesn't work with Java 9 #155

Closed
gkossakowski opened this issue Dec 11, 2014 · 4 comments
Closed

dbuild doesn't work with Java 9 #155

gkossakowski opened this issue Dec 11, 2014 · 4 comments
Labels

Comments

@gkossakowski
Copy link

When trying to run dbuild 0.9.3-SNAPSHOT it blows up with:

[specs2] Caused by: scala.tools.scalap.scalax.rules.ScalaSigParserError: Unexpected error: Not a valid class file
[specs2]    at scala.tools.scalap.scalax.rules.Rules$$anonfun$expect$1.apply(Rules.scala:69)
[specs2]    at scala.tools.scalap.scalax.rules.scalasig.ClassFileParser$.parse(ClassFileParser.scala:99)
[specs2]    at scala.tools.scalap.scalax.rules.scalasig.ScalaSigParser$.parse(ScalaSig.scala:50)
[specs2]    at com.lambdaworks.jacks.ScalaTypeSig$.apply(module.scala:267)
[specs2]    at com.lambdaworks.jacks.ScalaSerializers.findSerializer(module.scala:136)
[specs2]    at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:179)
[specs2]    at com.fasterxml.jackson.databind.ser.SerializerFactory.createSerializer(SerializerFactory.java:53)
[specs2]    at com.fasterxml.jackson.databind.SerializerProvider._createUntypedSerializer(SerializerProvider.java:935)
[specs2]    at com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:892)
[specs2]    at com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:429)
[specs2]    at com.lambdaworks.jacks.IterableSerializer$$anonfun$serialize$1.apply(iterable.scala:26)
[specs2]    at com.lambdaworks.jacks.IterableSerializer$$anonfun$serialize$1.apply(iterable.scala:21)
[specs2]    at scala.collection.immutable.List.foreach(List.scala:318)
[specs2]    at com.lambdaworks.jacks.IterableSerializer.serialize(iterable.scala:21)
[specs2]    at com.lambdaworks.jacks.IterableSerializer.serialize(iterable.scala:14)
[specs2]    at com.lambdaworks.jacks.CaseClassSerializer.serialize(case.scala:17)
[specs2]    at com.lambdaworks.jacks.CaseClassSerializer.serialize(case.scala:13)
[specs2]    at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:224)
[specs2]    at com.fasterxml.jackson.databind.ObjectWriter._configAndWriteValue(ObjectWriter.java:612)
[specs2]    at com.fasterxml.jackson.databind.ObjectWriter.writeValueAsString(ObjectWriter.java:530)
[specs2]    at com.lambdaworks.jacks.JacksMapper.writeValueAsString(jacks.scala:24)
[specs2]    at com.typesafe.dbuild.model.Utils$$anonfun$writeValue$1.apply(Utils.scala:46)
[specs2]    at com.typesafe.dbuild.model.Utils$$anonfun$writeValue$1.apply(Utils.scala:46)
[specs2]    at com.typesafe.dbuild.model.ClassLoaderMadness$.withContextLoader(ClassLoaderMadness.scala:8)
[specs2]    at com.typesafe.dbuild.model.Utils$.writeValue(Utils.scala:46)
[specs2]    at com.typesafe.dbuild.plugin.DBuildRunner$.printResults(DBuildRunner.scala:88)

The underlying reason seems to be lack of support for Java 9 class file format in scalap that dbuild is using transitively.

@gkossakowski
Copy link
Author

@SethTisue
Copy link
Contributor

umbrella ticket on JDK 9 support for Scala is scala/scala-dev#139

@SethTisue
Copy link
Contributor

SethTisue commented Sep 25, 2017

I'm delighted to report that dbuild seems to work fine on Java 9 with sbt 0.13.16 as long as you first run the sbt launcher to copy rt.jar to a directory under ~/.sbt/0.13 and then do e.g. extra.options: ["-Dscala.ext.dirs=/Users/tisue/.sbt/0.13/java9-rt-ext-oracle_corporation_9"] so that Scala 2.10 can find it (see sbt/sbt-launcher-package#143 for details/background)

(I'm working on this in the context of scala/community-build#609)

@SethTisue
Copy link
Contributor

this is working fine now (in the context of scala/community-build#609)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants