FileDocCategorySizeDatePackage
Main.javaAPI DocAzureus 3.0.3.42221Thu Sep 23 06:52:04 BST 2004org.gudy.azureus2.ui.swt.updater.snippets

Main

public class Main extends Object
author
Olivier Chalouhi

Fields Summary
private static String
classToStart
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    
         
        try {
        	ServerSocket server = new ServerSocket(6880, 50, InetAddress.getByName("127.0.0.1"));
          spawnStarted();
          server.close();
        } catch(Exception e) {
        	Debug.printStackTrace( e );
        }
    
public static voidspawnStarted()

        String classPath = System.getProperty("java.class.path"); //$NON-NLS-1$     
        String userPath = System.getProperty("user.dir"); //$NON-NLS-1$
        String javaPath = System.getProperty("java.home")
          + System.getProperty("file.separator")
          + "bin"
          + System.getProperty("file.separator");
                 
        
        String exec = "\"" + javaPath + "java\" -classpath \"" + classPath
        + "\" " + classToStart;
        
        
        Logger.log("Main is about to execute : " + exec);    
                        
        File userDir = new File(userPath);
        String[] env = {"user.dir=" + userPath};
        Runtime.getRuntime().exec(exec);