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

Put this bash script into the appropriate location #1823

Closed
KOLANICH opened this issue Jul 28, 2021 · 7 comments · Fixed by #2005
Closed

Put this bash script into the appropriate location #1823

KOLANICH opened this issue Jul 28, 2021 · 7 comments · Fixed by #2005

Comments

@KOLANICH
Copy link

KOLANICH commented Jul 28, 2021

It'd be nice to include it into the prebuilt packages. It makes starting the server easier.

#!/usr/bin/env bash

set -e;

CD=`dirname "${BASH_SOURCE[0]}"`;  # current directory
CD=`realpath $CD`;
echo "CD: $CD";
echo "Args: $@"

SERVER=$CD;  # path to language server dir. Useful, when utilising this script for other distributions of this language server
PLUGINS=$SERVER/plugins;
LAUNCHER=$PLUGINS/$(ls -1 "$PLUGINS" | grep -P "org\\.eclipse\\.equinox\\.launcher_.+\\.jar");
#LAUNCHER=/usr/share/maven-repo/org/eclipse/equinox/org.eclipse.equinox.launcher/debian/org.eclipse.equinox.launcher-debian.jar;
#LOMBOK="/usr/share/maven-repo/org/projectlombok/lombok/debian/lombok-debian.jar"
echo $LAUNCHER;

#-javaagent:$LOMBOK
#-Dsyntaxserver=true
java -jar $LAUNCHER -- --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Dosgi.checkConfiguration=true -Dosgi.sharedConfiguration.area.readOnly=true -Dosgi.configuration.cascaded=true -Dfile.encoding=UTF-8 -DwatchParentProcess=true -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication -configuration $SERVER/config_linux $@
#-data /tmp/jdt_ws/%{ActiveProject:Name} - add this arg into the start up args in your IDE. %{ActiveProject:Name} is the var of Qt Creator, other IDEs hase other vars.
#-Dosgi.sharedConfiguration.area=#{etc}/jdtls
@rgrunber
Copy link
Contributor

rgrunber commented Aug 6, 2021

We do have a section on the wiki page for starting the language server from the command line : https:/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line . It goes into some detail about the various options.

@KOLANICH
Copy link
Author

I know. But it is useful to have a ready-to-use script (that can also be customized if needed).

@rgrunber
Copy link
Contributor

rgrunber commented Aug 16, 2021

I guess I don't really disagree with this. After all, I have a separate shell script locally I've used to launch JDT-LS from commandline and stored the specific options in a shell script. The tricky part is getting and testing something for Windows, Mac, Linux.

On top of this, each client (that implements JDT-LS may have their own way of connecting made available. For example : https:/redhat-developer/vscode-java/blob/master/CONTRIBUTING.md#running-everything , so I'd probably want to keep the scripts in here as simple as possible.

@schrieveslaach
Copy link
Contributor

I'm trying to create a brew formula to make the installation on MacOS easier (see Homebrew/homebrew-core#92550) and one of the maintainers ask for such a scripts

Why doesn't upstream ship a script that sets this because this seems very fragile

The brew formula would solve one of @rgrunber concerns. This would test jdtls on MacOS at least when updating to a new version.

But the process of creating the brew formula raised another question: why is it necessary that the configuration must be writable: >The configuration area at '/usr/local/etc/jdtls' is not writable. Please choose a writable location using the '-configuration

@schrieveslaach
Copy link
Contributor

You can observe the configuration error here

@schrieveslaach
Copy link
Contributor

schrieveslaach commented Jan 18, 2022

I solved the read-only configuration issue by adding -Dosgi.checkConfiguration=true -Dosgi.sharedConfiguration.area=#{etc}/jdtls -Dosgi.sharedConfiguration.area.readOnly=true -Dosgi.configuration.cascaded=true as Java properties. These properties make the execution of jdtls package manager friendly and should be included in the script as well.

@KOLANICH
Copy link
Author

Thanks, added.

schrieveslaach added a commit to schrieveslaach/eclipse.jdt.ls that referenced this issue Feb 2, 2022
schrieveslaach added a commit to schrieveslaach/eclipse.jdt.ls that referenced this issue Feb 5, 2022
schrieveslaach added a commit to schrieveslaach/eclipse.jdt.ls that referenced this issue Feb 7, 2022
schrieveslaach added a commit to schrieveslaach/eclipse.jdt.ls that referenced this issue Feb 8, 2022
schrieveslaach added a commit to schrieveslaach/eclipse.jdt.ls that referenced this issue Feb 11, 2022
schrieveslaach added a commit to schrieveslaach/eclipse.jdt.ls that referenced this issue Feb 21, 2022
schrieveslaach added a commit to schrieveslaach/eclipse.jdt.ls that referenced this issue Feb 21, 2022
schrieveslaach added a commit to schrieveslaach/eclipse.jdt.ls that referenced this issue Feb 24, 2022
schrieveslaach added a commit to schrieveslaach/eclipse.jdt.ls that referenced this issue Feb 24, 2022
schrieveslaach added a commit to schrieveslaach/eclipse.jdt.ls that referenced this issue Feb 24, 2022
schrieveslaach added a commit to schrieveslaach/eclipse.jdt.ls that referenced this issue Feb 26, 2022
schrieveslaach added a commit to schrieveslaach/eclipse.jdt.ls that referenced this issue Feb 26, 2022
schrieveslaach added a commit to schrieveslaach/eclipse.jdt.ls that referenced this issue Mar 2, 2022
rgrunber pushed a commit that referenced this issue Mar 2, 2022
@rgrunber rgrunber added this to the End February 2022 milestone Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants