0

I already installed java jdk , sbt and scala on my pc and I already set up all path variables. But the terminal give me following error message when I try to use scala:

myfault

C:\Users\Ruchira Lakmal>scala
Error: Could not find or load main class Lakmal\AppData\Local\Coursier\data\bin\scala.bat
Caused by: java.lang.ClassNotFoundException: Lakmal\AppData\Local\Coursier\data\bin\scala.bat

May I know what is the reason and what is the solution please?

blackraven
  • 5,284
  • 7
  • 19
  • 45
  • 2
    Something is passing your `scala.bat` file as a class name to `java`. That's not going to work. You probably have arguments mixed up somewhere. – Jorn Jul 03 '23 at 14:02
  • 1
    Does this answer your question? [How do I resolve ClassNotFoundException?](https://stackoverflow.com/questions/17408769/how-do-i-resolve-classnotfoundexception) – fantaghirocco Jul 03 '23 at 14:42
  • 2
    Personal advice, use **WSL** and install everything in there using **coursier** instead of trying to get **Scala** on **Windows** working. – Luis Miguel Mejía Suárez Jul 03 '23 at 15:53
  • 2
    It looks like a problem with the space character in the directory path – Tim Moore Jul 03 '23 at 22:07
  • 1
    Try [changing your folder](https://www.minitool.com/news/change-user-folder-name-windows-10.html) to "RuchiraLakmal" so that your path becomes `C:\Users\RuchiraLakmal` (without space), then reinstall everything all over including path variables. – blackraven Jul 04 '23 at 11:59
  • Thank you @perpetualstudent , it worked – Ruchira Lakmal Jul 04 '23 at 13:58

1 Answers1

1

Try changing your Windows folder name to "RuchiraLakmal" so that your path becomes
C:\Users\RuchiraLakmal (without space),
then reinstall everything all over including path variables.

blackraven
  • 5,284
  • 7
  • 19
  • 45