Java proxy configuration on Linux system

Asked

Viewed 451 times

2

I have proxy configuration on my network, and to run java I need to set the proxy properties on it,.

In windows is not necessary, it is working perfectly.

"Exception in thread "main" java.net.Unknownhostexception: approval.nfce.fazenda.pr.Gov.br atjava.net.Abstractplainsocketimpl.connect(Abstractplainsocketimpl.java:184) at java.net.Sockssocketimpl.connect(Sockssocketimpl.java:392) at java.net.Socket.connect(Socket.java:589) at sun.security.ssl.SLSocketImpl.connect(Sslsocketimpl.java:673) at sun.security.ssl.SLSocketImpl.(Sslsocketimpl.java:432) at sun.security.ssl.SLSocketFactoryImpl.createSocket(Sslsocketfactoryimpl.java:88)"

I’ve already set it up in the Java Controlpanel, but it doesn’t work

1 answer

1

Set the proxy setting as the global OS variable as follows:

Proxy without authentication:

$ export http_proxy="http://PROXY_SERVER:PORT"
$ export https_proxy="https://PROXY_SERVER:PORT"
$ export ftp_proxy="http://PROXY_SERVER:PORT"

Proxy with authentication:

$ export http_proxy="http://USER:PASSWORD@PROXY_SERVER:PORT"
$ export https_proxy="https://USER:PASSWORD@PROXY_SERVER:PORT"
$ export ftp_proxy="http://USER:PASSWORD@PROXY_SERVER:PORT"

If you want to leave it final, just configure in the /etc/profile

More details: Linux Proxy Server Settings - Set Proxy For Command Line

Browser other questions tagged

You are not signed in. Login or sign up in order to post.