Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 "[email protected]"
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)

like image 733
sar Avatar asked Feb 26 '20 13:02

sar


2 Answers

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"

like image 176
ersefuril Avatar answered Oct 01 '22 12:10

ersefuril


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.

like image 45
Dilip Murupala Avatar answered Oct 01 '22 13:10

Dilip Murupala