Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

openjdk:8 and nonProxyHosts is not working

I had the following docker configuration:

FROM openjdk:8

ADD *.jar /service.jar

VOLUME /tmp
EXPOSE 8080

# Set timezone CET (DE Time)
ENV TZ=CET
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

CMD echo "The Service will start..." && \
java -DsocksProxyHost=192.168.1.250 -Dhttp.nonProxyHosts="192.168.1.5|192.168.1.36" -jar /service.jar

The problem I have with this is the non proxy is totally ignored in java 8. If I switch into openjdk:9 is working fine, but I cannot do that because the service has stuff that is strongly depends on jdk 8.

I tried without quoting, escaping the pipe character but nothing :(

Somebody has this strange problem, and a solution/workaround for that?

like image 573
Antal Attila Avatar asked Nov 29 '19 14:11

Antal Attila


People also ask

Is OpenJDK 8 available on Debian 9 (Stretch)?

You are on Debian 10 (buster), but the link you showed is for Debian 9 (stretch). OpenJDK is on version 11 for Buster and OpenJDK 8 is not available. If you need this, use a docker image based on Stretch. Show activity on this post.

Is OpenJDK 8 available on Debian 10 alias Buster?

You are on Debian 10 (buster), but the link you showed is for Debian 9 (stretch). OpenJDK is on version 11 for Buster and OpenJDK 8 is not available. If you need this, use a docker image based on Stretch. Show activity on this post. Apparently Debian 10 alias Buster only provides openjdk 11 packages.

Is openjdk-8-jre in Ubuntu 14?

Done E: Unable to locate package openjdk-8-jre Any ideas? I've been trying to figure this out for like 4 hours now. Show activity on this post. OpenJDK8 is not included in Ubuntu 14.04 repositories. You can install Openjdk8 to Ubuntu 14.04 from a PPA this way:

What does the-dhttp nonproxyhosts setting do?

Removing the -Dhttp.nonProxyHosts setting from the Java arguments allows for Bitbucket Server to communicate with the servers correctly (but causes features like manage add-ons to loose connection to the Marketplace. The -Dhttp.nonProxyHosts setting for Java are defined incorrectly -Dhttp.nonProxyHosts=localhost|additionalhost1|*. yourdoman.com


1 Answers

Solved!

After studying the sources of openjdk8 and openjdk9 I figured out I need to specify twice the non proxy ip list. So the solution for openjdk8 is:

java -DsocksProxyHost=192.168.1.250 -Dhttp.nonProxyHosts="192.168.1.5|192.168.1.36" -DsocksNonProxyHosts="192.168.1.5|192.168.1.36" -jar /service.jar
like image 50
Antal Attila Avatar answered Sep 20 '22 03:09

Antal Attila