campbell@queeg:~$ firefox --h
Usage: /usr/lib/firefox-3.0.13/firefox [ options ... ] [URL]
where options include:
X11 options
--display=DISPLAY X display to use
--sync Make X calls synchronous
--no-xshm Don't use X shared memory extension
--xim-preedit=STYLE
--xim-status=STYLE
--g-fatal-warnings Make all warnings fatal
Mozilla options
-height <value> Set height of startup window to <value>.
-h or -help Print this message.
-width <value> Set width of startup window to <value>.
-v or -version Print Firefox version.
-P <profile> Start with <profile>.
-ProfileManager Start with ProfileManager.
-no-remote Open new instance, not a new window in running instance.
-UILocale <locale> Start with <locale> resources as UI Locale.
-safe-mode Disables extensions and themes for this session.
-jsconsole Open the Error console.
campbell@queeg:~$
campbell@queeg:~$ firefox http://www.javaranch.com
campbell@queeg:~$
. . . and a JavaRanch tab opened. I don't know whether it is possible to provide a user name too. Beware: if you put your password in an unencrypted file, it is at risk of hacking.
You would need to start a Process with Runtime.exec(). Before doing that, be sure to read Michael Daconta's article "
when Runtime.exec() won't".