Questo esempio ti lancia il browser predefinito puntando all'url specificato:


Codice PHP:
import java.io.IOException;

public class 
BrowserControl{

     
// Usato per identificare Windows
     
private static final String WIN_ID "Windows";
     
// Il browser predefinito sotto windows
     
private static final String WIN_PATH "rundll32";
     
// Flag per mostrare l'url
     
private static final String WIN_FLAG "url.dll,FileProtocolHandler";
     
     
// Il browser predefinito sotto Unix
     
private static final String UNIX_PATH "netscape";
     
// Flag per mostrare l'url
     
private static final String UNIX_FLAG "-remote openURL";

     public static 
void displayURL(String url){
          
boolean windows isWindowsPlatform();
          
String cmd null;
          try{
               if (
windows){
                    
cmd WIN_PATH " " WIN_FLAG " " url;
                    
Process p Runtime.getRuntime().exec(cmd);
               }else{
                    
cmd UNIX_PATH " " UNIX_FLAG "(" url ")";
                    
Process p Runtime.getRuntime().exec(cmd);
                    try{
                         
// Attende per il codice di ritorno. Se è 0 il comando ha funzionato correttamente, altrimenti avvia il browser
                         
int exitCode p.waitFor();
                         if (
exitCode != 0){
                              
// Comando fallito, avvia il browser
                              
cmd UNIX_PATH " "  url;
                              
Runtime.getRuntime().exec(cmd);
                         }
                    }catch(
InterruptedException x){
                         
System.err.println("Errore nell'esecuzione del comando:" cmd);
                         
System.err.println("Eccezione: " x);
                    }
               }
          }catch(
IOException x){
               
System.err.println("Impossibiler aprire il browser, command=" cmd);
               
System.err.println("Caught: " x);
          }
     }
    
     public static 
boolean isWindowsPlatform(){
          
String os System.getProperty("os.name");
          if ( 
os != null && os.startsWith(WIN_ID))
               return 
true;
          else
               return 
false;
     }

     public static 
void main(String[] args){
          
displayURL("http://www.html.it");
          
displayURL("file://c:\\cartella\\index.html");
          
displayURL("file:///user/mioUser/index.html"); 

     }

Spero di aver capito cosa cercavi