This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Working with Internet URL from Eclipse

 
Thirugnanam Saravanan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to execute a java Program which attempts to copy a file from internet URL to my local disk.

I am using the following code for getting connection to the URL.



My system is connected to internet through proxy server. In ECLIPSE I have entered the proxy host, proxy port, proxy authentication details in the Windows --> Preferences --> Internet --> Proxy Settings window.

But when I execute the above Code,it displays an exception java.net.UnknownHostException.

Any ideas on how to connect to Internet URL from a system which is behind the Proxy Server ?
 
Prashant Ladha
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont think configuring the proxy setting in the eclipse would work.
I think it needs to be done in your java code instead.
 
Jan Cumps
Bartender
Posts: 2602
13
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indeed.

Look at URL.openConnection(Proxy proxy).

Your Eclipse proxy settings are not used in your java code.

Regards, Jan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic