• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to set proxy options from command prompt

 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 2908
1
Spring Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic