å¦ä½ä½¿ä¸ä¸ªjavaç¨åºï¼ä¸æ§è¡ï¼å°±æå¼æ¬å°æç®å½ä¸çhtmlæ件ï¼æ¯å¦abc.htmlï¼ å°±ååå»æå¼é£æ ·ï¼ 15
public static void main(String args[]) throws Exception
{
File file = new File("abc.html");
Runtime ce=Runtime.getRuntime();
System.out.println(file.getAbsolutePath());
ce.exec(file.getAbsolutePath());
}
åè¿æ ·ï¼æ³æå¼åç®å½ä¸çabc.htmlï¼æä¹ä¸è¡å¢ï¼
æ©ï¼ä½ çå½ä»¤ä¸æ£ç¡®ï¼æä¹ä¼æå¼å¢ï¼
è¯è¯æç»ä½ ç代ç å§
import java.io.File;
public class TestRuntime {
/**
* @param args
*/
public static void main(String args[]) throws Exception
{
File file = new File("abc.html");
Runtime ce=Runtime.getRuntime();
System.out.println(file.getAbsolutePath());
ce.exec("cmd /c start "+file.getAbsolutePath());
}
}
åªè¦å¨ä½ çåç®å½ä¸æabc.htmlï¼å°±å¯ä»¥æå¼äº