I want to compile .scala files in my libGdx project only for Desktop but this error shows up
Executing task 'DesktopLauncher.main()'...
Executing tasks: [DesktopLauncher.main()]
Task :core:compileJava UP-TO-DATE Task :core:processResources NO-SOURCE Task :core:classes UP-TO-DATE Task :core:jar UP-TO-DATE
Task :desktop:compileJava FAILED warning: [options] bootstrap class path not set in conjunction with -source 1.6 C:\Users\cpepi001\Desktop\myGdxGame\desktop\src\com\mygdx\game\desktop\DesktopLauncher.java:11: error: cannot find symbol new HelloScala(); ^ symbol: class HelloScala location: class DesktopLauncher 1 error 1 warning
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':desktop:compileJava'. Compilation failed; see the compiler error output for details.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 0s 3 actionable tasks: 1 executed, 2 up-to-date 2:10:42 PM: Task execution finished 'DesktopLauncher.main()'.
Steps to reproduce:
new HelloScala);
)Also I try this guide with no success
I managed to find a solution
build.gradle(Project <project_name>
)
project(":core")
section: apply plugin: "scala"
implementation "org.scala-lang:scala-library:$scalaLibraryVersion"
build.gradle(Module: desktop)
java
.srcDirs = [ "src/" ] to sourceSets.main.scala
.srcDirs = [ "src/" ]