Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PermissionError: [Errno 13] Permission denied with --java-executable argument #3255

Open
jakDev003 opened this issue Aug 27, 2024 · 1 comment
Labels

Comments

@jakDev003
Copy link

Hello I am trying to run JDTLS with Helix.

I am getting Permission Error reported from Helix.

I have to run two versions of Java due to my company using Java 8 and JTDLS needing Java 17 or higher.

In my bashrc I have Java 8 set like so:

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin

When I try to test with the command jdtls I am getting the following error:

Traceback (most recent call last):
  File "/usr/local/bin/jdtls/bin/jdtls", line 17, in <module>
    jdtls.main(sys.argv[1:])
  File "/usr/local/bin/jdtls/bin/jdtls.py", line 87, in main
    java_executable = get_java_executable(known_args)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/bin/jdtls/bin/jdtls.py", line 44, in get_java_executable
    raise Exception("jdtls requires at least Java 17")
Exception: jdtls requires at least Java 17

When I try to run the command to use Java 21

jdtls --java-executable=/usr/lib/jvm/java-21-openjdk-amd64/bin

I get the following error which matches what Helix shows in the logs:

Traceback (most recent call last):
  File "/usr/local/bin/jdtls/bin/jdtls", line 17, in <module>
    jdtls.main(sys.argv[1:])
  File "/usr/local/bin/jdtls/bin/jdtls.py", line 87, in main
    java_executable = get_java_executable(known_args)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/bin/jdtls/bin/jdtls.py", line 37, in get_java_executable
    out = subprocess.check_output([java_executable, '-version'], stderr = subprocess.STDOUT, universal_newlines=True)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.12/subprocess.py", line 1955, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/usr/lib/jvm/java-21-openjdk-amd64/bin'
@rgrunber
Copy link
Contributor

rgrunber commented Sep 5, 2024

What happens if you try :

jdtls --java-executable=/usr/lib/jvm/java-21-openjdk-amd64/bin/java

(ie. have --java-executable point to the java executable and not just the folder under which it is located)

  --java-executable JAVA_EXECUTABLE
                        Path to java executable used to start runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants