Error scala no scalac found to compile scala sources
IntelliJ Bug: Scala 145, Error:scalac: Scala compiler JARs not found , In project settings, you need to manually add: JDK Folder. Module and dependencies to JDK AND Scala JAR. In library, Add MANUALLY the JAR of Scala (IntelliJ does not add those JAR. Looks as though you have bound the Scala compilation to the process-resources phase to me. The output about no sources is from the regular maven compiler plugin that compiles Java.
Intellij run error: scalac: No 'scala-library*.jar' in Scala compiler , I get this error: Error:scalac: No 'scala-library*.jar' in Scala compiler classpath in Scala SDK scala-library-2.12.6-sources.jar when trying to run a "Error:scalac: No 'scala-library*.jar' in Scala compiler classpath in Scala SDK SBT: org.scala-lang:scala-library:2.11.10:jar" Without touching the default build.sbt file (leaving it just as it was when I created the project using the wizard), I create a package called "org.public_domain".
With IntelliJ 2017.02.5, receiving error "Error:scalac: No 'scala-library , Creating a brand new Scala SBT project using IntelliJ 2017.2.5 is producing the following error when I attempt to compile a very simple: "Error:scalac: No 'scala-library*.jar' in Scala compiler classpath in Scala SDK SBT: org.scala-lang:scala-library:2.11.10:jar" Scala: Scala 2.11.10 (Sources checked) I found two solutions to the similar problem I am facing on web , do they apply to my code ? 1- Import implicits: Note that this should be done only after an instance of org.apache.spark.sql.SQLContext is created.
请先登录再写评论。
Error scala no scalac found to compile scala sources Follow. IntelliJ Bug: Scala 145, Error:scalac: Scala compiler JARs not found , In project settings, you need to manually add: JDK Folder. Module and dependencies to JDK AND Scala JAR. In library, Add MANUALLY the JAR of Scala (IntelliJ does not add those JAR.
Mygroundbiz
In the more recent versions of IntelliJ (2020.1.1) at the time of writing this, I was able to solve this problem by removing the Scala SDK configured in the
Global Librariessection in IntelliJ and hittingFile > Invalid Caches / Restart.I'm not sure why this solved the issue, perhaps recent versions of the IDE now have automatic detection of Scala compiler JAR files from Maven (which I'm using to build my project).
Mygroundbiz
Error scala no scalac found to compile scala sources Follow. IntelliJ Bug: Scala 145, Error:scalac: Scala compiler JARs not found , In project settings, you need to manually add: JDK Folder. Module and dependencies to JDK AND Scala JAR. In library, Add MANUALLY the JAR of Scala (IntelliJ does not add those JAR.
McDVOICE
Error scala no scalac found to compile scala sources. I'm getting this error message even though scalac is listed in the path of my scala.
MyCenturaHealth
The error "no scalac found to compile scala sources" typically indicates that the Scala compiler (scalac) is not available or properly configured on your system. Here are some steps to resolve this issue:
1. Ensure Scala is Installed
First, verify that Scala is installed on your system. You can check this by running the following command in your terminal:
scala -version
If Scala is not installed, you’ll need to install it.
2. Install Scala
To install Scala, you can follow the steps based on your system:
For Linux (Ubuntu/Debian):
Install the necessary dependencies:
sudo apt update
sudo apt install scala
For macOS (via Homebrew):
If you don’t have Homebrew installed, install it first:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then, install Scala:
brew install scala
For Windows:
You can download the Scala installer for Windows from the official Scala website or use sbt (Scala Build Tool) to install it.
3. Verify scalac Is in Your PATH
Make sure that scalac (the Scala compiler) is in your system’s PATH. If scalac is not recognized after installation, you need to check if it’s correctly set in your environment variables.
For Linux/macOS: Check if scalac is in your PATH:
which scalac
For Windows: Ensure that the Scala bin directory is in your PATH environment variable. You can verify by:
where scalac
If it’s not found, you’ll need to add it manually by including the bin directory of the Scala installation.
4. Using sbt to Compile Scala
If you're using sbt (Scala Build Tool) for your Scala project, you can compile Scala sources by simply running:
sbt compile
This will ensure that scalac is invoked properly by sbt, which handles the project’s build process.
5. Check sbt and Scala Version Compatibility
If you’re using sbt, ensure that the version of sbt you are using is compatible with the version of Scala you have installed. You can check your build.sbt for the Scala version:
scalaVersion := "2.13.6"
6. Reinstall Scala or sbt
If you continue facing issues, consider reinstalling Scala or sbt. Sometimes a fresh installation can resolve any path or version-related issues.
Conclusion:
Ensure Scala is installed and properly set up.
Make sure scalac is available in your system's PATH.
Use sbt to compile if you're using a build tool.
Verify that your sbt version and Scala version are compatible.
If the problem persists or if you're using a specific IDE (e.g., IntelliJ IDEA with the Scala plugin), check if the IDE settings have the correct Scala SDK installed. mcdvoice