01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: *
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: /**
20: * @author Vasily Zakharov
21: * @version $Revision: 1.1.2.5 $
22: */package org.apache.harmony.rmi.compiler;
23:
24: import org.apache.harmony.rmi.internal.nls.Messages;
25:
26: /**
27: * Launcher engine for RMI Compiler.
28: *
29: * @author Vasily Zakharov
30: * @version $Revision: 1.1.2.5 $
31: */
32: public final class Main implements RmicConstants {
33:
34: /**
35: * Command line startup method for RMI Compiler.
36: *
37: * @param args
38: * Command line arguments.
39: */
40: public static void main(String[] args) {
41: try {
42: new RMICompiler(args).run();
43: } catch (RMICompilerException e) {
44: String message = e.getMessage();
45:
46: if ((message != null) && message.startsWith(EOLN)) {
47: System.out.println(message);
48: } else {
49: // rmi.console.18=RMIC Error: {0}
50: System.out.println(Messages.getString("rmi.console.18", //$NON-NLS-1$
51: ((message != null) ? message : ""))); //$NON-NLS-1$
52: e.printStackTrace(System.out);
53: System.exit(-1);
54: }
55: } catch (Throwable e) {
56: // rmi.console.19=RMIC Error: Unexpected exception:{0}
57: System.out.println(Messages.getString("rmi.console.19", e)); //$NON-NLS-1$
58: e.printStackTrace(System.out);
59: System.exit(-1);
60: }
61: }
62: }
|