1 /*
2 * Copyright (c) 1995, 2023, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
1501 } else if (JLI_StrCCmp(arg, "-splash:") == 0) {
1502 ; /* Ignore machine independent options already handled */
1503 } else if (JLI_StrCmp(arg, "--disable-@files") == 0) {
1504 ; /* Ignore --disable-@files option already handled */
1505 } else if (ProcessPlatformOption(arg)) {
1506 ; /* Processing of platform dependent options */
1507 } else {
1508 /* java.class.path set on the command line */
1509 if (JLI_StrCCmp(arg, "-Djava.class.path=") == 0) {
1510 _have_classpath = JNI_TRUE;
1511 }
1512 AddOption(arg, NULL);
1513 }
1514
1515 /*
1516 * Check for CDS option
1517 */
1518 if (JLI_StrCmp(arg, "-Xshare:dump") == 0) {
1519 dumpSharedSpaces = JNI_TRUE;
1520 }
1521 }
1522
1523 if (*pwhat == NULL && --argc >= 0) {
1524 *pwhat = *argv++;
1525 }
1526
1527 if (*pwhat == NULL) {
1528 /* LM_UNKNOWN okay for options that exit */
1529 if (!listModules && !describeModule && !validateModules && !dumpSharedSpaces) {
1530 *pret = 1;
1531 }
1532 } else if (mode == LM_UNKNOWN) {
1533 /* default to LM_CLASS if -m, -jar and -cp options are
1534 * not specified */
1535 if (!_have_classpath) {
1536 SetClassPath(".");
1537 }
1538 mode = IsSourceFile(arg) ? LM_SOURCE : LM_CLASS;
1539 } else if (mode == LM_CLASS && IsSourceFile(arg)) {
1540 /* override LM_CLASS mode if given a source file */
|
1 /*
2 * Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
1501 } else if (JLI_StrCCmp(arg, "-splash:") == 0) {
1502 ; /* Ignore machine independent options already handled */
1503 } else if (JLI_StrCmp(arg, "--disable-@files") == 0) {
1504 ; /* Ignore --disable-@files option already handled */
1505 } else if (ProcessPlatformOption(arg)) {
1506 ; /* Processing of platform dependent options */
1507 } else {
1508 /* java.class.path set on the command line */
1509 if (JLI_StrCCmp(arg, "-Djava.class.path=") == 0) {
1510 _have_classpath = JNI_TRUE;
1511 }
1512 AddOption(arg, NULL);
1513 }
1514
1515 /*
1516 * Check for CDS option
1517 */
1518 if (JLI_StrCmp(arg, "-Xshare:dump") == 0) {
1519 dumpSharedSpaces = JNI_TRUE;
1520 }
1521 if (JLI_StrCmp(arg, "-XX:AOTMode=create") == 0) {
1522 // Alias for -Xshare:dump
1523 dumpSharedSpaces = JNI_TRUE;
1524 }
1525 }
1526
1527 if (*pwhat == NULL && --argc >= 0) {
1528 *pwhat = *argv++;
1529 }
1530
1531 if (*pwhat == NULL) {
1532 /* LM_UNKNOWN okay for options that exit */
1533 if (!listModules && !describeModule && !validateModules && !dumpSharedSpaces) {
1534 *pret = 1;
1535 }
1536 } else if (mode == LM_UNKNOWN) {
1537 /* default to LM_CLASS if -m, -jar and -cp options are
1538 * not specified */
1539 if (!_have_classpath) {
1540 SetClassPath(".");
1541 }
1542 mode = IsSourceFile(arg) ? LM_SOURCE : LM_CLASS;
1543 } else if (mode == LM_CLASS && IsSourceFile(arg)) {
1544 /* override LM_CLASS mode if given a source file */
|