• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to set proxy options from command prompt

 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ranchers,

im trying to run a java program which uses java.util.URL class , which accessing a a url, now when i compile and run this program , it throws a "UnknownHostException" , because i am behind firewall, so how to set java (-D options )options to set proxy server and port, to run it ??

thinks in advance,

regardz,
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ranchers,

i solve the problem , i find out there are two ways to make connection thru proxy !!

1) Either set the system properties thru program itself , like :


2) or , at the time of running the app , give command line options like ,

> java -DproxySet=true -DproxyHost=10.0.0.14 -DproxyPort=6588 JavApp

regardz,
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ranchers,

i solve the problem , i find out there are two ways to make connection thru proxy !!

1) Either set the system properties thru program itself , like :


2) or , at the time of running the app , give command line options like ,

> java -DproxySet=true -DproxyHost=10.0.0.14 -DproxyPort=6588 JavApp

regardz,
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ranchers,

i solve the problem , i find out there are two ways to make connection thru proxy !!

1) Either set the system properties thru program itself , like :


2) or , at the time of running the app , give command line options like ,

> java -DproxySet=true -DproxyHost=10.0.0.14 -DproxyPort=6588 JavApp

regardz,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic