4

How do I set the Java proxy settings in Ubuntu (10.04 or 12.04), from the command line? What I am aiming at is to get direct connection, but by default it takes it from browser settings which are meant to go via a proxy - just I don't want Java to go via the proxy.

I am running an application server in Ubuntu which serves remote desktop sessions. I can put the Java control panel into the user's desktop, and then they (each individual user) can set the proxy settings under Network Settings. However - this means I have to tell each user to make this setting, which is not workable.

I want it set via some command line or environment variable on the server itself, so it defaults to "direct connection". I am not familiar with Java programming and it won't help much to give me Java code for this, I think it must be possible to set the defaults upon Java startup? Any pointers are welcome.

How can I do this?

1

2 Answers 2

5

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

Remove # in-front of:

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

and set your proxy there.

Sign up to request clarification or add additional context in comments.

Comments

2

You can export the http_proxy environment variable via command line.

Ex:

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

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.