Error when trying to run a Play Scala app with sbt after fresh install on Catalina: “Error loading JNotify watch service: null”

混江龙づ霸主 提交于 2020-05-26 04:13:08

问题


After moving to Catalina and re-installing everything, no way to run my Play Scala app.

After doing sbt then run, I get this error:

[warn] Error loading JNotify watch service: null

Everything was installed with brew from this brewfile (I didn't paste the complete file):

tap "AdoptOpenJDK/openjdk"

# Mac apps
cask "adoptopenjdk8"

brew "sbt@0.13"
brew "jenv"

Java version:

openjdk version "1.8.0_242"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.242-b08, mixed mode)

sbt: 0.13.18 play: 2.6.20 os x: 10.15.3 (19D76)


回答1:


I can't technically explain why JNotify is not working well on your environment but I can definitely say it's linked to the latest update of openjdk8.

So I succeeded to reproduce the issue with adoptopenjdk8 version 242, my workaround is to uninstall this version of openjdk and force brew to install a previous version (232) :

brew cask install "https://raw.githubusercontent.com/AdoptOpenJDK/homebrew-openjdk/19d716f1c9ebc325ed23c5df580e0d2b027285a1/Casks/adoptopenjdk8.rb"




回答2:


I faced this issue. The above answer helped me. A slightly easier approach for me was instead of uninstalling the current version, I installed 8.0.232.fx-zulu using sdk man. Made this version default. It worked.

commands:

sdk list java sdk install java 8.0.232.fx-zulu make it default: y

Build and run your app.




回答3:


Thanks to @rsefuril. I had the same issue. I had adoptopenjdk8 version 242, installing openjdk version "1.8.0_232" fixed the issue. But I installed graalvm. This link shows how to install graalvm to macos. Download graalvm from here https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-19.3.0

  1. I downloaded https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-19.3.0/graalvm-ce-java8-darwin-amd64-19.3.0.tar.gz

  2. Then extract the file and move the extracted folder

    sudo mv ~/Downloads/graalvm-ce-java8-19.3.0 /Library/Java/JavaVirtualMachines

  3. Add following line to ~/.zprofile file: export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)

  4. Then check if java version is correct:

    java -version

openjdk version "1.8.0_232" OpenJDK Runtime Environment (build 1.8.0_232-20191009173705.graal.jdk8u-src-tar-gz-b07) OpenJDK 64-Bit GraalVM CE 19.3.0 (build 25.232-b07-jvmci-19.3-b05, mixed mode)

That's it.

PS: You may need to delete previous Java 1.8 from system. I deleted it by removing folders from /Library/Java/JavaVirtualMachines/



来源:https://stackoverflow.com/questions/60415568/error-when-trying-to-run-a-play-scala-app-with-sbt-after-fresh-install-on-catali

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!