0

When I try to run sbt commands like sbt clean, I get the following error:

java.io.IOException: No such file or directory
    at java.io.UnixFileSystem.createFileExclusively(Native Method)
    ...

I have exported JAVA_HOME to point to JDK 8:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home

When I try sudo sbt clean I get a different error:

java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release

Does anyone know how to fix this issue and get sbt running successfully?

Maniyan
  • 35
  • 4
  • 3
    Doesn't the stack trace give more details? Sounds like a permission issue maybe. – Gaël J Jun 09 '23 at 05:18
  • 3
    I know sbt looks at ~/ivy and ~/.sbt directories in my home directory. If your home directory is read only, perhaps running sbt like this may work? `HOME=/tmp sbt clean`. There is also a `-debug` option you can pass to sbt to figure out exactly which file it is trying to open but can't. – Philluminati Jun 09 '23 at 14:45
  • 2
    Have you tried using Java 11? Sometimes there are some incompatibilities, take a look [here](https://stackoverflow.com/questions/71832118/sbt-assembly-cannot-create-jar-getting-java-lang-unsupportedoperationexception) – AminMal Jun 09 '23 at 15:55

0 Answers0