eclipse.jdt.ls icon indicating copy to clipboard operation
eclipse.jdt.ls copied to clipboard

How can I run from command line execution with proxy setting?

Open JadenKim-dev opened this issue 2 years ago • 4 comments

Hello, I tried to run eclipse.jdt.ls from command line execution, but following error occurred.

Synchronize project myproject failed due to an error connecting to the Gradle build.
The supplied phased action failed with an exception.
org.gradle.tooling.BuildActionFailureException: The supplied phased action failed with an exception.
	 org.gradle.tooling.internal.consumer.connection.PhasedActionAwareConsumerConnection.run(PhasedActionAwareConsumerConnection.java:58)
	 org.gradle.tooling.internal.consumer.connection.ParameterValidatingConsumerConnection.run(ParameterValidatingConsumerConnection.java:60)
	 org.gradle.tooling.internal.consumer.DefaultPhasedBuildActionExecuter$1.run(DefaultPhasedBuildActionExecuter.java:78)

...
Caused by: org.gradle.api.resources.ResourceException: Could not get resource 'https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-buildpack-platform/2.7.6/spring-boot-buildpack-platform-2.7.6.pom'.

There seems to be an error in building a project using buildship, In my environment, http request is possible only through proxy, so proxy settings are needed.

first, I tried command option

java \
    -Dhttp.proxyHost=my-proxy.com \
    -Dhttp.proxyPort=3128 \
    -Dhttps.proxyHost=my-proxy.com \
    -Dhttps.proxyPort=3128 \
    -Declipse.application=org.eclipse.jdt.ls.core.id1 \
    -Dosgi.bundles.defaultStartLevel=4 \
    -Declipse.product=org.eclipse.jdt.ls.core.product \
    -Xmx1G \
    -jar ./plugins/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar \
    -configuration ./config_linux \
    -data /workspace

but it did not work

I also added settings in ~/.gradle/gradle.properties, <workspace>/gradle.properties, but it did not work so.

systemProp.http.proxyHost=my-proxy.com
systemProp.http.proxyPort=3128
systemProp.https.proxyHost=my-proxy.com
systemProp.https.proxyPort=3128

How can I fix it? I'd appreciate it if you let me know how to set up a proxy.

JadenKim-dev avatar Jul 12 '23 01:07 JadenKim-dev

@JadenKim-dev could you try the following:

$ export http_proxy=http://my-proxy.com:3128
$ export https_proxy=http://my-proxy.com:3128
$ curl -L  https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-buildpack-platform/2.7.6/spring-boot-buildpack-platform-2.7.6.pom --output test.pom
$ ls -l test.pom

snjeza avatar Jul 12 '23 02:07 snjeza

@snjeza I tried the command. It seems that the file was downloaded properly through the proxy

$ ls -l test.pom
-rw-rw-r-- 1 root root 3403  7월 12 03:00 test.pom

JadenKim-dev avatar Jul 12 '23 03:07 JadenKim-dev

@JadenKim-dev Could you try

$ export http_proxy=http://my-proxy.com:3128
$ export https_proxy=http://my-proxy.com:3128
$ java \
    -Declipse.application=org.eclipse.jdt.ls.core.id1 \
    -Dosgi.bundles.defaultStartLevel=4 \
    -Declipse.product=org.eclipse.jdt.ls.core.product \
    -Xmx1G \
    -jar ./plugins/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar \
    -configuration ./config_linux \
    -data /workspace
    

I also added settings in ~/.gradle/gradle.properties, /gradle.properties, but it did not work so.

You can remove it.

snjeza avatar Jul 12 '23 10:07 snjeza

@snjeza Wow, it worked. Thank you very much for helping me solve problem.

JadenKim-dev avatar Jul 13 '23 01:07 JadenKim-dev