java.lang.NoClassDefFoundError: scala/reflect/api/TypeCreator Crash
See original GitHub issueWhen trying to use the library I get the following error:
[error] (run-main-0) java.lang.NoClassDefFoundError: scala/reflect/api/TypeCreator
[error] java.lang.NoClassDefFoundError: scala/reflect/api/TypeCreator
[error] at fansi.ColorCategory.$anonfun$Full$1(Fansi.scala:851)
[error] at fansi.ColorCategory.$anonfun$Full$1$adapted(Fansi.scala:850)
[error] at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:237)
[error] at scala.collection.immutable.Range.foreach(Range.scala:158)
[error] at scala.collection.TraversableLike.map(TraversableLike.scala:237)
[error] at scala.collection.TraversableLike.map$(TraversableLike.scala:230)
[error] at scala.collection.AbstractTraversable.map(Traversable.scala:108)
[error] at fansi.ColorCategory.<init>(Fansi.scala:850)
[error] at fansi.Color$.<init>(Fansi.scala:717)
[error] at fansi.Color$.<clinit>(Fansi.scala)
[error] at pprint.PPrinter$.$lessinit$greater$default$4(PPrinter.scala:18)
[error] at pprint.package$.<init>(package.scala:7)
[error] at pprint.package$.<clinit>(package.scala)
[error] at com.ronyhe.minerva.Main$.printParse(Main.scala:17)
[error] at com.ronyhe.minerva.Main$.main(Main.scala:9)
[error] at com.ronyhe.minerva.Main.main(Main.scala)
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[error] Caused by: java.lang.ClassNotFoundException: scala.reflect.api.TypeCreator
[error] at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
[error] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
[error] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
[error] at fansi.ColorCategory.$anonfun$Full$1(Fansi.scala:851)
[error] at fansi.ColorCategory.$anonfun$Full$1$adapted(Fansi.scala:850)
[error] at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:237)
[error] at scala.collection.immutable.Range.foreach(Range.scala:158)
[error] at scala.collection.TraversableLike.map(TraversableLike.scala:237)
[error] at scala.collection.TraversableLike.map$(TraversableLike.scala:230)
[error] at scala.collection.AbstractTraversable.map(Traversable.scala:108)
[error] at fansi.ColorCategory.<init>(Fansi.scala:850)
[error] at fansi.Color$.<init>(Fansi.scala:717)
[error] at fansi.Color$.<clinit>(Fansi.scala)
[error] at pprint.PPrinter$.$lessinit$greater$default$4(PPrinter.scala:18)
[error] at pprint.package$.<init>(package.scala:7)
[error] at pprint.package$.<clinit>(package.scala)
// These are my methods
[error] at com.ronyhe.minerva.Main$.printParse(Main.scala:17)
[error] at com.ronyhe.minerva.Main$.main(Main.scala:9)
[error] at com.ronyhe.minerva.Main.main(Main.scala)
// End of my methods
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[error] Nonzero exit code: 1
Any ideas?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top Results From Across the Web
java.lang.NoClassDefFoundError: scala/reflect/api ... - GitHub
When trying to use the library I get the following error: [error] (run-main-0) java.lang.NoClassDefFoundError: scala/reflect/api/TypeCreator [error] ...
Read more >java.lang.NoClassDefFoundError: scala/reflect/api/TypeCreator
I only get this error when I run from IntelliJ. When I run it from SBT with sbt run , it works fine....
Read more >Java.Lang.Noclassdeffounderror: Scala/Reflect/Api/Typecreator
When I try running tests on a project that uses ZIO 1.0.4.1 it fails with java.lang.NoClassDefFoundError: scala/reflect/api/TypeCreator at zio.test.sbt.
Read more >3 ways to solve java.lang.NoClassDefFoundError in Java J2EE
A simple example of NoClassDefFoundError is class belongs to a missing JAR file or JAR was not added into classpath or sometimes jar's...
Read more >sbt/sbt - Gitter
Since I am putting together two dozen projects, how can I find out which project has the incompatible plugin version? I.e. the problem...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It happens, when we have added
% "provided"
inbuild.sbt
After removing% "provided"
, it resolved the problem for me. But for sure for sbt assembly I have to put them back to exclude unnecessary jars to be the part of my package. scalaVersion := “2.12.10”Looks like SBT cannot find the scala-reflect package.
Did you try adding the
scala-reflect.jar
manually to yourbuild.sbt
?"org.scala-lang" % "scala-reflect" % "2.12.8"