Proxy configuration in java on Linux system

2

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

In Windows it is not necessary, it is working perfectly.

  

"Exception in thread" main "java.net.UnknownHostException:   homologacao.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.SSLSocketImpl.connect (SSLSocketImpl.java:673) at   sun.security.ssl.SSLSocketImpl. (SSLSocketImpl.java:432) at   sun.security.ssl.SSLSocketFactoryImpl.createSocket (SSLSocketFactoryImpl.java:88) "

I have already set up in the ControlPanel of java, but it does not work

    
asked by anonymous 26.09.2017 / 14:54

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 make it permanent, just set it to / etc / profile

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

    
27.09.2017 / 16:15