Scala Mixed Java Scala project problem
See original GitHub issueI followed this: http://davidb.github.io/scala-maven-plugin/example_java.html and created a sample project: https://github.com/danyaljj/sampleMixedScalaJavaMavenProject I keep getting the following error. Where am I going wrong?
AI2s-MBP-7:mixedScalaJavaProject i-danielk$ mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Test for Java + Scala compilation 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ testJavaAndScala ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/i-danielk/ideaProjects/mixedScalaJavaProject/src/main/resources
[INFO]
[INFO] --- scala-maven-plugin:3.2.1:add-source (scala-compile-first) @ testJavaAndScala ---
[INFO] Add Source directory: /Users/i-danielk/ideaProjects/mixedScalaJavaProject/src/main/scala
[INFO] Add Test Source directory: /Users/i-danielk/ideaProjects/mixedScalaJavaProject/src/test/scala
[INFO]
[INFO] --- scala-maven-plugin:3.2.1:compile (scala-compile-first) @ testJavaAndScala ---
[INFO] /Users/i-danielk/ideaProjects/mixedScalaJavaProject/src/main/java:-1: info: compiling
[INFO] /Users/i-danielk/ideaProjects/mixedScalaJavaProject/src/main/scala:-1: info: compiling
[INFO] Compiling 2 source files to /Users/i-danielk/ideaProjects/mixedScalaJavaProject/target/classes at 1440462398489
[ERROR] error: error while loading Consumer, class file '/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/rt.jar(java/util/function/Consumer.class)' is broken
[INFO] (bad constant pool tag 18 at byte 15)
[ERROR] one error found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.366 s
[INFO] Finished at: 2015-08-24T19:26:39-05:00
[INFO] Final Memory: 11M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.1:compile (scala-compile-first) on project testJavaAndScala: wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit 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/MojoExecutionException
AI2s-MBP-7:mixedScalaJavaProject i-danielk$
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
mixed scala/java project, which compile first? - Stack Overflow
1 Answer 1 · java is compiled first, if both compilation are run in their default phase · scala depends of java, nothing...
Read more >Gradle: Mixed Scala/Java projects fail to compile #926 - GitHub
Describe the bug Gradle build scripts that have both Scala and Java sources fail to build. To Reproduce Add a simple Scala class...
Read more >external build of mixed Java/Scala project cannot see Lombok ...
The only workaround I can see is to write those methods manually. I suspect this could be solved by allowing the -processorpath to...
Read more >Mixing Java and Scala code in the software - Medium
Is it possible to mix Scala and Java code? Yes, there is the ability to mix both types of code. It is possible...
Read more >Java records in mixed Java/Scala 3 project - Question
The question is how scalac parses java source in mixed compilation. Otherwise, scalac assumes the available javac consumes java source. 1 Like. Home ......
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 FreeTop 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
Top GitHub Comments
Whoops … I got it to work after I msged here, but forgot to close this. Closing now …
I checked to make sure the Scala and Spark versions in mine were correct. When I changed the Spark version to the correct one, the problem was resolved.