Le Marin
Le Marin

Reputation: 135

Unable to run jar executable in path on linux

I installed the clojure-lsp according to the instructions on the repository, and put the jar in /usr/bin.

My problem is that I get the error Error: Unable to access jarfile clojure-lsp when I run clojure-lsp, but it seems to works when I run it with sudo.

this is the permissions I have on the executable:

-rwxr-xr-x 1 root root 20822380 Oct 15 11:05 /usr/bin/clojure-lsp

What am I doing wrong?

Upvotes: 0

Views: 274

Answers (1)

Peter Paul Kiefer
Peter Paul Kiefer

Reputation: 2134

I installed the clojure-lsp jar 10 Minutes ago on my arch linux box. Is installed it as root sudo -s and forgot to exit from root environment before I had run it the first time. It worked! After that I recognized my failure and exit from root. Then I ran it again and it failed with "can not access /tmp/lsp.out permission denied". The obvious solution was that the executable had created a file in /tmp with root permissions. I removed this file and restarted and all went well.

It is not the same observation like yours, but perhaps it gives you a clue. I dont't know the conditions you started your installation the first time and, I don't know your OS setup, so it's really hard to help.

Perhaps you've switched on kernel security (like apparmor,...). ??

clojure-lsp is both, a script and a jar file. Internally it starts java. This java opens a jar file at the path $0/closure-lsp (/usr/bin/closure-lsp in you special case). I would interpret the reported error the way, that Java has no access to that file. Perhaps java has no access to /usr/bin. But that would be very strange.

Do you run closure-lsp from a bash / other shell. Do you have java installed and in your PATH? (java -version should work)

Upvotes: 1

Related Questions