I am trying to install to ktlint. I did it with the following line of code on present on their website
curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.39.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
but when i tried ktlint --version
i got an error saying usr/local/bin/ktlint: 3: exec: java: not found
Can someone please help me fix this
Thank you :)
I ran into this issue as well. My solution was to add the jdk bin to my system path. I also had to use Git Bash as my CLI
C:\Program Files\Android\Android Studio\jre\bin
. This dir has the java.exe in it on Windowsjava --version
. You should get the version of your java installktlint --version
. You should get the version of your ktlint install (Note: this assumes you already added ktlint to your system path as well, or are in the ktlint install dir)