/* * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
/* * @test * @bug 4758537 4809833 8149599 8293877 * @summary Test that javac and java find files in similar ways * @library /tools/lib * @build toolbox.ToolBox Util MineField * @run main MineField
*/
/* * Converted from MineField.sh, originally written by Martin Buchholz. * * For the last version of the original, MineField.sh, see * https://git.openjdk.org/jdk/blob/jdk-19%2B36/test/langtools/tools/javac/Paths/MineField.sh * * This class primarily tests that javac and the java launcher provide * equivalent handling of all path-related options, like {@code -classpath}.
*/
/* #---------------------------------------------------------------- # The search order for classes used by both java and javac is: # # -Xbootclasspath/p:<path> # -endorseddirs <dirs> or -Djava.endorsed.dirs=<dirs> (search for jar/zip only) # -bootclasspath <path> or -Xbootclasspath:<path> # -Xbootclasspath/a:<path> # -extdirs <dirs> or -Djava.ext.dirs=<dirs> (search for jar/zip only) # -classpath <path>, -cp <path>, env CLASSPATH=<path> # # Peculiarities of the class file search: # - Empty elements of the (user) classpath default to ".", # while empty elements of other paths are ignored. # - Only for the user classpath is an empty string value equivalent to "." # - Specifying a bootclasspath on the command line obliterates any # previous -Xbootclasspath/p: or -Xbootclasspath/a: command line flags. # # JDK 9 update: # java: The java launcher does not support any of the following: # * -Xbootclasspath/p: -Xbootclasspath: # * -endorseddirs -Djava.endorsed.dirs # * -extdirs -Djava.ext.dirs # All test cases exercising these features have been removed. # javac: The following features are only supported when compiling # for older releases: # * -Xbootclasspath/p: -Xbootclasspath: -bootclasspath -Xbootclasspath/a: # * -endorseddirs -Djava.endorsed.dirs # * -extdirs -Djava.ext.dirs # All test cases exercising these features have been modified to # use -source 8 -target 8. In addition, javac test cases involving # use of the runtime properties java.endorsed.dirs and java.extdirs # (by means of -J-Dname=value) have been removed. # Although the primary purpose of the test cases in this file is to # compare javac and java behavior, some tests remain for javac for # which there is no java equivalent. However, the cases remain as useful # test cases for javac handling of the paths involved.
*/
//---------------------------------------------------------------- // Verify that javac class search order is the same as java's //----------------------------------------------------------------
//---------------------------------------------------------------- // Check behavior of empty paths and empty path elements //----------------------------------------------------------------
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.