Java Proxy Settings - Ubuntu

How to set Java proxy settings in Ubuntu (10.04 or 12.04) from the command line? I aim to get a direct connection, but by default it takes it from the browser settings that are designed to go through the proxy server - I just don’t want Java to go through the proxy server.

I am running an application server in Ubuntu that serves remote desktop sessions. I can put the Java control panel on the user's desktop, and then they (each individual user) can set the proxy settings in the "Network Settings" section. However - this means that I must tell each user to make this parameter that does not work.

I want it to be set via some command line or environment variable on the server itself, so the default is "direct connection". I am not familiar with Java programming, and it will not help me give Java code for this, I think it should be possible to set default values ​​when starting Java? Any pointers are welcome.

How can i do this?

+4
source share
3 answers

Instead of the command line, you can edit $javaDirectory/jre/lib/net.properties .

Remove # before:

 http.proxyHost="proxy host" http.proxyPort="proxy port" 

and set your proxy there.

+3
source

You can export the http_proxy environment variable through the command line.

Example:

 $ export http_proxy=http://proxy-server:port 

There is also an ftp_proxy environment variable , in case you need it.

+2
source

http_proxy is an Ubuntu system environment variable. Does this have anything to do with Java? I do not think so.

I do not use system variables, since I have different proxy requirements for different programs. Firefox should go through the proxy (I install this in the configuration file, and that's fine).

Java should go "direct connection", although this is what I am trying to solve. By default, it is set in the "browser settings". Apparently, this means that he finds out somewhat that Firefox is the default browser and gets the settings from there. I do not want Java to do this - I need a direct connection.

See original post - this is an application server that creates sessions on the fly. I do not want users to play with the Java control panel. Want to install it centrally for Java to always use a direct connection.

+2
source

All Articles