Launch Netscape from a java program

I used this line to launch Netscape from a java program,

Runtime.getRuntime().exec("C:/Program Files/Netscape/Program/netscape.exe");

but there is a IOException. C:/Program Files/Netscape/Program/netscape.exe is where I

have the Netscape.

Also if I want to add a file to this commande, how should I do it?

Thanks.

danfei

[379 byte] By [dshen] at [2007-9-26 1:38:20]
# 1

I use Runtime.getRuntime().exec("explorer.exe http://www.java.sun.com"); to open this webpage my default browser is IE so maybe if your browser is netscape it will launch netscape since i call the windows explorer which should redirect it to the default browser.

note the space between the command and the parameter !

Mr Mean

Mr Mean at 2007-6-29 2:26:10 > top of Java-index,Archived Forums,Swing...
# 2

Take a look at the article below. It uses the systems registered launcher for webpages (on Win32) and starts netscape on unix machines. This will make sure that your code is portable wherever u take it.

http://www.javaworld.com/javaworld/javatips/jw-javatip66.html

Hope this helps

wwe8

wwe8 at 2007-6-29 2:26:10 > top of Java-index,Archived Forums,Swing...