By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,237 Members | 1,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,237 IT Pros & Developers. It's quick & easy.

How to redirect to URL in Java?

P: 2
hello everyone ,

Can anyone please tell me how to redirect to URL from a Java class 'not a servlet'.

I mean lets say when you execute a java application it automatically opens the browser and redirect you to a specific URL.

Looking forward to hearing from you soon!

thanks in advance,

Sincerely,
Mar 1 '12 #1
Share this Question
Share on Google+
1 Reply


10K+
P: 13,264
You can use the Desktop class
Expand|Select|Wrap|Line Numbers
  1. Desktop.getDesktop().browse(new URI("www.google.com"));
Mar 2 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.