KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > Main


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans;
21
22 import java.util.ResourceBundle JavaDoc;
23 import javax.swing.JOptionPane JavaDoc;
24
25 /** Bootstrap main class.
26  * @author Jaroslav Tulach, Jesse Glick
27  */

28 public final class Main extends Object JavaDoc {
29     private Main() {
30     }
31
32     /** Starts the NetBeans system.
33      * @param args the command line arguments
34      * @throws Exception for lots of reasons
35      */

36     public static void main (String JavaDoc args[]) throws Exception JavaDoc {
37         // following code has to execute without java5 - e.g. do not use
38
// NbBundle or any other library compiled against java5 only
39
// also prevent usage of java5 methods and classes
40
try {
41             Class.forName("java.lang.StringBuilder"); // NOI18N
42
} catch (ClassNotFoundException JavaDoc ex) {
43             JOptionPane.showMessageDialog(
44                 null,
45                 ResourceBundle.getBundle("org.netbeans.Bundle").getString("MSG_InstallJava5"),
46                 ResourceBundle.getBundle("org.netbeans.Bundle").getString("MSG_NeedsJava5"),
47                 JOptionPane.WARNING_MESSAGE
48             );
49             System.exit(10);
50         }
51         // end of java5 only code
52

53         MainImpl.main(args);
54     }
55     
56     /** Returns string describing usage of the system. Does that by talking to
57      * all registered handlers and asking them to show their usage.
58      *
59      * @return the usage string for the system
60      */

61     public static String JavaDoc usage () throws Exception JavaDoc {
62         return MainImpl.usage();
63     }
64         
65     
66     /**
67      * Call when the system is up and running, to complete handling of
68      * delayed command-line options like -open FILE.
69      */

70     public static void finishInitialization() {
71         MainImpl.finishInitialization();
72     }
73 }
74
Popular Tags