| 1 | /* |
|---|
| 2 | * Main.java |
|---|
| 3 | * |
|---|
| 4 | * Copyright (C) 1998-2003 Peter Graves |
|---|
| 5 | * $Id: Main.java,v 1.3 2003-07-04 14:25:26 piso Exp $ |
|---|
| 6 | * |
|---|
| 7 | * This program is free software; you can redistribute it and/or |
|---|
| 8 | * modify it under the terms of the GNU General Public License |
|---|
| 9 | * as published by the Free Software Foundation; either version 2 |
|---|
| 10 | * of the License, or (at your option) any later version. |
|---|
| 11 | * |
|---|
| 12 | * This program is distributed in the hope that it will be useful, |
|---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | * GNU General Public License for more details. |
|---|
| 16 | * |
|---|
| 17 | * You should have received a copy of the GNU General Public License |
|---|
| 18 | * along with this program; if not, write to the Free Software |
|---|
| 19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 20 | */ |
|---|
| 21 | |
|---|
| 22 | import java.lang.reflect.Method; |
|---|
| 23 | |
|---|
| 24 | public final class Main |
|---|
| 25 | { |
|---|
| 26 | public static void main(String[] args) |
|---|
| 27 | { |
|---|
| 28 | final String version = System.getProperty("java.version"); |
|---|
| 29 | if (version.startsWith("1.0") || version.startsWith("1.1") || |
|---|
| 30 | version.startsWith("1.2") || version.startsWith("1.3")) { |
|---|
| 31 | System.err.println(""); |
|---|
| 32 | System.err.print("J requires Java 1.4 or later."); |
|---|
| 33 | System.err.println(" (Java 1.4.2 is recommended.)"); |
|---|
| 34 | System.err.println(""); |
|---|
| 35 | System.exit(1); |
|---|
| 36 | } |
|---|
| 37 | try { |
|---|
| 38 | Class c = Class.forName("org.armedbear.j.Editor"); |
|---|
| 39 | Class[] parameterTypes = new Class[1]; |
|---|
| 40 | parameterTypes[0] = String[].class; |
|---|
| 41 | Method method = c.getMethod("main", parameterTypes); |
|---|
| 42 | Object[] parameters = new Object[1]; |
|---|
| 43 | parameters[0] = args; |
|---|
| 44 | method.invoke(null, parameters); |
|---|
| 45 | } |
|---|
| 46 | catch (Exception e) { |
|---|
| 47 | e.printStackTrace(); |
|---|
| 48 | } |
|---|
| 49 | } |
|---|
| 50 | } |
|---|