aspose file tools*
The moose likes Java in General and the fly likes How to set proxy options from command prompt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to set proxy options from command prompt" Watch "How to set proxy options from command prompt" New topic
Author

How to set proxy options from command prompt

Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

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,


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

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

Joined: Feb 19, 2008
Posts: 2902
    
    1

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

Joined: Feb 19, 2008
Posts: 2902
    
    1

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,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set proxy options from command prompt