image from url to file


I tried below example.

When i run the example I do not see any output. How to fix this issue.

please advise
Any links resources ideas highly appreciated. Thanks in advance
Who is Participating?
mccarlConnect With a Mentor IT Business Systems Analyst / Software DeveloperCommented:
I do not see jpg file being created
Right-click on your Project in Eclipse and select Refresh (or alternatively, select the project and hit F5) and then the file should show up. It will be towards the bottom of the list of files under you project, ie. it would be further down the screen than the part that you show in that screenshot.
Ken ButtersConnect With a Mentor Commented:
recreated example from your URL

into a test java application

attached screenshot to show where jpg file is created and stored.
CPColinConnect With a Mentor Senior Java ArchitectCommented:
Judging by the code, nothing is supposed to be printed to the console; the only output is to the image.jpg file. Have you searched around and tried to open that file?
Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

gudii9Author Commented:
I do not see image.jpg.

Actully i see now below error

Exception in thread "main" Connection timed out: connect
      at Method)

I think i need to try from home laptop once i reach home instead. Not sure why Connection Timed out error coming.
Ken ButtersCommented:
Could be a firewall issue.

You may be blocked from :
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Or possibly a proxy issue, if you can navigate to these sites from your browser ok but your Java apps fail then it is likely that you can only get to the Internet via a proxy. So yes, try from home and see how you go.
gudii9Author Commented:
i tried from home laptop. I do not see jpg file being created. please advise
CPColinSenior Java ArchitectCommented:
Eclipse probably wouldn't show it immediately. Have you used the Search tool that Windows has to try to find image.jpg?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.