if (strncmp(str, "-Xss", 4) == 0) {
jlong tmp;
if (parse_stack_size(str + 4, &tmp)) {
threadStackSize = tmp;
}
}
}
static void
SetClassPath(const char *s)
{
char *def;
s = JLI_WildcardExpandClasspath(s);
def = JLI_MemAlloc(strlen(s) + 40);
sprintf(def, "-Djava.class.path=%s", s);
AddOption(def, NULL);
}
/*
* The SelectVersion() routine ensures that an appropriate version of
* the JRE is running. The specification for the appropriate version
* is obtained from either the manifest of a jar file (preferred) or
* from command line options.
* The routine also parses splash screen command line options and
* passes on their values in private environment variables.
*/
static void
SelectVersion(int argc, char **argv, char **main_class)
{
char *arg;
char **new_argv;
char **new_argp;
char *operand;
char *version = NULL;
char *jre = NULL;
int jarflag = 0;
int headlessflag = 0;
int restrict_search = -1; /* -1 implies not known */
manifest_info info;
char env_entry[MAXNAMELEN + 24] = ENV_ENTRY "=";
char *splash_file_name = NULL;
char *splash_jar_name = NULL;
char *env_in;
int res;
/*
* If the version has already been selected, set *main_class
* with the value passed through the environment (if any) and
* simply return.
*/
if ((env_in = getenv(ENV_ENTRY)) != NULL) {
if (*env_in != '\0')
*main_class = JLI_StringDup(env_in);
return;
}
/*
* Scan through the arguments for options relevant to multiple JRE
* support. For reference, the command line syntax is defined as:
*
* SYNOPSIS
* java [options] class [argument...]
*
* java [options] -jar file.jar [argument...]
*
* As the scan is performed, make a copy of the argument list with
* the version specification options (new to 1.5) removed, so that
* a version less than 1.5 can be exec'd.
*
* Note that due to the syntax of the native Windows interface
* CreateProcess(), processing similar to the following exists in
* the Windows platform specific routine ExecJRE (in java_md.c).
* Changes here should be reproduced there.
*/
new_argv = JLI_MemAlloc((argc + 1) * sizeof(char*));
new_argv[0] = argv[0];
new_argp = &new_argv[1];
argc--;
argv++;
while ((arg = *argv) != 0 && *arg == '-') {
if (strncmp(arg, "-version:", 9) == 0) {
version = arg + 9;
} else if (strcmp(arg, "-jre-restrict-search") == 0) {
restrict_search = 1;
} else if (strcmp(arg, "-no-jre-restrict-search") == 0) {
restrict_search = 0;
} else {
if (strcmp(arg, "-jar") == 0)
jarflag = 1;
/* deal with "unfortunate" classpath syntax */
if ((strcmp(arg, "-classpath") == 0 || strcmp(arg, "-cp") == 0) &&
(argc >= 2)) {
*new_argp++ = arg;
argc--;
argv++;
arg = *argv;
}
/*
=9= |