This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] make gij command-line compatible with java


Hi,

This patch makes gij command-line compatible with Sun's java command.
In many cases I haven't wired in support for the new options, but at
least gij will accept the same set of options as the java command.  This
is important as we've found with java-gcj-compat that may applications
rely on java's command-line syntax.  I've incorporated all the
workarounds we were maintaining in java-gcj-compat's java wrapper script
into the gij command itself, which should allow us remove the wrapper
and symlink java to gij directly.

By handling classpath using only the invocation API and setting
java.class.path appropriately I was able to remove the global
_Jv_Jar_Class_Path variable.

OK for mainline and gcc-4_0-branch?

Tom

2005-03-31  Thomas Fitzsimmons  <fitzsim@redhat.com>

	PR libgcj/20090, PR libgcj/20526
	* gij.cc (nonstandard_opts_help): New function.
	(add_option): New function.
	(main): Support java options.  Set java.class.path.  Don't set
	_Jv_Jar_Class_Path.
	* prims.cc (parse_x_arg): New function.
	(parse_init_args): Call parse_x_arg for -X and _ options, when
	ignoreUnrecognized is true.
	(new _Jv_RunMain): New vm_args variant.
	(old _Jv_RunMain): Call new vm_args _Jv_RunMain.
	(_Jv_Jar_Class_Path): Remove variable.
	* include/java-props.h: Likewise.
	* include/cni.h (JvRealloc): New function.
	* include/jvm.h (_Jv_RunMain): Declare vm_args variant.
	* java/lang/natRuntime.cc (insertSystemProperties): Remove
	_Jv_Jar_Class_Path logic.

Index: gij.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gij.cc,v
retrieving revision 1.25
diff -u -r1.25 gij.cc
--- gij.cc	18 Feb 2005 20:52:14 -0000	1.25
+++ gij.cc	31 Mar 2005 20:43:28 -0000
@@ -1,26 +1,20 @@
-/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004  Free Software Foundation
+/* Copyright (C) 1999-2005  Free Software Foundation
 
    This file is part of libgcj.
 
-This software is copyrighted work licensed under the terms of the
-Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
-details.  */
-
-/* Author: Kresten Krab Thorup <krab@gnu.org>  */
+   This software is copyrighted work licensed under the terms of the
+   Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+   details. */
 
 #include <config.h>
 
 #include <jvm.h>
 #include <gcj/cni.h>
-#include <java-props.h>
 
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 
-#include <java/lang/System.h>
-#include <java/util/Properties.h>
-
 static void
 help ()
 {
@@ -46,105 +40,264 @@
 static void
 version ()
 {
+  printf ("java version \"1.4.2\"\n");
   printf ("gij (GNU libgcj) version %s\n\n", __VERSION__);
   printf ("Copyright (C) 2005 Free Software Foundation, Inc.\n");
   printf ("This is free software; see the source for copying conditions.  There is NO\n");
   printf ("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
 }
 
+static void
+nonstandard_opts_help ()
+{
+  printf ("  -Xms<size>         set initial heap size\n");
+  printf ("  -Xmx<size>         set maximum heap size\n");
+  exit (0);
+}
+
+static void
+add_option (JvVMInitArgs& vm_args, char const* option, void const* extra)
+{
+  vm_args.options =
+    (JvVMOption*) JvRealloc (vm_args.options,
+                             (vm_args.nOptions + 1) * sizeof (JvVMOption));
+
+  vm_args.options[vm_args.nOptions].optionString = const_cast<char*> (option);
+  vm_args.options[vm_args.nOptions].extraInfo = const_cast<void*> (extra);
+  ++vm_args.nOptions;
+}
+
 int
-main (int argc, const char **argv)
+main (int argc, char const** argv)
 {
-  /* We rearrange ARGV so that all the -D options appear near the
-     beginning.  */
-  int last_D_option = 0;
+  JvVMInitArgs vm_args;
   bool jar_mode = false;
 
+  vm_args.options = NULL;
+  vm_args.nOptions = 0;
+  vm_args.ignoreUnrecognized = true;
+
+  // Command-line options always override the CLASSPATH environment
+  // variable.
+  char *classpath = getenv("CLASSPATH");
+
+  if (classpath)
+    {
+      char* darg = (char*) JvMalloc ((strlen (classpath)
+                                      + sizeof ("-Djava.class.path="))
+                                     * sizeof (char));
+      sprintf (darg, "-Djava.class.path=%s", classpath);
+      add_option (vm_args, darg, NULL);
+    }
+
+  // Handle arguments to the java command.  Store in vm_args arguments
+  // handled by the invocation API.
   int i;
   for (i = 1; i < argc; ++i)
     {
-      const char *arg = argv[i];
+      char* arg = const_cast<char*> (argv[i]);
 
-      /* A non-option stops processing.  */
+      // A non-option stops processing.
       if (arg[0] != '-')
 	break;
-      /* A "--" stops processing.  */
+
+      // A "--" stops processing.
       if (! strcmp (arg, "--"))
 	{
 	  ++i;
 	  break;
 	}
 
-      if (! strncmp (arg, "-D", 2))
-	{
-	  argv[last_D_option++] = arg + 2;
-	  continue;
-	}
-
-      if (! strcmp (arg, "-jar"))
-	{
-	  jar_mode = true;
-	  continue;
-	}
-
-      /* Allow both single or double hyphen for all remaining
-	 options.  */
+      // Allow both single or double hyphen for all options.
       if (arg[1] == '-')
 	++arg;
 
-      if (! strcmp (arg, "-help") || ! strcmp (arg, "-?"))
-	help ();
-      else if (! strcmp (arg, "-version"))
-	{
-	  version ();
-	  exit (0);
-	}
-      else if (! strcmp (arg, "-showversion"))
-	version ();
-      /* FIXME: use getopt and avoid the ugliness here.
-	 We at least need to handle the argument in a better way.  */
-      else if (! strncmp (arg, "-ms=", 4))
-	_Jv_SetInitialHeapSize (arg + 4);
-      else if (! strcmp (arg, "-ms"))
-	{
-	  if (i >= argc - 1)
-	    {
+      if (! strcmp (arg, "-client"))
+        continue;
+      else if (! strcmp (arg, "-server"))
+        continue;
+      else if (! strcmp (arg, "-hotspot"))
+        continue;
+      else if (! strcmp (arg, "-jrockit"))
+        continue;
+      else if (! strncmp (arg, "-agentlib:", sizeof ("-agentlib:") - 1))
+        continue;
+      else if (! strncmp (arg, "-agentpath:", sizeof ("-agentpath:") - 1))
+        continue;
+      else if (! strcmp (arg, "-classpath") || ! strcmp (arg, "-cp"))
+        {
+          if (i >= argc - 1)
+            {
 	    no_arg:
 	      fprintf (stderr, "gij: option requires an argument -- `%s'\n",
 		       argv[i]);
 	      fprintf (stderr, "Try `gij --help' for more information.\n");
 	      exit (1);
-	    }
-	  _Jv_SetInitialHeapSize (argv[++i]);
+            }
+
+          // Sun seems to translate the -classpath option into
+          // -Djava.class.path because if both -classpath and
+          // -Djava.class.path are specified on the java command line,
+          // the last one always wins.
+          char* darg = (char*) JvMalloc ((strlen (argv[++i])
+                                          + sizeof ("-Djava.class.path="))
+                                         * sizeof (char));
+          sprintf (darg, "-Djava.class.path=%s", argv[i]);
+          add_option (vm_args, darg, NULL);
+        }
+      else if (! strcmp (arg, "-debug"))
+        {
+          char* xarg = strdup ("-Xdebug");
+          add_option (vm_args, xarg, NULL);
+        }
+      else if (! strncmp (arg, "-D", sizeof ("-D") - 1))
+        add_option (vm_args, arg, NULL);
+      else if (! strcmp (arg, "-d32") || ! strcmp (arg, "-d64"))
+        continue;
+      else if (! strcmp (arg, "-enableassertions") || ! strcmp (arg, "-ea"))
+        {
+          if (i >= argc - 1)
+            goto no_arg;
+          // FIXME: hook up assertion support
+          ++i;
+          continue;
+        }
+      else if (! strcmp (arg, "-disableassertions") || ! strcmp (arg, "-da"))
+        {
+          if (i >= argc - 1)
+            goto no_arg;
+          // FIXME
+          ++i;
+          continue;
+        }
+      else if (! strcmp (arg, "-enablesystemassertions")
+               || ! strcmp (arg, "-esa"))
+        {
+          // FIXME: hook up system assertion support
+          continue;
+        }
+      else if (! strcmp (arg, "-disablesystemassertions")
+               || ! strcmp (arg, "-dsa"))
+        {
+          // FIXME
+          continue;
+        }
+      else if (! strcmp (arg, "-jar"))
+	{
+	  jar_mode = true;
+	  continue;
+	}
+      else if (! strncmp (arg, "-javaagent:", sizeof ("-javaagent:") - 1))
+        continue;
+      else if (! strcmp (arg, "-noclassgc"))
+        {
+          char* xarg = strdup ("-Xnoclassgc");
+          add_option (vm_args, xarg, NULL);
+        }
+      // -ms=n
+      else if (! strncmp (arg, "-ms=", sizeof ("-ms=") - 1))
+        {
+          arg[1] = 'X';
+          arg[2] = 'm';
+          arg[3] = 's';
+          add_option (vm_args, arg, NULL);
+        }
+      // -ms n
+      else if (! strcmp (arg, "-ms"))
+	{
+	  if (i >= argc - 1)
+            goto no_arg;
+
+          char* xarg = (char*) JvMalloc ((strlen (argv[++i])
+                                          + sizeof ("-Xms"))
+                                         * sizeof (char));
+          sprintf (xarg, "-Xms%s", argv[i]);
+          add_option (vm_args, xarg, NULL);
 	}
-      else if (! strncmp (arg, "-mx=", 4))
-	_Jv_SetMaximumHeapSize (arg + 4);
+      // -msn
+      else if (! strncmp (arg, "-ms", sizeof ("-ms") - 1))
+	{
+          char* xarg = (char*) JvMalloc ((strlen (arg) + sizeof ("X"))
+                                         * sizeof (char));
+          sprintf (xarg, "-Xms%s", arg + sizeof ("-Xms") - 1);
+          add_option (vm_args, xarg, NULL);
+	}
+      // -mx=n
+      else if (! strncmp (arg, "-mx=", sizeof ("-mx=") - 1))
+        {
+          arg[1] = 'X';
+          arg[2] = 'm';
+          arg[3] = 'x';
+          add_option (vm_args, arg, NULL);
+        }
+      // -mx n
       else if (! strcmp (arg, "-mx"))
 	{
 	  if (i >= argc - 1)
-	    goto no_arg;
-	  _Jv_SetMaximumHeapSize (argv[++i]);
+            goto no_arg;
+
+          char* xarg = (char*) JvMalloc ((strlen (argv[++i]) + sizeof ("-Xmx"))
+                                         * sizeof (char));
+          sprintf (xarg, "-Xmx%s", argv[i]);
+          add_option (vm_args, xarg, NULL);
 	}
-      else if (! strcmp (arg, "-cp") || ! strcmp (arg, "-classpath"))
+      // -mxn
+      else if (! strncmp (arg, "-mx", sizeof ("-mx") - 1))
+	{
+          char* xarg = (char*) JvMalloc ((strlen (arg) + sizeof ("X"))
+                                         * sizeof (char));
+          sprintf (xarg, "-Xmx%s", arg + sizeof ("-Xmx") - 1);
+          add_option (vm_args, xarg, NULL);
+	}
+      // -ss=n
+      else if (! strncmp (arg, "-ss=", sizeof ("-ss=") - 1))
+        {
+          arg[1] = 'X';
+          arg[2] = 's';
+          arg[3] = 's';
+          add_option (vm_args, arg, NULL);
+        }
+      // -ss n
+      else if (! strcmp (arg, "-ss"))
 	{
 	  if (i >= argc - 1)
-	    goto no_arg;
-	  // We set _Jv_Jar_Class_Path.  If the user specified `-jar'
-	  // then the jar code will override this.  This is the
-	  // correct behavior.
-	  _Jv_Jar_Class_Path = argv[++i];
-	}
-      else if (! strcmp (arg, "-verbose") || ! strcmp (arg, "-verbose:class"))
-	gcj::verbose_class_flag = true;
-      else if (arg[1] == 'X')
-	{
-	  if (arg[2] == '\0')
-	    {
-	      printf ("gij: currently no -X options are recognized\n");
-	      exit (0);
-	    }
-	  /* Ignore other -X options.  */
+            goto no_arg;
+
+          char* xarg = (char*) JvMalloc ((strlen (argv[++i]) + sizeof ("-Xss"))
+                                         * sizeof (char));
+          sprintf (xarg, "-Xss%s", argv[i]);
+          add_option (vm_args, xarg, NULL);
+	}
+      // -ssn
+      else if (! strncmp (arg, "-ss", sizeof ("-ss") - 1))
+	{
+          char* xarg = (char*) JvMalloc ((strlen (arg) + sizeof ("X"))
+                                         * sizeof (char));
+          sprintf (xarg, "-Xss%s", arg + sizeof ("-Xss") - 1);
+          add_option (vm_args, xarg, NULL);
 	}
+      // This handles all the option variants that begin with
+      // -verbose.
+      else if (! strncmp (arg, "-verbose", 8))
+        add_option (vm_args, arg, NULL);
+      else if (! strcmp (arg, "-version"))
+	{
+	  version ();
+	  exit (0);
+	}
+      else if (! strcmp (arg, "-fullversion"))
+        {
+          printf ("java full version \"gcj-1.4.2\"\n");
+          exit (0);
+        }
+      else if (! strcmp (arg, "-showversion"))
+        version ();
+      else if (! strcmp (arg, "-help") || ! strcmp (arg, "-?"))
+	help ();
+      else if (! strcmp (arg, "-X"))
+        nonstandard_opts_help ();
+      else if (! strncmp (arg, "-X", 2))
+        add_option (vm_args, arg, NULL);
       else
 	{
 	  fprintf (stderr, "gij: unrecognized option -- `%s'\n", argv[i]);
@@ -153,9 +306,6 @@
 	}
     }
 
-  argv[last_D_option] = NULL;
-  _Jv_Compiler_Properties = argv;
-
   if (argc - i < 1)
     {
       fprintf (stderr, "Usage: gij [OPTION] ... CLASS [ARGS] ...\n");
@@ -166,5 +316,17 @@
       exit (1);
     }
 
-  _Jv_RunMain (NULL, argv[i], argc - i, argv + i, jar_mode);
+  // -jar mode overrides all other modes of specifying class path:
+  // -CLASSPATH, -Djava.class.path, -classpath and -cp.
+  if (jar_mode)
+    {
+      char* darg = (char*) JvMalloc ((strlen (argv[i])
+                                      + sizeof ("-Djava.class.path="))
+                                     * sizeof (char));
+      sprintf (darg, "-Djava.class.path=%s", argv[i]);
+      add_option (vm_args, darg, NULL);
+    }
+
+  _Jv_RunMain (&vm_args, NULL, argv[i], argc - i,
+               (char const**) (argv + i), jar_mode);
 }
Index: prims.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/prims.cc,v
retrieving revision 1.106
diff -u -r1.106 prims.cc
--- prims.cc	24 Mar 2005 00:04:02 -0000	1.106
+++ prims.cc	31 Mar 2005 20:43:28 -0000
@@ -85,9 +85,6 @@
 const char **_Jv_Compiler_Properties = NULL;
 int _Jv_Properties_Count = 0;
 
-// The JAR file to add to the beginning of java.class.path.
-const char *_Jv_Jar_Class_Path;
-
 #ifndef DISABLE_GETENV_PROPERTIES
 // Property key/value pairs.
 property_pair *_Jv_Environment_Properties;
@@ -910,8 +907,113 @@
 }
 
 static jint
+parse_x_arg (char* option_string)
+{
+  if (strlen (option_string) <= 0)
+    return -1;
+
+  if (! strcmp (option_string, "int"))
+    {
+      /* FIXME: this should cause the vm to never load shared
+         objects */
+    }
+  else if (! strcmp (option_string, "mixed"))
+    {
+      /* FIXME: allow interpreted and native code */
+    }
+  else if (! strcmp (option_string, "batch"))
+    {
+      /* FIXME: disable background JIT'ing */
+    }
+  else if (! strcmp (option_string, "debug"))
+    {
+      /* FIXME: add JDWP/JVMDI support */
+    }
+  else if (! strncmp (option_string, "bootclasspath:", 14))
+    {
+      /* FIXME: add a parse_bootclasspath_arg function */
+    }
+  else if (! strncmp (option_string, "bootclasspath/a:", 16))
+    {
+    }
+  else if (! strncmp (option_string, "bootclasspath/p:", 16))
+    {
+    }
+  else if (! strcmp (option_string, "check:jni"))
+    {
+      /* FIXME: enable strict JNI checking */
+    }
+  else if (! strcmp (option_string, "future"))
+    {
+      /* FIXME: enable strict class file format checks */
+    }
+  else if (! strcmp (option_string, "noclassgc"))
+    {
+      /* FIXME: disable garbage collection for classes */
+    }
+  else if (! strcmp (option_string, "incgc"))
+    {
+      /* FIXME: incremental garbage collection */
+    }
+  else if (! strncmp (option_string, "loggc:", 6))
+    {
+      if (option_string[6] == '\0')
+        {
+          fprintf (stderr,
+                   "libgcj: filename argument expected for loggc option\n");
+          return -1;
+        }
+      /* FIXME: set gc logging filename */
+    }
+  else if (! strncmp (option_string, "ms", 2))
+    {
+      /* FIXME: ignore this option until PR 20699 is fixed. */
+      /* _Jv_SetInitialHeapSize (option_string + 2); */
+    }
+  else if (! strncmp (option_string, "mx", 2))
+    _Jv_SetMaximumHeapSize (option_string + 2);
+  else if (! strcmp (option_string, "prof"))
+    {
+      /* FIXME: enable profiling of program running in vm */
+    }
+  else if (! strncmp (option_string, "runhprof:", 9))
+    {
+      /* FIXME: enable specific type of vm profiling.  add a
+         parse_runhprof_arg function */
+    }
+  else if (! strcmp (option_string, "rs"))
+    {
+      /* FIXME: reduced system signal usage.  disable thread dumps,
+         only terminate in response to user-initiated calls,
+         e.g. System.exit() */
+    }
+  else if (! strncmp (option_string, "ss", 2))
+    {
+      /* FIXME: set thread stack size */
+    }
+  else if (! strcmp (option_string, "X:+UseAltSigs"))
+    {
+      /* FIXME: use signals other than SIGUSR1 and SIGUSR2 */
+    }
+  else if (! strcmp (option_string, "share:off"))
+    {
+      /* FIXME: don't share class data */
+    }
+  else if (! strcmp (option_string, "share:auto"))
+    {
+      /* FIXME: share class data where possible */
+    }
+  else if (! strcmp (option_string, "share:on"))
+    {
+      /* FIXME: fail if impossible to share class data */
+    }
+
+  return 0;
+}
+
+static jint
 parse_verbose_args (char* option_string,
-		    bool ignore_unrecognized)
+                    bool ignore_unrecognized)
 {
   size_t len = sizeof ("-verbose");
 
@@ -1045,7 +1147,7 @@
 			  "-verbose", sizeof ("-verbose") - 1))
 	{
 	  jint result = parse_verbose_args (option_string,
-					    vm_args->ignoreUnrecognized);
+                                            vm_args->ignoreUnrecognized);
 	  if (result < 0)
 	    return result;
 	}
@@ -1061,11 +1163,20 @@
 	  continue;
 	}
       else if (vm_args->ignoreUnrecognized)
-	{
-	  if (option_string[0] == '_'
-	      || ! strncmp (option_string, "-X", 2))
-	    continue;
+        {
+          if (option_string[0] == '_')
+            parse_x_arg (option_string + 1);
+          else if (! strncmp (option_string, "-X", 2))
+            parse_x_arg (option_string + 2);
+          else
+            {
+            unknown_option:
+              fprintf (stderr, "libgcj: unknown option: %s\n", option_string);
+              return -1;
+            }
 	}
+      else
+        goto unknown_option;
     }
   return 0;
 }
@@ -1167,8 +1278,8 @@
 }
 
 void
-_Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, 
-	     bool is_jar)
+_Jv_RunMain (JvVMInitArgs *vm_args, jclass klass, const char *name, int argc,
+             const char **argv, bool is_jar)
 {
 #ifndef DISABLE_MAIN_ARGS
   _Jv_SetArgs (argc, argv);
@@ -1178,12 +1289,7 @@
 
   try
     {
-      // Set this very early so that it is seen when java.lang.System
-      // is initialized.
-      if (is_jar)
-	_Jv_Jar_Class_Path = strdup (name);
-
-      if (_Jv_CreateJavaVM (NULL) < 0)
+      if (_Jv_CreateJavaVM (vm_args) < 0)
 	{
 	  fprintf (stderr, "libgcj: couldn't create virtual machine\n");
 	  exit (1);
@@ -1226,6 +1332,13 @@
 }
 
 void
+_Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, 
+	     bool is_jar)
+{
+  _Jv_RunMain (NULL, klass, name, argc, argv, is_jar);
+}
+
+void
 JvRunMain (jclass klass, int argc, const char **argv)
 {
   _Jv_RunMain (klass, NULL, argc, argv, false);
Index: gcj/cni.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gcj/cni.h,v
retrieving revision 1.15
diff -u -r1.15 cni.h
--- gcj/cni.h	23 Feb 2005 17:36:24 -0000	1.15
+++ gcj/cni.h	31 Mar 2005 20:43:36 -0000
@@ -108,6 +108,12 @@
   return _Jv_Malloc (size);
 }
 
+extern inline void *
+JvRealloc (void *ptr, jsize size)
+{
+  return _Jv_Realloc (ptr, size);
+}
+
 extern inline void
 JvFree (void *ptr)
 {
Index: include/java-props.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/java-props.h,v
retrieving revision 1.8
diff -u -r1.8 java-props.h
--- include/java-props.h	23 Feb 2005 17:36:24 -0000	1.8
+++ include/java-props.h	31 Mar 2005 20:43:47 -0000
@@ -23,9 +23,6 @@
 extern const char **_Jv_Compiler_Properties;
 extern int _Jv_Properties_Count;
 
-// The JAR file to add to the beginning of java.class.path.
-extern const char *_Jv_Jar_Class_Path;
-
 // Properties taken from the user's environment.
 extern property_pair *_Jv_Environment_Properties;
 
Index: include/jvm.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/jvm.h,v
retrieving revision 1.81
diff -u -r1.81 jvm.h
--- include/jvm.h	23 Mar 2005 20:27:12 -0000	1.81
+++ include/jvm.h	31 Mar 2005 20:43:47 -0000
@@ -360,6 +360,9 @@
 void _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, 
 		  bool is_jar);
 
+void _Jv_RunMain (struct _Jv_VMInitArgs *vm_args, jclass klass,
+                  const char *name, int argc, const char **argv, bool is_jar);
+
 // Delayed until after _Jv_AllocBytes is declared.
 //
 // Note that we allocate this as unscanned memory -- the vtables
Index: java/lang/natRuntime.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natRuntime.cc,v
retrieving revision 1.51
diff -u -r1.51 natRuntime.cc
--- java/lang/natRuntime.cc	11 Mar 2005 17:35:37 -0000	1.51
+++ java/lang/natRuntime.cc	31 Mar 2005 20:43:47 -0000
@@ -564,30 +564,6 @@
     }
 #endif
 
-  if (_Jv_Jar_Class_Path)
-    newprops->put(JvNewStringLatin1 ("java.class.path"),
- 		  JvNewStringLatin1 (_Jv_Jar_Class_Path));
-  else
-    {
-      // FIXME: find libgcj.zip and append its path?
-      char *classpath = ::getenv("CLASSPATH");
-      jstring cp = newprops->getProperty (JvNewStringLatin1("java.class.path"));
-      java::lang::StringBuffer *sb = new java::lang::StringBuffer ();
-      
-      if (classpath)
-	{
-	  sb->append (JvNewStringLatin1 (classpath));
-	  sb->append (_Jv_platform_path_separator);
-	}
-      if (cp != NULL)
-	sb->append (cp);
-      else
-	sb->append ((jchar) '.');
-      
-      newprops->put(JvNewStringLatin1 ("java.class.path"),
-		      sb->toString ());
-    }
-
   // The name used to invoke this process (argv[0] in C).
   SET ("gnu.gcj.progname", _Jv_GetSafeArg (0));
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]