diff --git a/.github/workflows/submit.yml b/.github/workflows/submit.yml index 83a8c98a30d..b0a4e7b952e 100644 --- a/.github/workflows/submit.yml +++ b/.github/workflows/submit.yml @@ -277,7 +277,7 @@ jobs: run: > if cat test-results/testoutput/*/exitcode.txt | grep -q -v '^0$' || ! cat test-results/testoutput/*/Stats.txt | grep -q 'fail=0' ; then - cat test-results/testoutput/*/JTreport/text/newfailures.txt ; + cat test-results/testoutput/*/JTreport/text/{newfailures,other_errors}.txt ; exit 1 ; fi @@ -638,7 +638,7 @@ jobs: run: > if cat test-results/testoutput/*/exitcode.txt | grep -q -v '^0$' || ! cat test-results/testoutput/*/Stats.txt | grep -q 'fail=0' ; then - cat test-results/testoutput/*/JTreport/text/newfailures.txt ; + cat test-results/testoutput/*/JTreport/text/{newfailures,other_errors}.txt ; exit 1 ; fi @@ -1143,6 +1143,7 @@ jobs: run: > if ((Get-ChildItem -Path test-results\testoutput\*\exitcode.txt -Recurse | Select-String -Pattern '^0$' -NotMatch ).Count -gt 0) { Get-Content -Path test-results\testoutput\*\JTreport\text\newfailures.txt ; + Get-Content -Path test-results\testoutput\*\JTreport\text\other_errors.txt ; exit 1 } @@ -1299,6 +1300,7 @@ jobs: run: > if ((Get-ChildItem -Path test-results\testoutput\*\exitcode.txt -Recurse | Select-String -Pattern '^0$' -NotMatch ).Count -gt 0) { Get-Content -Path test-results\testoutput\*\JTreport\text\newfailures.txt ; + Get-Content -Path test-results\testoutput\*\JTreport\text\other_errors.txt ; exit 1 } @@ -1529,7 +1531,7 @@ jobs: run: > if cat test-results/testoutput/*/exitcode.txt | grep -q -v '^0$' || ! cat test-results/testoutput/*/Stats.txt | grep -q 'fail=0' ; then - cat test-results/testoutput/*/JTreport/text/newfailures.txt ; + cat test-results/testoutput/*/JTreport/text/{newfailures,other_errors}.txt ; exit 1 ; fi diff --git a/.jcheck/conf b/.jcheck/conf index 6b38c2b0c86..a8d23a3c35b 100644 --- a/.jcheck/conf +++ b/.jcheck/conf @@ -1,7 +1,7 @@ [general] project=jdk8u jbs=JDK -version=openjdk8u392 +version=openjdk8u402 [checks] error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace diff --git a/README b/README index 40c9fbc6a77..c93292bfbe4 100644 --- a/README +++ b/README @@ -1,40 +1,10 @@ -README: - This file should be located at the top of the OpenJDK Mercurial root - repository. A full OpenJDK repository set (forest) should also include - the following 6 nested repositories: - "jdk", "hotspot", "langtools", "corba", "jaxws" and "jaxp". +Welcome to OpenJDK! +=================== - The root repository can be obtained with something like: - hg clone http://hg.openjdk.java.net/jdk8/jdk8 openjdk8 - - You can run the get_source.sh script located in the root repository to get - the other needed repositories: - cd openjdk8 && sh ./get_source.sh +For information about building OpenJDK, including how to fully retrieve all +source code, please see either of these: - People unfamiliar with Mercurial should read the first few chapters of - the Mercurial book: http://hgbook.red-bean.com/read/ + * doc/building.html (html version) + * doc/building.md (markdown version) - See http://openjdk.java.net/ for more information about OpenJDK. - -Simple Build Instructions: - - 0. Get the necessary system software/packages installed on your system, see - http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html - - 1. If you don't have a jdk7u7 or newer jdk, download and install it from - http://java.sun.com/javase/downloads/index.jsp - Add the /bin directory of this installation to your PATH environment - variable. - - 2. Configure the build: - bash ./configure - - 3. Build the OpenJDK: - make all - The resulting JDK image should be found in build/*/images/j2sdk-image - -where make is GNU make 3.81 or newer, /usr/bin/make on Linux usually -is 3.81 or newer. Note that on Solaris, GNU make is called "gmake". - -Complete details are available in the file: - http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html +See http://openjdk.java.net/ for more information about OpenJDK. diff --git a/README-builds.html b/README-builds.html deleted file mode 100644 index 2281650f9e6..00000000000 --- a/README-builds.html +++ /dev/null @@ -1,1389 +0,0 @@ - - - OpenJDK Build README - - -

OpenJDK

- -

OpenJDK Build README

- -
- -

- -

Introduction

- -

This README file contains build instructions for the -OpenJDK. Building the source code for the OpenJDK -requires a certain degree of technical expertise.

- -

!!!!!!!!!!!!!!! THIS IS A MAJOR RE-WRITE of this document. !!!!!!!!!!!!!

- -

Some Headlines:

- - - -
- -

Contents

- - - -
- - - -
- -

- -

Use of Mercurial

- -

The OpenJDK sources are maintained with the revision control system -Mercurial. If you are new to -Mercurial, please see the Beginner Guides or refer to the Mercurial Book. -The first few chapters of the book provide an excellent overview of Mercurial, -what it is and how it works.

- -

For using Mercurial with the OpenJDK refer to the Developer Guide: Installing -and Configuring Mercurial section for more information.

- -

- -

Getting the Source

- -

To get the entire set of OpenJDK Mercurial repositories use the script -get_source.sh located in the root repository:

- -
  hg clone http://hg.openjdk.java.net/jdk8/jdk8 YourOpenJDK
-  cd YourOpenJDK
-  bash ./get_source.sh
-
- -

Once you have all the repositories, keep in mind that each repository is its -own independent repository. You can also re-run ./get_source.sh anytime to -pull over all the latest changesets in all the repositories. This set of -nested repositories has been given the term "forest" and there are various -ways to apply the same hg command to each of the repositories. For -example, the script make/scripts/hgforest.sh can be used to repeat the -same hg command on every repository, e.g.

- -
  cd YourOpenJDK
-  bash ./make/scripts/hgforest.sh status
-
- -

- -

Repositories

- -

The set of repositories and what they contain:

- - - -

Repository Source Guidelines

- -

There are some very basic guidelines:

- - - -
- -

- -

Building

- -

The very first step in building the OpenJDK is making sure the system itself -has everything it needs to do OpenJDK builds. Once a system is setup, it -generally doesn't need to be done again.

- -

Building the OpenJDK is now done with running a configure script which will -try and find and verify you have everything you need, followed by running -make, e.g.

- -
-

bash ./configure
- make all

-
- -

Where possible the configure script will attempt to located the various -components in the default locations or via component specific variable -settings. When the normal defaults fail or components cannot be found, -additional configure options may be necessary to help configure find the -necessary tools for the build, or you may need to re-visit the setup of your -system due to missing software packages.

- -

NOTE: The configure script file does not have execute permissions and -will need to be explicitly run with bash, see the source guidelines.

- -
- -

- -

System Setup

- -

Before even attempting to use a system to build the OpenJDK there are some very -basic system setups needed. For all systems:

- - - -

And for specific systems:

- - - -

- -

Linux

- -

With Linux, try and favor the system packages over building your own or getting -packages from other areas. Most Linux builds should be possible with the -system's available packages.

- -

Note that some Linux systems have a habit of pre-populating your environment -variables for you, for example JAVA_HOME might get pre-defined for you to -refer to the JDK installed on your Linux system. You will need to unset -JAVA_HOME. It's a good idea to run env and verify the environment variables -you are getting from the default system settings make sense for building the -OpenJDK.

- -

- -

Solaris

- -

- -
Studio Compilers
- -

At a minimum, the Studio 12 Update 1 Compilers (containing -version 5.10 of the C and C++ compilers) is required, including specific -patches.

- -

The Solaris SPARC patch list is:

- - - -

The Solaris X86 patch list is:

- - - -

Place the bin directory in PATH.

- -

The Oracle Solaris Studio Express compilers at: Oracle Solaris Studio Express -Download site are also an option, although these compilers -have not been extensively used yet.

- -

- -

Windows

- -
Windows Unix Toolkit
- -

Building on Windows requires a Unix-like environment, notably a Unix-like -shell. There are several such environments available of which -Cygwin and -MinGW/MSYS are currently supported for the -OpenJDK build. One of the differences of these systems from standard Windows -tools is the way they handle Windows path names, particularly path names which -contain spaces, backslashes as path separators and possibly drive letters. -Depending on the use case and the specifics of each environment these path -problems can be solved by a combination of quoting whole paths, translating -backslashes to forward slashes, escaping backslashes with additional -backslashes and translating the path names to their "8.3" -version.

- -

- -
CYGWIN
- -

CYGWIN is an open source, Linux-like environment which tries to emulate a -complete POSIX layer on Windows. It tries to be smart about path names and can -usually handle all kinds of paths if they are correctly quoted or escaped -although internally it maps drive letters <drive>: to a virtual directory -/cygdrive/<drive>.

- -

You can always use the cygpath utility to map pathnames with spaces or the -backslash character into the C:/ style of pathname (called 'mixed'), e.g. -cygpath -s -m "<path>".

- -

Note that the use of CYGWIN creates a unique problem with regards to setting -PATH. Normally on Windows the PATH variable contains directories -separated with the ";" character (Solaris and Linux use ":"). With CYGWIN, it -uses ":", but that means that paths like "C:/path" cannot be placed in the -CYGWIN version of PATH and instead CYGWIN uses something like -/cygdrive/c/path which CYGWIN understands, but only CYGWIN understands.

- -

The OpenJDK build requires CYGWIN version 1.7.16 or newer. Information about -CYGWIN can be obtained from the CYGWIN website at -www.cygwin.com.

- -

By default CYGWIN doesn't install all the tools required for building the -OpenJDK. Along with the default installation, you need to install the following -tools.

- -
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Binary NameCategoryPackageDescription
ar.exeDevelbinutilsThe GNU assembler, linker and binary utilities
make.exeDevelmakeThe GNU version of the 'make' utility built for CYGWIN
m4.exeInterpretersm4GNU implementation of the traditional Unix macro processor
cpio.exeUtilscpioA program to manage archives of files
gawk.exeUtilsawkPattern-directed scanning and processing language
file.exeUtilsfileDetermines file type using 'magic' numbers
zip.exeArchivezipPackage and compress (archive) files
unzip.exeArchiveunzipExtract compressed files in a ZIP archive
free.exeSystemprocpsDisplay amount of free and used memory in the system

-
- -

Note that the CYGWIN software can conflict with other non-CYGWIN software on -your Windows system. CYGWIN provides a FAQ for known issues and problems, of particular interest is the -section on BLODA (applications that interfere with -CYGWIN).

- -

- -
MinGW/MSYS
- -

MinGW ("Minimalist GNU for Windows") is a collection of free Windows specific -header files and import libraries combined with GNU toolsets that allow one to -produce native Windows programs that do not rely on any 3rd-party C runtime -DLLs. MSYS is a supplement to MinGW which allows building applications and -programs which rely on traditional UNIX tools to be present. Among others this -includes tools like bash and make. See MinGW/MSYS for more information.

- -

Like Cygwin, MinGW/MSYS can handle different types of path formats. They are -internally converted to paths with forward slashes and drive letters -<drive>: replaced by a virtual directory /<drive>. Additionally, MSYS -automatically detects binaries compiled for the MSYS environment and feeds them -with the internal, Unix-style path names. If native Windows applications are -called from within MSYS programs their path arguments are automatically -converted back to Windows style path names with drive letters and backslashes -as path separators. This may cause problems for Windows applications which use -forward slashes as parameter separator (e.g. cl /nologo /I) because MSYS may -wrongly replace such parameters by drive letters.

- -

In addition to the tools which will be installed by default, you have to -manually install the msys-zip and msys-unzip packages. This can be easily -done with the MinGW command line installer:

- -
  mingw-get.exe install msys-zip
-  mingw-get.exe install msys-unzip
-
- -

- -
Visual Studio 2010 Compilers
- -

The 32-bit and 64-bit OpenJDK Windows build requires Microsoft Visual Studio -C++ 2010 (VS2010) Professional Edition or Express compiler. The compiler and -other tools are expected to reside in the location defined by the variable -VS100COMNTOOLS which is set by the Microsoft Visual Studio installer.

- -

Only the C++ part of VS2010 is needed. Try to let the installation go to the -default install directory. Always reboot your system after installing VS2010. -The system environment variable VS100COMNTOOLS should be set in your -environment.

- -

Make sure that TMP and TEMP are also set in the environment and refer to -Windows paths that exist, like C:\temp, not /tmp, not /cygdrive/c/temp, -and not C:/temp. C:\temp is just an example, it is assumed that this area -is private to the user, so by default after installs you should see a unique -user path in these variables.

- -

- -

Mac OS X

- -

Make sure you get the right XCode version.

- -
- -

- -

Configure

- -

The basic invocation of the configure script looks like:

- -
-

bash ./configure [options]

-
- -

This will create an output directory containing the "configuration" and setup -an area for the build result. This directory typically looks like:

- -
-

build/linux-x64-normal-server-release

-
- -

configure will try to figure out what system you are running on and where all -necessary build components are. If you have all prerequisites for building -installed, it should find everything. If it fails to detect any component -automatically, it will exit and inform you about the problem. When this -happens, read more below in the configure options.

- -

Some examples:

- -
-

Windows 32bit build with freetype specified:
- bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target- -bits=32

- -

Debug 64bit Build:
- bash ./configure --enable-debug --with-target-bits=64

-
- -

- -

Configure Options

- -

Complete details on all the OpenJDK configure options can be seen with:

- -
-

bash ./configure --help=short

-
- -

Use -help to see all the configure options available. You can generate any -number of different configurations, e.g. debug, release, 32, 64, etc.

- -

Some of the more commonly used configure options are:

- -
-

--enable-debug
- set the debug level to fastdebug (this is a shorthand for --with-debug- - level=fastdebug)

-
- -

- -
-

--with-alsa=path
- select the location of the Advanced Linux Sound Architecture (ALSA)

- -

Version 0.9.1 or newer of the ALSA files are required for building the - OpenJDK on Linux. These Linux files are usually available from an "alsa" of - "libasound" development package, and it's highly recommended that you try - and use the package provided by the particular version of Linux that you are - using.

- -

--with-boot-jdk=path
- select the Bootstrap JDK

- -

--with-boot-jdk-jvmargs="args"
- provide the JVM options to be used to run the Bootstrap JDK

- -

--with-cacerts=path
- select the path to the cacerts file.

- -

See Certificate Authority on Wikipedia for a better understanding of the Certificate - Authority (CA). A certificates file named "cacerts" represents a system-wide - keystore with CA certificates. In JDK and JRE binary bundles, the "cacerts" - file contains root CA certificates from several public CAs (e.g., VeriSign, - Thawte, and Baltimore). The source contain a cacerts file without CA root - certificates. Formal JDK builders will need to secure permission from each - public CA and include the certificates into their own custom cacerts file. - Failure to provide a populated cacerts file will result in verification - errors of a certificate chain during runtime. By default an empty cacerts - file is provided and that should be fine for most JDK developers.

-
- -

- -
-

--with-cups=path
- select the CUPS install location

- -

The Common UNIX Printing System (CUPS) Headers are required for building the - OpenJDK on Solaris and Linux. The Solaris header files can be obtained by - installing the package SFWcups from the Solaris Software Companion - CD/DVD, these often will be installed into the directory /opt/sfw/cups.

- -

The CUPS header files can always be downloaded from - www.cups.org.

- -

--with-cups-include=path
- select the CUPS include directory location

- -

--with-debug-level=level
- select the debug information level of release, fastdebug, or slowdebug

- -

--with-dev-kit=path
- select location of the compiler install or developer install location

-
- -

- -
-

--with-freetype=path
- select the freetype files to use.

- -

Expecting the freetype libraries under lib/ and the headers under - include/.

- -

Version 2.3 or newer of FreeType is required. On Unix systems required files - can be available as part of your distribution (while you still may need to - upgrade them). Note that you need development version of package that - includes both the FreeType library and header files.

- -

You can always download latest FreeType version from the FreeType - website. Building the freetype 2 libraries from - scratch is also possible, however on Windows refer to the Windows FreeType - DLL build instructions.

- -

Note that by default FreeType is built with byte code hinting support - disabled due to licensing restrictions. In this case, text appearance and - metrics are expected to differ from Sun's official JDK build. See the - SourceForge FreeType2 Home Page - for more information.

- -

--with-import-hotspot=path
- select the location to find hotspot binaries from a previous build to avoid - building hotspot

- -

--with-target-bits=arg
- select 32 or 64 bit build

- -

--with-jvm-variants=variants
- select the JVM variants to build from, comma separated list that can - include: server, client, kernel, zero and zeroshark

- -

--with-memory-size=size
- select the RAM size that GNU make will think this system has

- -

--with-msvcr-dll=path
- select the msvcr100.dll file to include in the Windows builds (C/C++ - runtime library for Visual Studio).

- -

This is usually picked up automatically from the redist directories of - Visual Studio 2010.

- -

--with-num-cores=cores
- select the number of cores to use (processor count or CPU count)

-
- -

- -
-

--with-x=path
- select the location of the X11 and xrender files.

- -

The XRender Extension Headers are required for building the OpenJDK on - Solaris and Linux. The Linux header files are usually available from a - "Xrender" development package, it's recommended that you try and use the - package provided by the particular distribution of Linux that you are using. - The Solaris XRender header files is included with the other X11 header files - in the package SFWxwinc on new enough versions of Solaris and will be - installed in /usr/X11/include/X11/extensions/Xrender.h or - /usr/openwin/share/include/X11/extensions/Xrender.h

-
- -
- -

- -

Make

- -

The basic invocation of the make utility looks like:

- -
-

make all

-
- -

This will start the build to the output directory containing the -"configuration" that was created by the configure script. Run make help for -more information on the available targets.

- -

There are some of the make targets that are of general interest:

- -
-

empty
- build everything but no images

- -

all
- build everything including images

- -

all-conf
- build all configurations

- -

images
- create complete j2sdk and j2re images

- -

install
- install the generated images locally, typically in /usr/local

- -

clean
- remove all files generated by make, but not those generated by configure

- -

dist-clean
- remove all files generated by both and configure (basically killing the - configuration)

- -

help
- give some help on using make, including some interesting make targets

-
- -
- -

- -

Testing

- -

When the build is completed, you should see the generated binaries and -associated files in the j2sdk-image directory in the output directory. In -particular, the build/*/images/j2sdk-image/bin directory should contain -executables for the OpenJDK tools and utilities for that configuration. The -testing tool jtreg will be needed and can be found at: the jtreg -site. The provided regression tests in the -repositories can be run with the command:

- -
-

cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all

-
- -
- -

- -

Appendix A: Hints and Tips

- -

- -

FAQ

- -

Q: The generated-configure.sh file looks horrible! How are you going to -edit it?
-A: The generated-configure.sh file is generated (think "compiled") by the -autoconf tools. The source code is in configure.ac and various .m4 files in -common/autoconf, which are much more readable.

- -

Q: Why is the generated-configure.sh file checked in, if it is -generated?
-A: If it was not generated, every user would need to have the autoconf -tools installed, and re-generate the configure file as the first step. Our -goal is to minimize the work needed to be done by the user to start building -OpenJDK, and to minimize the number of external dependencies required.

- -

Q: Do you require a specific version of autoconf for regenerating -generated-configure.sh?
-A: Yes, version 2.69 is required and should be easy enough to aquire on all -supported operating systems. The reason for this is to avoid large spurious -changes in generated-configure.sh.

- -

Q: How do you regenerate generated-configure.sh after making changes to -the input files?
-A: Regnerating generated-configure.sh should always be done using the -script common/autoconf/autogen.sh to ensure that the correct files get -updated. This script should also be run after mercurial tries to merge -generated-configure.sh as a merge of the generated file is not guaranteed to -be correct.

- -

Q: What are the files in common/makefiles/support/* for? They look like -gibberish.
-A: They are a somewhat ugly hack to compensate for command line length -limitations on certain platforms (Windows, Solaris). Due to a combination of -limitations in make and the shell, command lines containing too many files will -not work properly. These helper files are part of an elaborate hack that will -compress the command line in the makefile and then uncompress it safely. We're -not proud of it, but it does fix the problem. If you have any better -suggestions, we're all ears! :-)

- -

Q: I want to see the output of the commands that make runs, like in the old -build. How do I do that?
-A: You specify the LOG variable to make. There are several log levels:

- - - -

Q: When do I have to re-run configure?
-A: Normally you will run configure only once for creating a -configuration. You need to re-run configuration only if you want to change any -configuration options, or if you pull down changes to the configure script.

- -

Q: I have added a new source file. Do I need to modify the makefiles?
-A: Normally, no. If you want to create e.g. a new native library, you will -need to modify the makefiles. But for normal file additions or removals, no -changes are needed. There are certan exceptions for some native libraries where -the source files are spread over many directories which also contain sources -for other libraries. In these cases it was simply easier to create include -lists rather than excludes.

- -

Q: When I run configure --help, I see many strange options, like ---dvidir. What is this?
-A: Configure provides a slew of options by default, to all projects that -use autoconf. Most of them are not used in OpenJDK, so you can safely ignore -them. To list only OpenJDK specific features, use configure --help=short -instead.

- -

Q: configure provides OpenJDK-specific features such as --with- -builddeps-server that are not described in this document. What about those?
-A: Try them out if you like! But be aware that most of these are -experimental features. Many of them don't do anything at all at the moment; the -option is just a placeholder. Others depend on pieces of code or infrastructure -that is currently not ready for prime time.

- -

Q: How will you make sure you don't break anything?
-A: We have a script that compares the result of the new build system with -the result of the old. For most part, we aim for (and achieve) byte-by-byte -identical output. There are however technical issues with e.g. native binaries, -which might differ in a byte-by-byte comparison, even when building twice with -the old build system. For these, we compare relevant aspects (e.g. the symbol -table and file size). Note that we still don't have 100% equivalence, but we're -close.

- -

Q: I noticed this thing X in the build that looks very broken by design. -Why don't you fix it?
-A: Our goal is to produce a build output that is as close as technically -possible to the old build output. If things were weird in the old build, they -will be weird in the new build. Often, things were weird before due to -obscurity, but in the new build system the weird stuff comes up to the surface. -The plan is to attack these things at a later stage, after the new build system -is established.

- -

Q: The code in the new build system is not that well-structured. Will you -fix this?
-A: Yes! The new build system has grown bit by bit as we converted the old -system. When all of the old build system is converted, we can take a step back -and clean up the structure of the new build system. Some of this we plan to do -before replacing the old build system and some will need to wait until after.

- -

Q: Is anything able to use the results of the new build's default make -target?
-A: Yes, this is the minimal (or roughly minimal) set of compiled output -needed for a developer to actually execute the newly built JDK. The idea is -that in an incremental development fashion, when doing a normal make, you -should only spend time recompiling what's changed (making it purely -incremental) and only do the work that's needed to actually run and test your -code. The packaging stuff that is part of the images target is not needed for -a normal developer who wants to test his new code. Even if it's quite fast, -it's still unnecessary. We're targeting sub-second incremental rebuilds! ;-) -(Or, well, at least single-digit seconds...)

- -

Q: I usually set a specific environment variable when building, but I can't -find the equivalent in the new build. What should I do?
-A: It might very well be that we have neglected to add support for an -option that was actually used from outside the build system. Email us and we -will add support for it!

- -

- -

Build Performance Tips

- -

Building OpenJDK requires a lot of horsepower. Some of the build tools can be -adjusted to utilize more or less of resources such as parallel threads and -memory. The configure script analyzes your system and selects reasonable -values for such options based on your hardware. If you encounter resource -problems, such as out of memory conditions, you can modify the detected values -with:

- - - -

It might also be necessary to specify the JVM arguments passed to the Bootstrap -JDK, using e.g. --with-boot-jdk-jvmargs="-Xmx8G -enableassertions". Doing -this will override the default JVM arguments passed to the Bootstrap JDK.

- -

One of the top goals of the new build system is to improve the build -performance and decrease the time needed to build. This will soon also apply to -the java compilation when the Smart Javac wrapper is making its way into jdk8. -It can be tried in the build-infra repository already. You are likely to find -that the new build system is faster than the old one even without this feature.

- -

At the end of a successful execution of configure, you will get a performance -summary, indicating how well the build will perform. Here you will also get -performance hints. If you want to build fast, pay attention to those!

- -

Building with ccache

- -

A simple way to radically speed up compilation of native code -(typically hotspot and native libraries in JDK) is to install -ccache. This will cache and reuse prior compilation results, if the -source code is unchanged. However, ccache versions prior to 3.1.4 does -not work correctly with the precompiled headers used in OpenJDK. So if -your platform supports ccache at 3.1.4 or later, we highly recommend -installing it. This is currently only supported on linux.

- -

Building on local disk

- -

If you are using network shares, e.g. via NFS, for your source code, make sure -the build directory is situated on local disk. The performance penalty is -extremely high for building on a network share, close to unusable.

- -

Building only one JVM

- -

The old build builds multiple JVMs on 32-bit systems (client and server; and on -Windows kernel as well). In the new build we have changed this default to only -build server when it's available. This improves build times for those not -interested in multiple JVMs. To mimic the old behavior on platforms that -support it, use --with-jvm-variants=client,server.

- -

Selecting the number of cores to build on

- -

By default, configure will analyze your machine and run the make process in -parallel with as many threads as you have cores. This behavior can be -overridden, either "permanently" (on a configure basis) using ---with-num-cores=N or for a single build only (on a make basis), using -make JOBS=N.

- -

If you want to make a slower build just this time, to save some CPU power for -other processes, you can run e.g. make JOBS=2. This will force the makefiles -to only run 2 parallel processes, or even make JOBS=1 which will disable -parallelism.

- -

If you want to have it the other way round, namely having slow builds default -and override with fast if you're impatient, you should call configure with ---with-num-cores=2, making 2 the default. If you want to run with more cores, -run make JOBS=8

- -

- -

Troubleshooting

- -

Solving build problems

- -

If the build fails (and it's not due to a compilation error in a source file -you've changed), the first thing you should do is to re-run the build with more -verbosity. Do this by adding LOG=debug to your make command line.

- -

The build log (with both stdout and stderr intermingled, basically the same as -you see on your console) can be found as build.log in your build directory.

- -

You can ask for help on build problems with the new build system on either the -build-dev or the -build-infra-dev -mailing lists. Please include the relevant parts of the build log.

- -

A build can fail for any number of reasons. Most failures are a result of -trying to build in an environment in which all the pre-build requirements have -not been met. The first step in troubleshooting a build failure is to recheck -that you have satisfied all the pre-build requirements for your platform. -Scanning the configure log is a good first step, making sure that what it -found makes sense for your system. Look for strange error messages or any -difficulties that configure had in finding things.

- -

Some of the more common problems with builds are briefly described below, with -suggestions for remedies.

- - - -
- -

- -

Appendix B: GNU make

- -

The Makefiles in the OpenJDK are only valid when used with the GNU version of -the utility command make (usually called gmake on Solaris). A few notes -about using GNU make:

- - - -

Information on GNU make, and access to ftp download sites, are available on the -GNU make web site . The latest -source to GNU make is available at -ftp.gnu.org/pub/gnu/make/.

- -

- -

Building GNU make

- -

First step is to get the GNU make 3.81 or newer source from -ftp.gnu.org/pub/gnu/make/. Building is a -little different depending on the OS but is basically done with:

- -
  bash ./configure
-  make
-
- -
- -

- -

Appendix C: Build Environments

- -

Minimum Build Environments

- -

This file often describes specific requirements for what we call the "minimum -build environments" (MBE) for this specific release of the JDK. What is listed -below is what the Oracle Release Engineering Team will use to build the Oracle -JDK product. Building with the MBE will hopefully generate the most compatible -bits that install on, and run correctly on, the most variations of the same -base OS and hardware architecture. In some cases, these represent what is often -called the least common denominator, but each Operating System has different -aspects to it.

- -

In all cases, the Bootstrap JDK version minimum is critical, we cannot -guarantee builds will work with older Bootstrap JDK's. Also in all cases, more -RAM and more processors is better, the minimums listed below are simply -recommendations.

- -

With Solaris and Mac OS X, the version listed below is the oldest release we -can guarantee builds and works, and the specific version of the compilers used -could be critical.

- -

With Windows the critical aspect is the Visual Studio compiler used, which due -to it's runtime, generally dictates what Windows systems can do the builds and -where the resulting bits can be used.

- -

NOTE: We expect a change here off these older Windows OS releases and to a -'less older' one, probably Windows 2008R2 X64.

- -

With Linux, it was just a matter of picking a stable distribution that is a -good representative for Linux in general.

- -

NOTE: We expect a change here from Fedora 9 to something else, but it has not -been completely determined yet, possibly Ubuntu 12.04 X64, unbiased community -feedback would be welcome on what a good choice would be here.

- -

It is understood that most developers will NOT be using these specific -versions, and in fact creating these specific versions may be difficult due to -the age of some of this software. It is expected that developers are more often -using the more recent releases and distributions of these operating systems.

- -

Compilation problems with newer or different C/C++ compilers is a common -problem. Similarly, compilation problems related to changes to the -/usr/include or system header files is also a common problem with older, -newer, or unreleased OS versions. Please report these types of problems as bugs -so that they can be dealt with accordingly.

- -
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Base OS and ArchitectureOSC/C++ CompilerBootstrap JDKProcessorsRAM MinimumDISK Needs
Linux X86 (32-bit) and X64 (64-bit)Fedora 9gcc 4.3 JDK 7u72 or more1 GB6 GB
Solaris SPARC (32-bit) and SPARCV9 (64-bit)Solaris 10 Update 6Studio 12 Update 1 + patchesJDK 7u74 or more4 GB8 GB
Solaris X86 (32-bit) and X64 (64-bit)Solaris 10 Update 6Studio 12 Update 1 + patchesJDK 7u74 or more4 GB8 GB
Windows X86 (32-bit)Windows XPMicrosoft Visual Studio C++ 2010 Professional EditionJDK 7u72 or more2 GB6 GB
Windows X64 (64-bit)Windows Server 2003 - Enterprise x64 EditionMicrosoft Visual Studio C++ 2010 Professional EditionJDK 7u72 or more2 GB6 GB
Mac OS X X64 (64-bit)Mac OS X 10.7 "Lion"XCode 4.5.2 or newerJDK 7u72 or more4 GB6 GB

-
- -
- -

- -

Specific Developer Build Environments

- -

We won't be listing all the possible environments, but we will try to provide -what information we have available to us.

- -

NOTE: The community can help out by updating this part of the document.

- -

Fedora

- -

After installing the latest Fedora you need to -install several build dependencies. The simplest way to do it is to execute the -following commands as user root:

- -
  yum-builddep java-1.7.0-openjdk
-  yum install gcc gcc-c++
-
- -

In addition, it's necessary to set a few environment variables for the build:

- -
  export LANG=C
-  export PATH="/usr/lib/jvm/java-openjdk/bin:${PATH}"
-
- -

CentOS 5.5

- -

After installing CentOS 5.5 you need to make sure you -have the following Development bundles installed:

- - - -

Plus the following packages:

- - - -

The freetype 2.3 packages don't seem to be available, but the freetype 2.3 -sources can be downloaded, built, and installed easily enough from the -freetype site. Build and install -with something like:

- -
  bash ./configure
-  make
-  sudo -u root make install
-
- -

Mercurial packages could not be found easily, but a Google search should find -ones, and they usually include Python if it's needed.

- -

Debian 5.0 (Lenny)

- -

After installing Debian 5 you need to install several -build dependencies. The simplest way to install the build dependencies is to -execute the following commands as user root:

- -
  aptitude build-dep openjdk-7
-  aptitude install openjdk-7-jdk libmotif-dev
-
- -

In addition, it's necessary to set a few environment variables for the build:

- -
  export LANG=C
-  export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
-
- -

Ubuntu 12.04

- -

After installing Ubuntu 12.04 you need to install several -build dependencies. The simplest way to do it is to execute the following -commands:

- -
  sudo aptitude build-dep openjdk-7
-  sudo aptitude install openjdk-7-jdk
-
- -

In addition, it's necessary to set a few environment variables for the build:

- -
  export LANG=C
-  export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
-
- -

OpenSUSE 11.1

- -

After installing OpenSUSE 11.1 you need to install -several build dependencies. The simplest way to install the build dependencies -is to execute the following commands:

- -
  sudo zypper source-install -d java-1_7_0-openjdk
-  sudo zypper install make
-
- -

In addition, it is necessary to set a few environment variables for the build:

- -
  export LANG=C
-  export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}"
-
- -

Finally, you need to unset the JAVA_HOME environment variable:

- -
  export -n JAVA_HOME`
-
- -

Mandriva Linux One 2009 Spring

- -

After installing Mandriva Linux One 2009 Spring you need -to install several build dependencies. The simplest way to install the build -dependencies is to execute the following commands as user root:

- -
  urpmi java-1.7.0-openjdk-devel make gcc gcc-c++ freetype-devel zip unzip
-    libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel
-    libxtst6-devel libxi-devel
-
- -

In addition, it is necessary to set a few environment variables for the build:

- -
  export LANG=C
-  export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}"
-
- -

OpenSolaris 2009.06

- -

After installing OpenSolaris 2009.06 you need to -install several build dependencies. The simplest way to install the build -dependencies is to execute the following commands:

- -
  pfexec pkg install SUNWgmake SUNWj7dev sunstudioexpress SUNWcups SUNWzip
-    SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2
-
- -

In addition, it is necessary to set a few environment variables for the build:

- -
  export LANG=C
-  export PATH="/opt/SunStudioExpress/bin:${PATH}"
-
- -
- -

End of the OpenJDK build README document.

- -

Please come again!

- - diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index 692ef831abf..66e69ad5a8e 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -427,6 +427,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS], BASIC_PATH_PROGS(DF, df) BASIC_PATH_PROGS(SETFILE, SetFile) BASIC_PATH_PROGS(CPIO, [cpio bsdcpio]) + BASIC_PATH_PROGS(PANDOC, pandoc) ]) # Setup basic configuration paths, and platform-specific stuff related to PATHs. diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index bae7e64749c..19b18ece406 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -951,6 +951,7 @@ build_os build_vendor build_cpu build +PANDOC CPIO SETFILE DF @@ -1019,7 +1020,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -1181,6 +1181,7 @@ READLINK DF SETFILE CPIO +PANDOC UNZIP ZIP LDD @@ -1264,7 +1265,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1517,15 +1517,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1663,7 +1654,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1816,7 +1807,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -2077,6 +2067,7 @@ Some influential environment variables: DF Override default value for DF SETFILE Override default value for SETFILE CPIO Override default value for CPIO + PANDOC Override default value for PANDOC UNZIP Override default value for UNZIP ZIP Override default value for ZIP LDD Override default value for LDD @@ -4446,7 +4437,7 @@ VS_TOOLSET_SUPPORTED_2022=true #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1670219878 +DATE_WHEN_GENERATED=1694011184 ############################################################################### # @@ -13506,6 +13497,192 @@ $as_echo "$tool_specified" >&6; } + # Publish this variable in the help. + + + if test "x$PANDOC" = x; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in pandoc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PANDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PANDOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PANDOC=$ac_cv_path_PANDOC +if test -n "$PANDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 +$as_echo "$PANDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PANDOC" && break +done + + else + # The variable is set, but is it from the command line or the environment? + + # Try to remove the string !PANDOC! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!PANDOC!/} + if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then + # If it failed, the variable was not from the command line. Ignore it, + # but warn the user (except for BASH, which is always set by the calling BASH). + if test "xPANDOC" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of PANDOC from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of PANDOC from the environment. Use command line variables instead." >&2;} + fi + # Try to locate tool using the code snippet + for ac_prog in pandoc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PANDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PANDOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PANDOC=$ac_cv_path_PANDOC +if test -n "$PANDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 +$as_echo "$PANDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PANDOC" && break +done + + else + # If it succeeded, then it was overridden by the user. We will use it + # for the tool. + + # First remove it from the list of overridden variables, so we can test + # for unknown variables in the end. + CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + + # Check if the provided tool contains a complete path. + tool_specified="$PANDOC" + tool_basename="${tool_specified##*/}" + if test "x$tool_basename" = "x$tool_specified"; then + # A command without a complete path is provided, search $PATH. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool PANDOC=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool PANDOC=$tool_basename" >&6;} + # Extract the first word of "$tool_basename", so it can be a program name with args. +set dummy $tool_basename; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PANDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PANDOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PANDOC=$ac_cv_path_PANDOC +if test -n "$PANDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 +$as_echo "$PANDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$PANDOC" = x; then + as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 + fi + else + # Otherwise we believe it is a complete path. Use it as it is. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool PANDOC=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool PANDOC=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANDOC" >&5 +$as_echo_n "checking for PANDOC... " >&6; } + if test ! -x "$tool_specified"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "User supplied tool PANDOC=$tool_specified does not exist or is not executable" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 +$as_echo "$tool_specified" >&6; } + fi + fi + fi + + + + # Now we can determine OpenJDK build and target platforms. This is required to # have early on. # Make sure we can run config.sub. diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index 63276b2a98c..1b0347704e5 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -572,6 +572,7 @@ LN:=@LN@ MKDIR:=@MKDIR@ MV:=@MV@ NAWK:=@NAWK@ +PANDOC:=@PANDOC@ PRINTF:=@PRINTF@ PWD:=@THEPWDCMD@ RM:=@RM@ diff --git a/common/autoconf/version-numbers b/common/autoconf/version-numbers index c6f195d24a9..0ab28cdaf65 100644 --- a/common/autoconf/version-numbers +++ b/common/autoconf/version-numbers @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2023, 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 @@ -26,7 +26,7 @@ JDK_MAJOR_VERSION=1 JDK_MINOR_VERSION=8 JDK_MICRO_VERSION=0 -JDK_UPDATE_VERSION=392 +JDK_UPDATE_VERSION=402 LAUNCHER_NAME=openjdk PRODUCT_NAME=OpenJDK PRODUCT_SUFFIX="Runtime Environment" diff --git a/common/bin/update-build-readme.sh b/common/bin/update-build-readme.sh deleted file mode 100644 index f16e289b32a..00000000000 --- a/common/bin/update-build-readme.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -# Get an absolute path to this script, since that determines the top-level -# directory. -this_script_dir=`dirname $0` -TOPDIR=`cd $this_script_dir/../.. > /dev/null && pwd` - -GREP=grep -MD_FILE=$TOPDIR/README-builds.md -HTML_FILE=$TOPDIR/README-builds.html - -# Locate the markdown processor tool and check that it is the correct version. -locate_markdown_processor() { - if [ -z "$MARKDOWN" ]; then - MARKDOWN=`which markdown 2> /dev/null` - if [ -z "$MARKDOWN" ]; then - echo "Error: Cannot locate markdown processor" 1>&2 - exit 1 - fi - fi - - # Test version - MARKDOWN_VERSION=`$MARKDOWN -version | $GREP version` - if [ "x$MARKDOWN_VERSION" != "xThis is Markdown, version 1.0.1." ]; then - echo "Error: Expected markdown version 1.0.1." 1>&2 - echo "Actual version found: $MARKDOWN_VERSION" 1>&2 - echo "Download markdown here: https://daringfireball.net/projects/markdown/" 1>&2 - exit 1 - fi - -} - -# Verify that the source markdown file looks sound. -verify_source_code() { - TOO_LONG_LINES=`$GREP -E -e '^.{80}.+$' $MD_FILE` - if [ "x$TOO_LONG_LINES" != x ]; then - echo "Warning: The following lines are longer than 80 characters:" - $GREP -E -e '^.{80}.+$' $MD_FILE - fi -} - -# Convert the markdown file to html format. -process_source() { - echo "Generating html file from markdown" - cat > $HTML_FILE << END - - - OpenJDK Build README - - -END - ${MARKDOWN} $MD_FILE >> $HTML_FILE - cat >> $HTML_FILE < - -END - echo "Done" -} - -locate_markdown_processor -verify_source_code -process_source diff --git a/corba/README b/corba/README deleted file mode 100644 index 56825f5ca08..00000000000 --- a/corba/README +++ /dev/null @@ -1,14 +0,0 @@ -README: - This file should be located at the top of the corba Mercurial repository. - - See http://openjdk.java.net/ for more information about the OpenJDK. - - See ../README-builds.html for complete details on build machine requirements. - -Simple Build Instructions: - - cd make && gnumake - - The files that will be imported into the jdk build will be in the "dist" - directory. - diff --git a/doc/building.html b/doc/building.html new file mode 100644 index 00000000000..84d2aa3ace2 --- /dev/null +++ b/doc/building.html @@ -0,0 +1,715 @@ + + + + + + + OpenJDK Build README + + + + +
+

OpenJDK Build README

+
+
+OpenJDK
OpenJDK
+
+
+

Introduction

+

This README file contains build instructions for the OpenJDK. Building the source code for the OpenJDK requires a certain degree of technical expertise.

+

!!!!!!!!!!!!!!! THIS IS A MAJOR RE-WRITE of this document. !!!!!!!!!!!!!

+

Some Headlines:

+ +
+

Contents

+ +
+ +
+

Use of Mercurial

+

The OpenJDK sources are maintained with the revision control system Mercurial. If you are new to Mercurial, please see the Beginner Guides or refer to the Mercurial Book. The first few chapters of the book provide an excellent overview of Mercurial, what it is and how it works.

+

For using Mercurial with the OpenJDK refer to the Developer Guide: Installing and Configuring Mercurial section for more information.

+

Getting the Source

+

To get the entire set of OpenJDK Mercurial repositories use the script get_source.sh located in the root repository:

+
  hg clone http://hg.openjdk.java.net/jdk8/jdk8 YourOpenJDK
+  cd YourOpenJDK
+  bash ./get_source.sh
+

Once you have all the repositories, keep in mind that each repository is its own independent repository. You can also re-run ./get_source.sh anytime to pull over all the latest changesets in all the repositories. This set of nested repositories has been given the term “forest” and there are various ways to apply the same hg command to each of the repositories. For example, the script make/scripts/hgforest.sh can be used to repeat the same hg command on every repository, e.g.

+
  cd YourOpenJDK
+  bash ./make/scripts/hgforest.sh status
+

Repositories

+

The set of repositories and what they contain:

+ +

Repository Source Guidelines

+

There are some very basic guidelines:

+ +
+

Building

+

The very first step in building the OpenJDK is making sure the system itself has everything it needs to do OpenJDK builds. Once a system is setup, it generally doesn’t need to be done again.

+

Building the OpenJDK is now done with running a configure script which will try and find and verify you have everything you need, followed by running make, e.g.

+
+

bash ./configure
+make all

+
+

Where possible the configure script will attempt to located the various components in the default locations or via component specific variable settings. When the normal defaults fail or components cannot be found, additional configure options may be necessary to help configure find the necessary tools for the build, or you may need to re-visit the setup of your system due to missing software packages.

+

NOTE: The configure script file does not have execute permissions and will need to be explicitly run with bash, see the source guidelines.

+
+

System Setup

+

Before even attempting to use a system to build the OpenJDK there are some very basic system setups needed. For all systems:

+ +

And for specific systems:

+ +

Linux

+

With Linux, try and favor the system packages over building your own or getting packages from other areas. Most Linux builds should be possible with the system’s available packages.

+

Note that some Linux systems have a habit of pre-populating your environment variables for you, for example JAVA_HOME might get pre-defined for you to refer to the JDK installed on your Linux system. You will need to unset JAVA_HOME. It’s a good idea to run env and verify the environment variables you are getting from the default system settings make sense for building the OpenJDK.

+

Solaris

+
Studio Compilers
+

At a minimum, the Studio 12 Update 1 Compilers (containing version 5.10 of the C and C++ compilers) is required, including specific patches.

+

The Solaris SPARC patch list is:

+ +

The Solaris X86 patch list is:

+ +

Place the bin directory in PATH.

+

The Oracle Solaris Studio Express compilers at: Oracle Solaris Studio Express Download site are also an option, although these compilers have not been extensively used yet.

+

Windows

+
Windows Unix Toolkit
+

Building on Windows requires a Unix-like environment, notably a Unix-like shell. There are several such environments available of which Cygwin and MinGW/MSYS are currently supported for the OpenJDK build. One of the differences of these systems from standard Windows tools is the way they handle Windows path names, particularly path names which contain spaces, backslashes as path separators and possibly drive letters. Depending on the use case and the specifics of each environment these path problems can be solved by a combination of quoting whole paths, translating backslashes to forward slashes, escaping backslashes with additional backslashes and translating the path names to their “8.3” version.

+
CYGWIN
+

CYGWIN is an open source, Linux-like environment which tries to emulate a complete POSIX layer on Windows. It tries to be smart about path names and can usually handle all kinds of paths if they are correctly quoted or escaped although internally it maps drive letters <drive>: to a virtual directory /cygdrive/<drive>.

+

You can always use the cygpath utility to map pathnames with spaces or the backslash character into the C:/ style of pathname (called ‘mixed’), e.g. cygpath -s -m "<path>".

+

Note that the use of CYGWIN creates a unique problem with regards to setting PATH. Normally on Windows the PATH variable contains directories separated with the “;” character (Solaris and Linux use “:”). With CYGWIN, it uses “:”, but that means that paths like “C:/path” cannot be placed in the CYGWIN version of PATH and instead CYGWIN uses something like /cygdrive/c/path which CYGWIN understands, but only CYGWIN understands.

+

The OpenJDK build requires CYGWIN version 1.7.16 or newer. Information about CYGWIN can be obtained from the CYGWIN website at www.cygwin.com.

+

By default CYGWIN doesn’t install all the tools required for building the OpenJDK. Along with the default installation, you need to install the following tools.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Binary NameCategoryPackageDescription
ar.exeDevelbinutilsThe GNU assembler, linker and binary utilities
make.exeDevelmakeThe GNU version of the ‘make’ utility built for CYGWIN
m4.exeInterpretersm4GNU implementation of the traditional Unix macro processor
cpio.exeUtilscpioA program to manage archives of files
gawk.exeUtilsawkPattern-directed scanning and processing language
file.exeUtilsfileDetermines file type using ‘magic’ numbers
zip.exeArchivezipPackage and compress (archive) files
unzip.exeArchiveunzipExtract compressed files in a ZIP archive
free.exeSystemprocpsDisplay amount of free and used memory in the system
+

Note that the CYGWIN software can conflict with other non-CYGWIN software on your Windows system. CYGWIN provides a FAQ for known issues and problems, of particular interest is the section on BLODA (applications that interfere with CYGWIN).

+
MinGW/MSYS
+

MinGW (“Minimalist GNU for Windows”) is a collection of free Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs. MSYS is a supplement to MinGW which allows building applications and programs which rely on traditional UNIX tools to be present. Among others this includes tools like bash and make. See MinGW/MSYS for more information.

+

Like Cygwin, MinGW/MSYS can handle different types of path formats. They are internally converted to paths with forward slashes and drive letters <drive>: replaced by a virtual directory /<drive>. Additionally, MSYS automatically detects binaries compiled for the MSYS environment and feeds them with the internal, Unix-style path names. If native Windows applications are called from within MSYS programs their path arguments are automatically converted back to Windows style path names with drive letters and backslashes as path separators. This may cause problems for Windows applications which use forward slashes as parameter separator (e.g. cl /nologo /I) because MSYS may wrongly replace such parameters by drive letters.

+

In addition to the tools which will be installed by default, you have to manually install the msys-zip and msys-unzip packages. This can be easily done with the MinGW command line installer:

+
  mingw-get.exe install msys-zip
+  mingw-get.exe install msys-unzip
+
Visual Studio 2010 Compilers
+

The 32-bit and 64-bit OpenJDK Windows build requires Microsoft Visual Studio C++ 2010 (VS2010) Professional Edition or Express compiler. The compiler and other tools are expected to reside in the location defined by the variable VS100COMNTOOLS which is set by the Microsoft Visual Studio installer.

+

Only the C++ part of VS2010 is needed. Try to let the installation go to the default install directory. Always reboot your system after installing VS2010. The system environment variable VS100COMNTOOLS should be set in your environment.

+

Make sure that TMP and TEMP are also set in the environment and refer to Windows paths that exist, like C:\temp, not /tmp, not /cygdrive/c/temp, and not C:/temp. C:\temp is just an example, it is assumed that this area is private to the user, so by default after installs you should see a unique user path in these variables.

+

Mac OS X

+

Make sure you get the right XCode version.

+
+

Configure

+

The basic invocation of the configure script looks like:

+
+

bash ./configure [options]

+
+

This will create an output directory containing the “configuration” and setup an area for the build result. This directory typically looks like:

+
+

build/linux-x64-normal-server-release

+
+

configure will try to figure out what system you are running on and where all necessary build components are. If you have all prerequisites for building installed, it should find everything. If it fails to detect any component automatically, it will exit and inform you about the problem. When this happens, read more below in the configure options.

+

Some examples:

+
+

Windows 32bit build with freetype specified:
+bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32

+
+
+

Debug 64bit Build:
+bash ./configure --enable-debug --with-target-bits=64

+
+

Configure Options

+

Complete details on all the OpenJDK configure options can be seen with:

+
+

bash ./configure --help=short

+
+

Use -help to see all the configure options available. You can generate any number of different configurations, e.g. debug, release, 32, 64, etc.

+

Some of the more commonly used configure options are:

+
+

--enable-debug
+set the debug level to fastdebug (this is a shorthand for --with-debug-level=fastdebug)

+
+

+
+

--with-alsa=_path_
+select the location of the Advanced Linux Sound Architecture (ALSA)

+
+
+

Version 0.9.1 or newer of the ALSA files are required for building the OpenJDK on Linux. These Linux files are usually available from an “alsa” of “libasound” development package, and it’s highly recommended that you try and use the package provided by the particular version of Linux that you are using.

+
+
+

--with-boot-jdk=_path_
+select the Bootstrap JDK

+
+
+

--with-boot-jdk-jvmargs=args
+provide the JVM options to be used to run the Bootstrap JDK

+
+
+

--with-cacerts=_path_
+select the path to the cacerts file.

+
+
+

See Certificate Authority on Wikipedia for a better understanding of the Certificate Authority (CA). A certificates file named “cacerts” represents a system-wide keystore with CA certificates. In JDK and JRE binary bundles, the “cacerts” file contains root CA certificates from several public CAs (e.g., VeriSign, Thawte, and Baltimore). The source contain a cacerts file without CA root certificates. Formal JDK builders will need to secure permission from each public CA and include the certificates into their own custom cacerts file. Failure to provide a populated cacerts file will result in verification errors of a certificate chain during runtime. By default an empty cacerts file is provided and that should be fine for most JDK developers.

+
+

+
+

--with-cups=_path_
+select the CUPS install location

+
+
+

The Common UNIX Printing System (CUPS) Headers are required for building the OpenJDK on Solaris and Linux. The Solaris header files can be obtained by installing the package SFWcups from the Solaris Software Companion CD/DVD, these often will be installed into the directory /opt/sfw/cups.

+
+
+

The CUPS header files can always be downloaded from www.cups.org.

+
+
+

--with-cups-include=_path_
+select the CUPS include directory location

+
+
+

--with-debug-level=_level_
+select the debug information level of release, fastdebug, or slowdebug

+
+
+

--with-dev-kit=_path_
+select location of the compiler install or developer install location

+
+

+
+

--with-freetype=_path_
+select the freetype files to use.

+
+
+

Expecting the freetype libraries under lib/ and the headers under include/.

+
+
+

Version 2.3 or newer of FreeType is required. On Unix systems required files can be available as part of your distribution (while you still may need to upgrade them). Note that you need development version of package that includes both the FreeType library and header files.

+
+
+

You can always download latest FreeType version from the FreeType website. Building the freetype 2 libraries from scratch is also possible, however on Windows refer to the Windows FreeType DLL build instructions.

+
+
+

Note that by default FreeType is built with byte code hinting support disabled due to licensing restrictions. In this case, text appearance and metrics are expected to differ from Sun’s official JDK build. See the SourceForge FreeType2 Home Page for more information.

+
+
+

--with-import-hotspot=_path_
+select the location to find hotspot binaries from a previous build to avoid building hotspot

+
+
+

--with-target-bits=_arg_
+select 32 or 64 bit build

+
+
+

--with-jvm-variants=_variants_
+select the JVM variants to build from, comma separated list that can include: server, client, kernel, zero and zeroshark

+
+
+

--with-memory-size=_size_
+select the RAM size that GNU make will think this system has

+
+
+

--with-msvcr-dll=_path_
+select the msvcr100.dll file to include in the Windows builds (C/C++ runtime library for Visual Studio).

+
+
+

This is usually picked up automatically from the redist directories of Visual Studio 2010.

+
+
+

--with-num-cores=_cores_
+select the number of cores to use (processor count or CPU count)

+
+

+
+

--with-x=_path_
+select the location of the X11 and xrender files.

+
+
+

The XRender Extension Headers are required for building the OpenJDK on Solaris and Linux. The Linux header files are usually available from a “Xrender” development package, it’s recommended that you try and use the package provided by the particular distribution of Linux that you are using. The Solaris XRender header files is included with the other X11 header files in the package SFWxwinc on new enough versions of Solaris and will be installed in /usr/X11/include/X11/extensions/Xrender.h or /usr/openwin/share/include/X11/extensions/Xrender.h

+
+
+

Make

+

The basic invocation of the make utility looks like:

+
+

make all

+
+

This will start the build to the output directory containing the “configuration” that was created by the configure script. Run make help for more information on the available targets.

+

There are some of the make targets that are of general interest:

+
+

empty
+build everything but no images

+
+
+

all
+build everything including images

+
+
+

all-conf
+build all configurations

+
+
+

images
+create complete j2sdk and j2re images

+
+
+

install
+install the generated images locally, typically in /usr/local

+
+
+

clean
+remove all files generated by make, but not those generated by configure

+
+
+

dist-clean
+remove all files generated by both and configure (basically killing the configuration)

+
+
+

help
+give some help on using make, including some interesting make targets

+
+
+

Testing

+

When the build is completed, you should see the generated binaries and associated files in the j2sdk-image directory in the output directory. In particular, the build/*/images/j2sdk-image/bin directory should contain executables for the OpenJDK tools and utilities for that configuration. The testing tool jtreg will be needed and can be found at: the jtreg site. The provided regression tests in the repositories can be run with the command:

+
+

cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all

+
+
+

Appendix A: Hints and Tips

+

FAQ

+

Q: The generated-configure.sh file looks horrible! How are you going to edit it?
+A: The generated-configure.sh file is generated (think “compiled”) by the autoconf tools. The source code is in configure.ac and various .m4 files in common/autoconf, which are much more readable.

+

Q: Why is the generated-configure.sh file checked in, if it is generated?
+A: If it was not generated, every user would need to have the autoconf tools installed, and re-generate the configure file as the first step. Our goal is to minimize the work needed to be done by the user to start building OpenJDK, and to minimize the number of external dependencies required.

+

Q: Do you require a specific version of autoconf for regenerating generated-configure.sh?
+A: Yes, version 2.69 is required and should be easy enough to aquire on all supported operating systems. The reason for this is to avoid large spurious changes in generated-configure.sh.

+

Q: How do you regenerate generated-configure.sh after making changes to the input files?
+A: Regnerating generated-configure.sh should always be done using the script common/autoconf/autogen.sh to ensure that the correct files get updated. This script should also be run after mercurial tries to merge generated-configure.sh as a merge of the generated file is not guaranteed to be correct.

+

Q: What are the files in common/makefiles/support/* for? They look like gibberish.
+A: They are a somewhat ugly hack to compensate for command line length limitations on certain platforms (Windows, Solaris). Due to a combination of limitations in make and the shell, command lines containing too many files will not work properly. These helper files are part of an elaborate hack that will compress the command line in the makefile and then uncompress it safely. We’re not proud of it, but it does fix the problem. If you have any better suggestions, we’re all ears! :-)

+

Q: I want to see the output of the commands that make runs, like in the old build. How do I do that?
+A: You specify the LOG variable to make. There are several log levels:

+ +

Q: When do I have to re-run configure?
+A: Normally you will run configure only once for creating a configuration. You need to re-run configuration only if you want to change any configuration options, or if you pull down changes to the configure script.

+

Q: I have added a new source file. Do I need to modify the makefiles?
+A: Normally, no. If you want to create e.g. a new native library, you will need to modify the makefiles. But for normal file additions or removals, no changes are needed. There are certan exceptions for some native libraries where the source files are spread over many directories which also contain sources for other libraries. In these cases it was simply easier to create include lists rather than excludes.

+

Q: When I run configure --help, I see many strange options, like --dvidir. What is this?
+A: Configure provides a slew of options by default, to all projects that use autoconf. Most of them are not used in OpenJDK, so you can safely ignore them. To list only OpenJDK specific features, use configure --help=short instead.

+

Q: configure provides OpenJDK-specific features such as --with-builddeps-server that are not described in this document. What about those?
+A: Try them out if you like! But be aware that most of these are experimental features. Many of them don’t do anything at all at the moment; the option is just a placeholder. Others depend on pieces of code or infrastructure that is currently not ready for prime time.

+

Q: How will you make sure you don’t break anything?
+A: We have a script that compares the result of the new build system with the result of the old. For most part, we aim for (and achieve) byte-by-byte identical output. There are however technical issues with e.g. native binaries, which might differ in a byte-by-byte comparison, even when building twice with the old build system. For these, we compare relevant aspects (e.g. the symbol table and file size). Note that we still don’t have 100% equivalence, but we’re close.

+

Q: I noticed this thing X in the build that looks very broken by design. Why don’t you fix it?
+A: Our goal is to produce a build output that is as close as technically possible to the old build output. If things were weird in the old build, they will be weird in the new build. Often, things were weird before due to obscurity, but in the new build system the weird stuff comes up to the surface. The plan is to attack these things at a later stage, after the new build system is established.

+

Q: The code in the new build system is not that well-structured. Will you fix this?
+A: Yes! The new build system has grown bit by bit as we converted the old system. When all of the old build system is converted, we can take a step back and clean up the structure of the new build system. Some of this we plan to do before replacing the old build system and some will need to wait until after.

+

Q: Is anything able to use the results of the new build’s default make target?
+A: Yes, this is the minimal (or roughly minimal) set of compiled output needed for a developer to actually execute the newly built JDK. The idea is that in an incremental development fashion, when doing a normal make, you should only spend time recompiling what’s changed (making it purely incremental) and only do the work that’s needed to actually run and test your code. The packaging stuff that is part of the images target is not needed for a normal developer who wants to test his new code. Even if it’s quite fast, it’s still unnecessary. We’re targeting sub-second incremental rebuilds! ;-) (Or, well, at least single-digit seconds…)

+

Q: I usually set a specific environment variable when building, but I can’t find the equivalent in the new build. What should I do?
+A: It might very well be that we have neglected to add support for an option that was actually used from outside the build system. Email us and we will add support for it!

+

Build Performance Tips

+

Building OpenJDK requires a lot of horsepower. Some of the build tools can be adjusted to utilize more or less of resources such as parallel threads and memory. The configure script analyzes your system and selects reasonable values for such options based on your hardware. If you encounter resource problems, such as out of memory conditions, you can modify the detected values with:

+ +

It might also be necessary to specify the JVM arguments passed to the Bootstrap JDK, using e.g. --with-boot-jdk-jvmargs="-Xmx8G -enableassertions". Doing this will override the default JVM arguments passed to the Bootstrap JDK.

+

One of the top goals of the new build system is to improve the build performance and decrease the time needed to build. This will soon also apply to the java compilation when the Smart Javac wrapper is making its way into jdk8. It can be tried in the build-infra repository already. You are likely to find that the new build system is faster than the old one even without this feature.

+

At the end of a successful execution of configure, you will get a performance summary, indicating how well the build will perform. Here you will also get performance hints. If you want to build fast, pay attention to those!

+

Building with ccache

+

A simple way to radically speed up compilation of native code (typically hotspot and native libraries in JDK) is to install ccache. This will cache and reuse prior compilation results, if the source code is unchanged. However, ccache versions prior to 3.1.4 does not work correctly with the precompiled headers used in OpenJDK. So if your platform supports ccache at 3.1.4 or later, we highly recommend installing it. This is currently only supported on linux.

+

Building on local disk

+

If you are using network shares, e.g. via NFS, for your source code, make sure the build directory is situated on local disk. The performance penalty is extremely high for building on a network share, close to unusable.

+

Building only one JVM

+

The old build builds multiple JVMs on 32-bit systems (client and server; and on Windows kernel as well). In the new build we have changed this default to only build server when it’s available. This improves build times for those not interested in multiple JVMs. To mimic the old behavior on platforms that support it, use --with-jvm-variants=client,server.

+

Selecting the number of cores to build on

+

By default, configure will analyze your machine and run the make process in parallel with as many threads as you have cores. This behavior can be overridden, either “permanently” (on a configure basis) using --with-num-cores=N or for a single build only (on a make basis), using make JOBS=N.

+

If you want to make a slower build just this time, to save some CPU power for other processes, you can run e.g. make JOBS=2. This will force the makefiles to only run 2 parallel processes, or even make JOBS=1 which will disable parallelism.

+

If you want to have it the other way round, namely having slow builds default and override with fast if you’re impatient, you should call configure with --with-num-cores=2, making 2 the default. If you want to run with more cores, run make JOBS=8

+

Troubleshooting

+

Solving build problems

+

If the build fails (and it’s not due to a compilation error in a source file you’ve changed), the first thing you should do is to re-run the build with more verbosity. Do this by adding LOG=debug to your make command line.

+

The build log (with both stdout and stderr intermingled, basically the same as you see on your console) can be found as build.log in your build directory.

+

You can ask for help on build problems with the new build system on either the build-dev or the build-infra-dev mailing lists. Please include the relevant parts of the build log.

+

A build can fail for any number of reasons. Most failures are a result of trying to build in an environment in which all the pre-build requirements have not been met. The first step in troubleshooting a build failure is to recheck that you have satisfied all the pre-build requirements for your platform. Scanning the configure log is a good first step, making sure that what it found makes sense for your system. Look for strange error messages or any difficulties that configure had in finding things.

+

Some of the more common problems with builds are briefly described below, with suggestions for remedies.

+ +
+

Appendix B: GNU make

+

The Makefiles in the OpenJDK are only valid when used with the GNU version of the utility command make (usually called gmake on Solaris). A few notes about using GNU make:

+ +

Information on GNU make, and access to ftp download sites, are available on the GNU make web site. The latest source to GNU make is available at ftp.gnu.org/pub/gnu/make/.

+

Building GNU make

+

First step is to get the GNU make 3.81 or newer source from ftp.gnu.org/pub/gnu/make/. Building is a little different depending on the OS but is basically done with:

+
  bash ./configure
+  make
+
+

Appendix C: Build Environments

+

Minimum Build Environments

+

This file often describes specific requirements for what we call the “minimum build environments” (MBE) for this specific release of the JDK. What is listed below is what the Oracle Release Engineering Team will use to build the Oracle JDK product. Building with the MBE will hopefully generate the most compatible bits that install on, and run correctly on, the most variations of the same base OS and hardware architecture. In some cases, these represent what is often called the least common denominator, but each Operating System has different aspects to it.

+

In all cases, the Bootstrap JDK version minimum is critical, we cannot guarantee builds will work with older Bootstrap JDK’s. Also in all cases, more RAM and more processors is better, the minimums listed below are simply recommendations.

+

With Solaris and Mac OS X, the version listed below is the oldest release we can guarantee builds and works, and the specific version of the compilers used could be critical.

+

With Windows the critical aspect is the Visual Studio compiler used, which due to it’s runtime, generally dictates what Windows systems can do the builds and where the resulting bits can be used.

+

NOTE: We expect a change here off these older Windows OS releases and to a ‘less older’ one, probably Windows 2008R2 X64.

+

With Linux, it was just a matter of picking a stable distribution that is a good representative for Linux in general.

+

NOTE: We expect a change here from Fedora 9 to something else, but it has not been completely determined yet, possibly Ubuntu 12.04 X64, unbiased community feedback would be welcome on what a good choice would be here.

+

It is understood that most developers will NOT be using these specific versions, and in fact creating these specific versions may be difficult due to the age of some of this software. It is expected that developers are more often using the more recent releases and distributions of these operating systems.

+

Compilation problems with newer or different C/C++ compilers is a common problem. Similarly, compilation problems related to changes to the /usr/include or system header files is also a common problem with older, newer, or unreleased OS versions. Please report these types of problems as bugs so that they can be dealt with accordingly.

+

Bootstrap JDK: JDK 7u7

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Base OS and ArchitectureOSC/C++ CompilerProcessorsRAM MinimumDISK Needs
Linux X86 (32-bit) and X64 (64-bit)Fedora 9gcc 4.32 or more1 GB6 GB
Solaris SPARC (32-bit) and SPARCV9 (64-bit)Solaris 10 Update 6Studio 12 Update 1 + patches4 or more4 GB8 GB
Solaris X86 (32-bit) and X64 (64-bit)Solaris 10 Update 6Studio 12 Update 1 + patches4 or more4 GB8 GB
Windows X86 (32-bit)Windows XPMicrosoft Visual Studio C++ 2010 Professional Edition2 or more2 GB6 GB
Windows X64 (64-bit)Windows Server 2003 - Enterprise x64 EditionMicrosoft Visual Studio C++ 2010 Professional Edition2 or more2 GB6 GB
Mac OS X X64 (64-bit)Mac OS X 10.7 “Lion”XCode 4.5.2 or newer2 or more4 GB6 GB
+
+

Specific Developer Build Environments

+

We won’t be listing all the possible environments, but we will try to provide what information we have available to us.

+

NOTE: The community can help out by updating this part of the document.

+

Fedora

+

After installing the latest Fedora you need to install several build dependencies. The simplest way to do it is to execute the following commands as user root:

+
  yum-builddep java-1.7.0-openjdk
+  yum install gcc gcc-c++
+

In addition, it’s necessary to set a few environment variables for the build:

+
  export LANG=C
+  export PATH="/usr/lib/jvm/java-openjdk/bin:${PATH}"
+

CentOS 5.5

+

After installing CentOS 5.5 you need to make sure you have the following Development bundles installed:

+ +

Plus the following packages:

+ +

The freetype 2.3 packages don’t seem to be available, but the freetype 2.3 sources can be downloaded, built, and installed easily enough from the freetype site. Build and install with something like:

+
  bash ./configure
+  make
+  sudo -u root make install
+

Mercurial packages could not be found easily, but a Google search should find ones, and they usually include Python if it’s needed.

+

Debian 5.0 (Lenny)

+

After installing Debian 5 you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands as user root:

+
  aptitude build-dep openjdk-7
+  aptitude install openjdk-7-jdk libmotif-dev
+

In addition, it’s necessary to set a few environment variables for the build:

+
  export LANG=C
+  export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
+

Ubuntu 12.04

+

After installing Ubuntu 12.04 you need to install several build dependencies. The simplest way to do it is to execute the following commands:

+
  sudo aptitude build-dep openjdk-7
+  sudo aptitude install openjdk-7-jdk
+

In addition, it’s necessary to set a few environment variables for the build:

+
  export LANG=C
+  export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
+

OpenSUSE 11.1

+

After installing OpenSUSE 11.1 you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands:

+
  sudo zypper source-install -d java-1_7_0-openjdk
+  sudo zypper install make
+

In addition, it is necessary to set a few environment variables for the build:

+
  export LANG=C
+  export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}"
+

Finally, you need to unset the JAVA_HOME environment variable:

+
  export -n JAVA_HOME`
+

Mandriva Linux One 2009 Spring

+

After installing Mandriva Linux One 2009 Spring you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands as user root:

+
  urpmi java-1.7.0-openjdk-devel make gcc gcc-c++ freetype-devel zip unzip
+    libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel
+    libxtst6-devel libxi-devel
+

In addition, it is necessary to set a few environment variables for the build:

+
  export LANG=C
+  export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}"
+

OpenSolaris 2009.06

+

After installing OpenSolaris 2009.06 you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands:

+
  pfexec pkg install SUNWgmake SUNWj7dev sunstudioexpress SUNWcups SUNWzip
+    SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2
+

In addition, it is necessary to set a few environment variables for the build:

+
  export LANG=C
+  export PATH="/opt/SunStudioExpress/bin:${PATH}"
+
+

End of the OpenJDK build README document.

+

Please come again!

+ + diff --git a/README-builds.md b/doc/building.md similarity index 80% rename from README-builds.md rename to doc/building.md index 364fd661e3c..460e4d12668 100644 --- a/README-builds.md +++ b/doc/building.md @@ -1,9 +1,9 @@ +% OpenJDK Build README + ![OpenJDK](http://openjdk.java.net/images/openjdk.png) -# OpenJDK Build README -***** +-------------------------------------------------------------------------------- - ## Introduction This README file contains build instructions for the @@ -18,34 +18,34 @@ Some Headlines: * Any GNU make 3.81 or newer should work * The build should scale, i.e. more processors should cause the build to be done in less wall-clock time - * Nested or recursive make invocations have been significantly reduced, - as has the total fork/exec or spawning of sub processes during the build + * Nested or recursive make invocations have been significantly reduced, as + has the total fork/exec or spawning of sub processes during the build * Windows MKS usage is no longer supported * Windows Visual Studio `vsvars*.bat` and `vcvars*.bat` files are run automatically * Ant is no longer used when building the OpenJDK - * Use of ALT_* environment variables for configuring the build is no longer + * Use of ALT\_\* environment variables for configuring the build is no longer supported -***** +------------------------------------------------------------------------------- ## Contents * [Introduction](#introduction) * [Use of Mercurial](#hg) - * [Getting the Source](#get_source) - * [Repositories](#repositories) + * [Getting the Source](#get_source) + * [Repositories](#repositories) * [Building](#building) - * [System Setup](#setup) - * [Linux](#linux) - * [Solaris](#solaris) - * [Mac OS X](#macosx) - * [Windows](#windows) - * [Configure](#configure) - * [Make](#make) + * [System Setup](#setup) + * [Linux](#linux) + * [Solaris](#solaris) + * [Mac OS X](#macosx) + * [Windows](#windows) + * [Configure](#configure) + * [Make](#make) * [Testing](#testing) -***** +------------------------------------------------------------------------------- * [Appendix A: Hints and Tips](#hints) * [FAQ](#faq) @@ -54,23 +54,22 @@ Some Headlines: * [Appendix B: GNU Make Information](#gmake) * [Appendix C: Build Environments](#buildenvironments) -***** +------------------------------------------------------------------------------- - ## Use of Mercurial The OpenJDK sources are maintained with the revision control system [Mercurial](http://mercurial.selenic.com/wiki/Mercurial). If you are new to -Mercurial, please see the [Beginner Guides](http://mercurial.selenic.com/wiki/ -BeginnersGuides) or refer to the [Mercurial Book](http://hgbook.red-bean.com/). -The first few chapters of the book provide an excellent overview of Mercurial, -what it is and how it works. +Mercurial, please see the [Beginner +Guides](http://mercurial.selenic.com/wiki/BeginnersGuides) or refer to the +[Mercurial Book](http://hgbook.red-bean.com/). The first few chapters of the +book provide an excellent overview of Mercurial, what it is and how it works. For using Mercurial with the OpenJDK refer to the [Developer Guide: Installing -and Configuring Mercurial](http://openjdk.java.net/guide/ -repositories.html#installConfig) section for more information. +and Configuring +Mercurial](http://openjdk.java.net/guide/repositories.html#installConfig) +section for more information. - ### Getting the Source To get the entire set of OpenJDK Mercurial repositories use the script @@ -82,16 +81,15 @@ To get the entire set of OpenJDK Mercurial repositories use the script Once you have all the repositories, keep in mind that each repository is its own independent repository. You can also re-run `./get_source.sh` anytime to -pull over all the latest changesets in all the repositories. This set of -nested repositories has been given the term "forest" and there are various -ways to apply the same `hg` command to each of the repositories. For -example, the script `make/scripts/hgforest.sh` can be used to repeat the -same `hg` command on every repository, e.g. +pull over all the latest changesets in all the repositories. This set of nested +repositories has been given the term "forest" and there are various ways to +apply the same `hg` command to each of the repositories. For example, the +script `make/scripts/hgforest.sh` can be used to repeat the same `hg` command +on every repository, e.g. cd YourOpenJDK bash ./make/scripts/hgforest.sh status - ### Repositories The set of repositories and what they contain: @@ -134,9 +132,8 @@ There are some very basic guidelines: * Files not needed for typical building or testing of the repository should not be added to the repository. -***** +------------------------------------------------------------------------------- - ## Building The very first step in building the OpenJDK is making sure the system itself @@ -147,7 +144,7 @@ Building the OpenJDK is now done with running a `configure` script which will try and find and verify you have everything you need, followed by running `make`, e.g. -> **`bash ./configure`** +> **`bash ./configure`** \ > **`make all`** Where possible the `configure` script will attempt to located the various @@ -160,9 +157,8 @@ system due to missing software packages. **NOTE:** The `configure` script file does not have execute permissions and will need to be explicitly run with `bash`, see the source guidelines. -***** +------------------------------------------------------------------------------- - ### System Setup Before even attempting to use a system to build the OpenJDK there are some very @@ -173,15 +169,15 @@ basic system setups needed. For all systems: * Install a Bootstrap JDK. All OpenJDK builds require access to a previously - released JDK called the _bootstrap JDK_ or _boot JDK._ The general rule is + released JDK called the *bootstrap JDK* or *boot JDK.* The general rule is that the bootstrap JDK must be an instance of the previous major release of the JDK. In addition, there may be a requirement to use a release at or beyond a particular update level. - **_Building JDK 8 requires use of a version of JDK 7 this is at Update 7 + ***Building JDK 8 requires use of a version of JDK 7 this is at Update 7 or newer. JDK 8 developers should not use JDK 8 as the boot JDK, to ensure that JDK 8 dependencies are not introduced into the parts of the system - that are built with JDK 7._** + that are built with JDK 7.*** The JDK 7 binaries can be downloaded from Oracle's [JDK 7 download site](http://www.oracle.com/technetwork/java/javase/downloads/index.html). @@ -219,7 +215,6 @@ And for specific systems: install the "Command line tools" found under the preferences pane "Downloads" - #### Linux With Linux, try and favor the system packages over building your own or getting @@ -233,16 +228,14 @@ refer to the JDK installed on your Linux system. You will need to unset you are getting from the default system settings make sense for building the OpenJDK. - #### Solaris - ##### Studio Compilers -At a minimum, the [Studio 12 Update 1 Compilers](http://www.oracle.com/ -technetwork/server-storage/solarisstudio/downloads/index.htm) (containing -version 5.10 of the C and C++ compilers) is required, including specific -patches. +At a minimum, the [Studio 12 Update 1 +Compilers](http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.htm) +(containing version 5.10 of the C and C++ compilers) is required, including +specific patches. The Solaris SPARC patch list is: @@ -273,11 +266,11 @@ The Solaris X86 patch list is: Place the `bin` directory in `PATH`. The Oracle Solaris Studio Express compilers at: [Oracle Solaris Studio Express -Download site](http://www.oracle.com/technetwork/server-storage/solarisstudio/ -downloads/index-jsp-142582.html) are also an option, although these compilers -have not been extensively used yet. +Download +site](http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index-jsp-142582.html) +are also an option, although these compilers have not been extensively used +yet. - #### Windows ##### Windows Unix Toolkit @@ -295,7 +288,6 @@ backslashes to forward slashes, escaping backslashes with additional backslashes and translating the path names to their ["8.3" version](http://en.wikipedia.org/wiki/8.3_filename). - ###### CYGWIN CYGWIN is an open source, Linux-like environment which tries to emulate a @@ -323,80 +315,24 @@ By default CYGWIN doesn't install all the tools required for building the OpenJDK. Along with the default installation, you need to install the following tools. -> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Binary NameCategoryPackageDescription
ar.exeDevelbinutilsThe GNU assembler, linker and binary utilities
make.exeDevelmakeThe GNU version of the 'make' utility built for CYGWIN
m4.exeInterpretersm4GNU implementation of the traditional Unix macro processor
cpio.exeUtilscpioA program to manage archives of files
gawk.exeUtilsawkPattern-directed scanning and processing language
file.exeUtilsfileDetermines file type using 'magic' numbers
zip.exeArchivezipPackage and compress (archive) files
unzip.exeArchiveunzipExtract compressed files in a ZIP archive
free.exeSystemprocpsDisplay amount of free and used memory in the system
+ Binary Name Category Package Description + ------------- -------------- ---------- ------------------------------------------------------------ + ar.exe Devel binutils The GNU assembler, linker and binary utilities + make.exe Devel make The GNU version of the 'make' utility built for CYGWIN + m4.exe Interpreters m4 GNU implementation of the traditional Unix macro processor + cpio.exe Utils cpio A program to manage archives of files + gawk.exe Utils awk Pattern-directed scanning and processing language + file.exe Utils file Determines file type using 'magic' numbers + zip.exe Archive zip Package and compress (archive) files + unzip.exe Archive unzip Extract compressed files in a ZIP archive + free.exe System procps Display amount of free and used memory in the system Note that the CYGWIN software can conflict with other non-CYGWIN software on -your Windows system. CYGWIN provides a [FAQ](http://cygwin.com/faq/ -faq.using.html) for known issues and problems, of particular interest is the -section on [BLODA (applications that interfere with -CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda). +your Windows system. CYGWIN provides a +[FAQ](http://cygwin.com/faq/faq.using.html) for known issues and problems, +of particular interest is the section on [BLODA (applications that interfere +with CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda). - ###### MinGW/MSYS MinGW ("Minimalist GNU for Windows") is a collection of free Windows specific @@ -404,20 +340,20 @@ header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs. MSYS is a supplement to MinGW which allows building applications and programs which rely on traditional UNIX tools to be present. Among others this -includes tools like `bash` and `make`. See [MinGW/MSYS](http://www.mingw.org/ -wiki/MSYS) for more information. +includes tools like `bash` and `make`. See +[MinGW/MSYS](http://www.mingw.org/wiki/MSYS) for more information. Like Cygwin, MinGW/MSYS can handle different types of path formats. They are -internally converted to paths with forward slashes and drive letters -`:` replaced by a virtual directory `/`. Additionally, MSYS -automatically detects binaries compiled for the MSYS environment and feeds them -with the internal, Unix-style path names. If native Windows applications are -called from within MSYS programs their path arguments are automatically -converted back to Windows style path names with drive letters and backslashes -as path separators. This may cause problems for Windows applications which use -forward slashes as parameter separator (e.g. `cl /nologo /I`) because MSYS may -wrongly [replace such parameters by drive letters](http://mingw.org/wiki/ -Posix_path_conversion). +internally converted to paths with forward slashes and drive letters `:` +replaced by a virtual directory `/`. Additionally, MSYS automatically +detects binaries compiled for the MSYS environment and feeds them with the +internal, Unix-style path names. If native Windows applications are called from +within MSYS programs their path arguments are automatically converted back to +Windows style path names with drive letters and backslashes as path separators. +This may cause problems for Windows applications which use forward slashes as +parameter separator (e.g. `cl /nologo /I`) because MSYS may wrongly [replace +such parameters by drive +letters](http://mingw.org/wiki/Posix_path_conversion). In addition to the tools which will be installed by default, you have to manually install the `msys-zip` and `msys-unzip` packages. This can be easily @@ -426,7 +362,6 @@ done with the MinGW command line installer: mingw-get.exe install msys-zip mingw-get.exe install msys-unzip - ##### Visual Studio 2010 Compilers The 32-bit and 64-bit OpenJDK Windows build requires Microsoft Visual Studio @@ -445,14 +380,12 @@ and not `C:/temp`. `C:\temp` is just an example, it is assumed that this area is private to the user, so by default after installs you should see a unique user path in these variables. - #### Mac OS X Make sure you get the right XCode version. -***** +------------------------------------------------------------------------------- - ### Configure The basic invocation of the `configure` script looks like: @@ -472,14 +405,12 @@ happens, read more below in [the `configure` options](#configureoptions). Some examples: -> **Windows 32bit build with freetype specified:** -> `bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target- -bits=32` +> **Windows 32bit build with freetype specified:** \ +> `bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32` -> **Debug 64bit Build:** +> **Debug 64bit Build:** \ > `bash ./configure --enable-debug --with-target-bits=64` - #### Configure Options Complete details on all the OpenJDK `configure` options can be seen with: @@ -491,12 +422,13 @@ number of different configurations, e.g. debug, release, 32, 64, etc. Some of the more commonly used `configure` options are: -> **`--enable-debug`** -> set the debug level to fastdebug (this is a shorthand for `--with-debug- - level=fastdebug`) +> **`--enable-debug`** \ +> set the debug level to fastdebug (this is a shorthand for +> `--with-debug-level=fastdebug`) -> **`--with-alsa=`**_path_ + +> **`--with-alsa=`**_path_ \ > select the location of the Advanced Linux Sound Architecture (ALSA) > Version 0.9.1 or newer of the ALSA files are required for building the @@ -505,29 +437,31 @@ Some of the more commonly used `configure` options are: and use the package provided by the particular version of Linux that you are using. -> **`--with-boot-jdk=`**_path_ +> **`--with-boot-jdk=`**_path_ \ > select the [Bootstrap JDK](#bootjdk) -> **`--with-boot-jdk-jvmargs=`**"_args_" +> **`--with-boot-jdk-jvmargs=`**"_args_" \ > provide the JVM options to be used to run the [Bootstrap JDK](#bootjdk) -> **`--with-cacerts=`**_path_ +> **`--with-cacerts=`**_path_ \ > select the path to the cacerts file. -> See [Certificate Authority on Wikipedia](http://en.wikipedia.org/wiki/ - Certificate_Authority) for a better understanding of the Certificate - Authority (CA). A certificates file named "cacerts" represents a system-wide - keystore with CA certificates. In JDK and JRE binary bundles, the "cacerts" - file contains root CA certificates from several public CAs (e.g., VeriSign, - Thawte, and Baltimore). The source contain a cacerts file without CA root - certificates. Formal JDK builders will need to secure permission from each - public CA and include the certificates into their own custom cacerts file. - Failure to provide a populated cacerts file will result in verification - errors of a certificate chain during runtime. By default an empty cacerts - file is provided and that should be fine for most JDK developers. +> See [Certificate Authority on + Wikipedia](http://en.wikipedia.org/wiki/Certificate_Authority) for a + better understanding of the Certificate Authority (CA). A certificates file + named "cacerts" represents a system-wide keystore with CA certificates. In + JDK and JRE binary bundles, the "cacerts" file contains root CA certificates + from several public CAs (e.g., VeriSign, Thawte, and Baltimore). The source + contain a cacerts file without CA root certificates. Formal JDK builders will + need to secure permission from each public CA and include the certificates + into their own custom cacerts file. Failure to provide a populated cacerts + file will result in verification errors of a certificate chain during + runtime. By default an empty cacerts file is provided and that should be fine + for most JDK developers. -> **`--with-cups=`**_path_ + +> **`--with-cups=`**_path_ \ > select the CUPS install location > The Common UNIX Printing System (CUPS) Headers are required for building the @@ -538,17 +472,18 @@ Some of the more commonly used `configure` options are: > The CUPS header files can always be downloaded from [www.cups.org](http://www.cups.org). -> **`--with-cups-include=`**_path_ +> **`--with-cups-include=`**_path_ \ > select the CUPS include directory location -> **`--with-debug-level=`**_level_ +> **`--with-debug-level=`**_level_ \ > select the debug information level of release, fastdebug, or slowdebug -> **`--with-dev-kit=`**_path_ +> **`--with-dev-kit=`**_path_ \ > select location of the compiler install or developer install location -> **`--with-freetype=`**_path_ + +> **`--with-freetype=`**_path_ \ > select the freetype files to use. > Expecting the freetype libraries under `lib/` and the headers under @@ -570,32 +505,33 @@ Some of the more commonly used `configure` options are: [SourceForge FreeType2 Home Page](http://freetype.sourceforge.net/freetype2) for more information. -> **`--with-import-hotspot=`**_path_ +> **`--with-import-hotspot=`**_path_ \ > select the location to find hotspot binaries from a previous build to avoid building hotspot -> **`--with-target-bits=`**_arg_ +> **`--with-target-bits=`**_arg_ \ > select 32 or 64 bit build -> **`--with-jvm-variants=`**_variants_ +> **`--with-jvm-variants=`**_variants_ \ > select the JVM variants to build from, comma separated list that can include: server, client, kernel, zero and zeroshark -> **`--with-memory-size=`**_size_ +> **`--with-memory-size=`**_size_ \ > select the RAM size that GNU make will think this system has -> **`--with-msvcr-dll=`**_path_ +> **`--with-msvcr-dll=`**_path_ \ > select the `msvcr100.dll` file to include in the Windows builds (C/C++ runtime library for Visual Studio). > This is usually picked up automatically from the redist directories of Visual Studio 2010. -> **`--with-num-cores=`**_cores_ +> **`--with-num-cores=`**_cores_ \ > select the number of cores to use (processor count or CPU count) -> **`--with-x=`**_path_ + +> **`--with-x=`**_path_ \ > select the location of the X11 and xrender files. > The XRender Extension Headers are required for building the OpenJDK on @@ -607,9 +543,8 @@ Some of the more commonly used `configure` options are: installed in `/usr/X11/include/X11/extensions/Xrender.h` or `/usr/openwin/share/include/X11/extensions/Xrender.h` -***** +------------------------------------------------------------------------------- - ### Make The basic invocation of the `make` utility looks like: @@ -622,34 +557,33 @@ more information on the available targets. There are some of the make targets that are of general interest: -> _empty_ +> _empty_ \ > build everything but no images -> **`all`** +> **`all`** \ > build everything including images -> **`all-conf`** +> **`all-conf`** \ > build all configurations -> **`images`** +> **`images`** \ > create complete j2sdk and j2re images -> **`install`** +> **`install`** \ > install the generated images locally, typically in `/usr/local` -> **`clean`** +> **`clean`** \ > remove all files generated by make, but not those generated by `configure` -> **`dist-clean`** +> **`dist-clean`** \ > remove all files generated by both and `configure` (basically killing the configuration) -> **`help`** +> **`help`** \ > give some help on using `make`, including some interesting make targets -***** +------------------------------------------------------------------------------- - ## Testing When the build is completed, you should see the generated binaries and @@ -662,35 +596,33 @@ repositories can be run with the command: > **``cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all``** -***** +------------------------------------------------------------------------------- - ## Appendix A: Hints and Tips - ### FAQ **Q:** The `generated-configure.sh` file looks horrible! How are you going to -edit it? +edit it? \ **A:** The `generated-configure.sh` file is generated (think "compiled") by the autoconf tools. The source code is in `configure.ac` and various .m4 files in common/autoconf, which are much more readable. -**Q:** Why is the `generated-configure.sh` file checked in, if it is -generated? +**Q:** Why is the `generated-configure.sh` file checked in, if it is +generated? \ **A:** If it was not generated, every user would need to have the autoconf tools installed, and re-generate the `configure` file as the first step. Our goal is to minimize the work needed to be done by the user to start building OpenJDK, and to minimize the number of external dependencies required. **Q:** Do you require a specific version of autoconf for regenerating -`generated-configure.sh`? +`generated-configure.sh`? \ **A:** Yes, version 2.69 is required and should be easy enough to aquire on all supported operating systems. The reason for this is to avoid large spurious changes in `generated-configure.sh`. **Q:** How do you regenerate `generated-configure.sh` after making changes to -the input files? +the input files? \ **A:** Regnerating `generated-configure.sh` should always be done using the script `common/autoconf/autogen.sh` to ensure that the correct files get updated. This script should also be run after mercurial tries to merge @@ -698,7 +630,7 @@ updated. This script should also be run after mercurial tries to merge be correct. **Q:** What are the files in `common/makefiles/support/*` for? They look like -gibberish. +gibberish. \ **A:** They are a somewhat ugly hack to compensate for command line length limitations on certain platforms (Windows, Solaris). Due to a combination of limitations in make and the shell, command lines containing too many files will @@ -708,21 +640,21 @@ not proud of it, but it does fix the problem. If you have any better suggestions, we're all ears! :-) **Q:** I want to see the output of the commands that make runs, like in the old -build. How do I do that? +build. How do I do that? \ **A:** You specify the `LOG` variable to make. There are several log levels: * **`warn`** -- Default and very quiet. * **`info`** -- Shows more progress information than warn. * **`debug`** -- Echos all command lines and prints all macro calls for compilation definitions. - * **`trace`** -- Echos all $(shell) command lines as well. + * **`trace`** -- Echos all \$(shell) command lines as well. -**Q:** When do I have to re-run `configure`? +**Q:** When do I have to re-run `configure`? \ **A:** Normally you will run `configure` only once for creating a configuration. You need to re-run configuration only if you want to change any configuration options, or if you pull down changes to the `configure` script. -**Q:** I have added a new source file. Do I need to modify the makefiles? +**Q:** I have added a new source file. Do I need to modify the makefiles? \ **A:** Normally, no. If you want to create e.g. a new native library, you will need to modify the makefiles. But for normal file additions or removals, no changes are needed. There are certan exceptions for some native libraries where @@ -731,20 +663,21 @@ for other libraries. In these cases it was simply easier to create include lists rather than excludes. **Q:** When I run `configure --help`, I see many strange options, like -`--dvidir`. What is this? +`--dvidir`. What is this? \ **A:** Configure provides a slew of options by default, to all projects that use autoconf. Most of them are not used in OpenJDK, so you can safely ignore them. To list only OpenJDK specific features, use `configure --help=short` instead. -**Q:** `configure` provides OpenJDK-specific features such as `--with- -builddeps-server` that are not described in this document. What about those? +**Q:** `configure` provides OpenJDK-specific features such as +`--with-builddeps-server` that are not described in this document. What about +those? \ **A:** Try them out if you like! But be aware that most of these are experimental features. Many of them don't do anything at all at the moment; the option is just a placeholder. Others depend on pieces of code or infrastructure that is currently not ready for prime time. -**Q:** How will you make sure you don't break anything? +**Q:** How will you make sure you don't break anything? \ **A:** We have a script that compares the result of the new build system with the result of the old. For most part, we aim for (and achieve) byte-by-byte identical output. There are however technical issues with e.g. native binaries, @@ -754,7 +687,7 @@ table and file size). Note that we still don't have 100% equivalence, but we're close. **Q:** I noticed this thing X in the build that looks very broken by design. -Why don't you fix it? +Why don't you fix it? \ **A:** Our goal is to produce a build output that is as close as technically possible to the old build output. If things were weird in the old build, they will be weird in the new build. Often, things were weird before due to @@ -763,14 +696,14 @@ The plan is to attack these things at a later stage, after the new build system is established. **Q:** The code in the new build system is not that well-structured. Will you -fix this? +fix this? \ **A:** Yes! The new build system has grown bit by bit as we converted the old system. When all of the old build system is converted, we can take a step back and clean up the structure of the new build system. Some of this we plan to do before replacing the old build system and some will need to wait until after. **Q:** Is anything able to use the results of the new build's default make -target? +target? \ **A:** Yes, this is the minimal (or roughly minimal) set of compiled output needed for a developer to actually execute the newly built JDK. The idea is that in an incremental development fashion, when doing a normal make, you @@ -782,12 +715,11 @@ it's still unnecessary. We're targeting sub-second incremental rebuilds! ;-) (Or, well, at least single-digit seconds...) **Q:** I usually set a specific environment variable when building, but I can't -find the equivalent in the new build. What should I do? +find the equivalent in the new build. What should I do? \ **A:** It might very well be that we have neglected to add support for an option that was actually used from outside the build system. Email us and we will add support for it! - ### Build Performance Tips Building OpenJDK requires a lot of horsepower. Some of the build tools can be @@ -858,7 +790,6 @@ and override with fast if you're impatient, you should call `configure` with `--with-num-cores=2`, making 2 the default. If you want to run with more cores, run `make JOBS=8` - ### Troubleshooting #### Solving build problems @@ -886,7 +817,7 @@ difficulties that `configure` had in finding things. Some of the more common problems with builds are briefly described below, with suggestions for remedies. - * **Corrupted Bundles on Windows:** + * **Corrupted Bundles on Windows:** \ Some virus scanning software has been known to corrupt the downloading of zip bundles. It may be necessary to disable the 'on access' or 'real time' virus scanning features to prevent this corruption. This type of 'real time' @@ -894,7 +825,7 @@ suggestions for remedies. Temporarily disabling the feature, or excluding the build output directory may be necessary to get correct and faster builds. - * **Slow Builds:** + * **Slow Builds:** \ If your build machine seems to be overloaded from too many simultaneous C++ compiles, try setting the `JOBS=1` on the `make` command line. Then try increasing the count slowly to an acceptable level for your system. Also: @@ -909,10 +840,10 @@ suggestions for remedies. Faster compiles are possible using a tool called [ccache](http://ccache.samba.org/). - * **File time issues:** + * **File time issues:** \ If you see warnings that refer to file time stamps, e.g. - > _Warning message:_ ` File 'xxx' has modification time in the future.` + > _Warning message:_ ` File 'xxx' has modification time in the future.` \ > _Warning message:_ ` Clock skew detected. Your build may be incomplete.` These warnings can occur when the clock on the build machine is out of sync @@ -925,7 +856,7 @@ suggestions for remedies. "`gmake clobber`" or delete the directory containing the build output, and restart the build from the beginning. - * **Error message: `Trouble writing out table to disk`** + * **Error message: `Trouble writing out table to disk`** \ Increase the amount of swap space on your build machine. This could be caused by overloading the system and it may be necessary to use: @@ -933,7 +864,7 @@ suggestions for remedies. to reduce the load on the system. - * **Error Message: `libstdc++ not found`:** + * **Error Message: `libstdc++ not found`:** \ This is caused by a missing libstdc++.a library. This is installed as part of a specific package (e.g. libstdc++.so.devel.386). By default some 64-bit Linux versions (e.g. Fedora) only install the 64-bit version of the @@ -941,7 +872,7 @@ suggestions for remedies. the C++ runtime libraries to allow for maximum portability of the built images. - * **Linux Error Message: `cannot restore segment prot after reloc`** + * **Linux Error Message: `cannot restore segment prot after reloc`** \ This is probably an issue with SELinux (See [SELinux on Wikipedia](http://en.wikipedia.org/wiki/SELinux)). Parts of the VM is built without the `-fPIC` for performance reasons. @@ -956,31 +887,30 @@ suggestions for remedies. Alternatively, instead of completely disabling it you could disable just this one check. - 1. Select System->Administration->SELinux Management + 1. Select System->Administration->SELinux Management 2. In the SELinux Management Tool which appears, select "Boolean" from the menu on the left 3. Expand the "Memory Protection" group 4. Check the first item, labeled "Allow all unconfined executables to use libraries requiring text relocation ..." - * **Windows Error Messages:** - `*** fatal error - couldn't allocate heap, ... ` - `rm fails with "Directory not empty"` - `unzip fails with "cannot create ... Permission denied"` + * **Windows Error Messages:** \ + `*** fatal error - couldn't allocate heap, ... ` \ + `rm fails with "Directory not empty"` \ + `unzip fails with "cannot create ... Permission denied"` \ `unzip fails with "cannot create ... Error 50"` The CYGWIN software can conflict with other non-CYGWIN software. See the CYGWIN FAQ section on [BLODA (applications that interfere with CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda). - * **Windows Error Message: `spawn failed`** + * **Windows Error Message: `spawn failed`** \ Try rebooting the system, or there could be some kind of issue with the disk or disk partition being used. Sometimes it comes with a "Permission Denied" message. -***** +------------------------------------------------------------------------------- - ## Appendix B: GNU make The Makefiles in the OpenJDK are only valid when used with the GNU version of @@ -998,11 +928,10 @@ about using GNU make: * **Mac OS X:** The XCode "command line tools" must be installed on your Mac. Information on GNU make, and access to ftp download sites, are available on the -[GNU make web site ](http://www.gnu.org/software/make/make.html). The latest +[GNU make web site](http://www.gnu.org/software/make/make.html). The latest source to GNU make is available at [ftp.gnu.org/pub/gnu/make/](http://ftp.gnu.org/pub/gnu/make/). - ### Building GNU make First step is to get the GNU make 3.81 or newer source from @@ -1012,9 +941,8 @@ little different depending on the OS but is basically done with: bash ./configure make -***** +------------------------------------------------------------------------------- - ## Appendix C: Build Environments ### Minimum Build Environments @@ -1062,79 +990,19 @@ problem. Similarly, compilation problems related to changes to the newer, or unreleased OS versions. Please report these types of problems as bugs so that they can be dealt with accordingly. -> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Base OS and ArchitectureOSC/C++ CompilerBootstrap JDKProcessorsRAM MinimumDISK Needs
Linux X86 (32-bit) and X64 (64-bit)Fedora 9gcc 4.3 JDK 7u72 or more1 GB6 GB
Solaris SPARC (32-bit) and SPARCV9 (64-bit)Solaris 10 Update 6Studio 12 Update 1 + patchesJDK 7u74 or more4 GB8 GB
Solaris X86 (32-bit) and X64 (64-bit)Solaris 10 Update 6Studio 12 Update 1 + patchesJDK 7u74 or more4 GB8 GB
Windows X86 (32-bit)Windows XPMicrosoft Visual Studio C++ 2010 Professional EditionJDK 7u72 or more2 GB6 GB
Windows X64 (64-bit)Windows Server 2003 - Enterprise x64 EditionMicrosoft Visual Studio C++ 2010 Professional EditionJDK 7u72 or more2 GB6 GB
Mac OS X X64 (64-bit)Mac OS X 10.7 "Lion"XCode 4.5.2 or newerJDK 7u72 or more4 GB6 GB
- -***** - - +Bootstrap JDK: JDK 7u7 + + Base OS and Architecture OS C/C++ Compiler Processors RAM Minimum DISK Needs + --------------------------------------------- ---------------------------------------------- ------------------------------------------------------- ------------ ------------- ------------ + Linux X86 (32-bit) and X64 (64-bit) Fedora 9 gcc 4.3 2 or more 1 GB 6 GB + Solaris SPARC (32-bit) and SPARCV9 (64-bit) Solaris 10 Update 6 Studio 12 Update 1 + patches 4 or more 4 GB 8 GB + Solaris X86 (32-bit) and X64 (64-bit) Solaris 10 Update 6 Studio 12 Update 1 + patches 4 or more 4 GB 8 GB + Windows X86 (32-bit) Windows XP Microsoft Visual Studio C++ 2010 Professional Edition 2 or more 2 GB 6 GB + Windows X64 (64-bit) Windows Server 2003 - Enterprise x64 Edition Microsoft Visual Studio C++ 2010 Professional Edition 2 or more 2 GB 6 GB + Mac OS X X64 (64-bit) Mac OS X 10.7 "Lion" XCode 4.5.2 or newer 2 or more 4 GB 6 GB + +------------------------------------------------------------------------------- + ### Specific Developer Build Environments We won't be listing all the possible environments, but we will try to provide @@ -1259,7 +1127,7 @@ In addition, it is necessary to set a few environment variables for the build: export LANG=C export PATH="/opt/SunStudioExpress/bin:${PATH}" -***** +------------------------------------------------------------------------------- End of the OpenJDK build README document. diff --git a/hotspot/README b/hotspot/README deleted file mode 100644 index 19afb261fc3..00000000000 --- a/hotspot/README +++ /dev/null @@ -1,14 +0,0 @@ -README: - This file should be located at the top of the hotspot Mercurial repository. - - See http://openjdk.java.net/ for more information about the OpenJDK. - - See ../README-builds.html for complete details on build machine requirements. - -Simple Build Instructions: - - cd make && gnumake - - The files that will be imported into the jdk build will be in the "build" - directory. - diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index c66f3102b9e..d1a987c6991 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -85,6 +85,7 @@ void PhiResolverState::reset(int max_vregs) { PhiResolver::PhiResolver(LIRGenerator* gen, int max_vregs) : _gen(gen) , _state(gen->resolver_state()) + , _loop(NULL) , _temp(LIR_OprFact::illegalOpr) { // reinitialize the shared state arrays diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index 89bcc4b98aa..0330ca595cc 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, 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 @@ -363,8 +363,8 @@ class nmethod : public CodeBlob { // type info bool is_nmethod() const { return true; } - bool is_java_method() const { return !method()->is_native(); } - bool is_native_method() const { return method()->is_native(); } + bool is_java_method() const { return _method != NULL && !method()->is_native(); } + bool is_native_method() const { return _method != NULL && method()->is_native(); } bool is_osr_method() const { return _entry_bci != InvocationEntryBci; } bool is_compiled_by_c1() const; diff --git a/hotspot/test/TEST.ROOT b/hotspot/test/TEST.ROOT index c88dcf29558..55ec2d61184 100644 --- a/hotspot/test/TEST.ROOT +++ b/hotspot/test/TEST.ROOT @@ -37,3 +37,7 @@ requires.extraPropDefns = ../../test/jtreg-ext/requires/VMProps.java requires.properties=sun.arch.data.model \ vm.flavor \ vm.bits + +# Path to libraries in the topmost test directory. This is needed so @library +# does not need ../../ notation to reach them +external.lib.roots = ../../ diff --git a/hotspot/test/runtime/memory/ReserveMemory.java b/hotspot/test/runtime/memory/ReserveMemory.java index 9e37d52ccda..abb5a8193a7 100644 --- a/hotspot/test/runtime/memory/ReserveMemory.java +++ b/hotspot/test/runtime/memory/ReserveMemory.java @@ -21,10 +21,12 @@ * questions. */ +// Aix commits on touch, so this test won't work. /* * @test * @key regression * @bug 8012015 + * @requires !(os.family == "aix") * @summary Make sure reserved (but uncommitted) memory is not accessible * @library /testlibrary /testlibrary/whitebox * @build ReserveMemory @@ -37,14 +39,6 @@ import sun.hotspot.WhiteBox; public class ReserveMemory { - private static boolean isWindows() { - return System.getProperty("os.name").toLowerCase().startsWith("win"); - } - - private static boolean isOsx() { - return System.getProperty("os.name").toLowerCase().startsWith("mac"); - } - public static void main(String args[]) throws Exception { if (args.length > 0) { WhiteBox.getWhiteBox().readReservedMemory(); @@ -61,9 +55,9 @@ public static void main(String args[]) throws Exception { "test"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - if (isWindows()) { + if (Platform.isWindows()) { output.shouldContain("EXCEPTION_ACCESS_VIOLATION"); - } else if (isOsx()) { + } else if (Platform.isOSX()) { output.shouldContain("SIGBUS"); } else { output.shouldContain("SIGSEGV"); diff --git a/jaxp/README b/jaxp/README deleted file mode 100644 index 4d65125b34c..00000000000 --- a/jaxp/README +++ /dev/null @@ -1,19 +0,0 @@ -README: - - This file should be located at the top of the Mercurial repository. - - See http://openjdk.java.net/ for more information about the OpenJDK. - - See ../README-builds.html for complete details on build machine requirements. - -Simple Build Instructions: - This repository can be loaded as a NetBeans project, built with ant, or - built with GNU make, e.g. - ant - -OR- - cd make && gnumake - - The built files that will be imported into the jdk build will be in the - "dist" directory. - Help information is available by running "ant -projecthelp" or "make help". - diff --git a/jaxws/README b/jaxws/README deleted file mode 100644 index 4d65125b34c..00000000000 --- a/jaxws/README +++ /dev/null @@ -1,19 +0,0 @@ -README: - - This file should be located at the top of the Mercurial repository. - - See http://openjdk.java.net/ for more information about the OpenJDK. - - See ../README-builds.html for complete details on build machine requirements. - -Simple Build Instructions: - This repository can be loaded as a NetBeans project, built with ant, or - built with GNU make, e.g. - ant - -OR- - cd make && gnumake - - The built files that will be imported into the jdk build will be in the - "dist" directory. - Help information is available by running "ant -projecthelp" or "make help". - diff --git a/jdk/README b/jdk/README deleted file mode 100644 index fec16f9520d..00000000000 --- a/jdk/README +++ /dev/null @@ -1,29 +0,0 @@ -README: - This file should be located at the top of the jdk Mercurial repository. - - See http://openjdk.java.net/ for more information about the OpenJDK. - -Simple Build Instructions: - - 1. Download and install a JDK 6 from - http://java.sun.com/javase/downloads/index.jsp - Set the environment variable ALT_BOOTDIR to the location of this JDK 6. - - 2. Either download and install the latest JDK7 from - http://download.java.net/openjdk/jdk7/, or build your own complete - OpenJDK7 by using the top level Makefile in the OpenJDK Mercurial forest. - Set the environment variable ALT_JDK_IMPORT_PATH to the location of - this latest JDK7 or OpenJDK7 build. - - 3. Check the sanity of doing a build with the current machine: - cd make && gnumake sanity - See README-builds.html if you run into problems. - - 4. Do a partial build of the jdk: - cd make && gnumake all - - 5. Construct the images: - cd make && gnumake images - The resulting JDK image should be found in build/*/j2sdk-image - - diff --git a/jdk/make/CompileLaunchers.gmk b/jdk/make/CompileLaunchers.gmk index 1f414e2e05d..61973b3bd61 100644 --- a/jdk/make/CompileLaunchers.gmk +++ b/jdk/make/CompileLaunchers.gmk @@ -281,10 +281,17 @@ $(eval $(call SetupLauncher,jar, \ $(eval $(call SetupLauncher,jarsigner, \ -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.jarsigner.Main"$(COMMA) }')) +# On s390 zero, run javac with larger stack +ifeq ($(OPENJDK_TARGET_CPU), s390x) +JAVAC_ARGS := '{ "-J-ms8m"$(COMMA) "-J-Xss3m"$(COMMA) "com.sun.tools.javac.Main"$(COMMA) }' +else +JAVAC_ARGS := '{ "-J-ms8m"$(COMMA) "com.sun.tools.javac.Main"$(COMMA) }' +endif + $(eval $(call SetupLauncher,javac, \ -DEXPAND_CLASSPATH_WILDCARDS \ -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \ - -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javac.Main"$(COMMA) }')) + -DJAVA_ARGS=$(JAVAC_ARGS))) ifeq ($(ENABLE_SJAVAC), yes) $(eval $(call SetupLauncher,sjavac, \ diff --git a/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java b/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java index a196ddcd76e..7bc1664f9c2 100644 --- a/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, 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 @@ -31,6 +31,7 @@ import java.io.InputStreamReader; import java.net.URL; import java.net.URLClassLoader; +import java.security.AccessController; import java.util.ArrayList; import java.util.Objects; import javax.sound.midi.InvalidMidiDataException; @@ -38,6 +39,7 @@ import javax.sound.midi.spi.SoundbankReader; import sun.reflect.misc.ReflectUtil; +import sun.security.action.GetBooleanAction; /** * JarSoundbankReader is used to read soundbank object from jar files. @@ -46,12 +48,15 @@ */ public final class JARSoundbankReader extends SoundbankReader { - /* - * Name of the system property that enables the Jar soundbank loading - * true if jar sound bank is allowed to be loaded - * default is false + /** + * Value of the system property that enables the Jar soundbank loading + * {@code true} if jar sound bank is allowed to be loaded default is + * {@code false}. */ - private final static String JAR_SOUNDBANK_ENABLED = "jdk.sound.jarsoundbank"; + @SuppressWarnings("removal") + private static final boolean JAR_SOUNDBANK_ENABLED = + AccessController.doPrivileged( + new GetBooleanAction("jdk.sound.jarsoundbank")); private static boolean isZIP(URL url) { boolean ok = false; @@ -77,7 +82,7 @@ private static boolean isZIP(URL url) { public Soundbank getSoundbank(URL url) throws InvalidMidiDataException, IOException { Objects.requireNonNull(url); - if (!Boolean.getBoolean(JAR_SOUNDBANK_ENABLED) || !isZIP(url)) + if (!JAR_SOUNDBANK_ENABLED || !isZIP(url)) return null; ArrayList soundbanks = new ArrayList(); diff --git a/jdk/src/share/classes/java/util/jar/JarFile.java b/jdk/src/share/classes/java/util/jar/JarFile.java index a26dcc4a1c7..ac2e1c9d6a8 100644 --- a/jdk/src/share/classes/java/util/jar/JarFile.java +++ b/jdk/src/share/classes/java/util/jar/JarFile.java @@ -436,7 +436,9 @@ private byte[] getBytes(ZipEntry ze) throws IOException { throw new IOException("Unsupported size: " + uncompressedSize + " for JarEntry " + ze.getName() + ". Allowed max size: " + - SignatureFileVerifier.MAX_SIG_FILE_SIZE + " bytes"); + SignatureFileVerifier.MAX_SIG_FILE_SIZE + " bytes. " + + "You can use the jdk.jar.maxSignatureFileSize " + + "system property to increase the default value."); } int len = (int)uncompressedSize; byte[] b = IOUtils.readAllBytes(is); diff --git a/jdk/src/share/classes/javax/security/auth/kerberos/package-info.java b/jdk/src/share/classes/javax/security/auth/kerberos/package-info.java index 293745479d8..0853663a1f2 100644 --- a/jdk/src/share/classes/javax/security/auth/kerberos/package-info.java +++ b/jdk/src/share/classes/javax/security/auth/kerberos/package-info.java @@ -48,6 +48,12 @@ * {@code /lib/security} and failing that, in an OS-specific * location.

* + * The {@code krb5.conf} file is formatted in the Windows INI file style, + * which contains a series of relations grouped into different sections. + * Each relation contains a key and a value, the value can be an arbitrary + * string or a boolean value. A boolean value can be one of "true", "false", + * "yes", or "no", case-insensitive.

+ * * @since JDK1.4 */ package javax.security.auth.kerberos; diff --git a/jdk/src/share/classes/sun/security/krb5/Config.java b/jdk/src/share/classes/sun/security/krb5/Config.java index 117acb840c8..3b4a52b5f3c 100644 --- a/jdk/src/share/classes/sun/security/krb5/Config.java +++ b/jdk/src/share/classes/sun/security/krb5/Config.java @@ -449,23 +449,6 @@ public int getIntValue(String... keys) { return value; } - /** - * Gets the boolean value for the specified keys. - * @param keys the keys - * @return the boolean value, false is returned if it cannot be - * found or the value is not "true" (case insensitive). - * @throw IllegalArgumentException if any of the keys is illegal - * @see #get(java.lang.String[]) - */ - public boolean getBooleanValue(String... keys) { - String val = get(keys); - if (val != null && val.equalsIgnoreCase("true")) { - return true; - } else { - return false; - } - } - /** * Parses a string to an integer. The convertible strings include the * string representations of positive integers, negative integers, and @@ -474,7 +457,7 @@ public boolean getBooleanValue(String... keys) { * * @param input the String to be converted to an Integer. * @return an numeric value represented by the string - * @exception NumberFormationException if the String does not contain a + * @exception NumberFormatException if the String does not contain a * parsable integer. */ private int parseIntValue(String input) throws NumberFormatException { @@ -1060,20 +1043,13 @@ public void resetDefaultRealm(String realm) { * use addresses if "no_addresses" or "noaddresses" is set to false */ public boolean useAddresses() { - boolean useAddr = false; - // use addresses if "no_addresses" is set to false - String value = get("libdefaults", "no_addresses"); - useAddr = (value != null && value.equalsIgnoreCase("false")); - if (useAddr == false) { - // use addresses if "noaddresses" is set to false - value = get("libdefaults", "noaddresses"); - useAddr = (value != null && value.equalsIgnoreCase("false")); - } - return useAddr; + return getBooleanObject("libdefaults", "no_addresses") == Boolean.FALSE || + getBooleanObject("libdefaults", "noaddresses") == Boolean.FALSE; } /** - * Check if need to use DNS to locate Kerberos services + * Check if need to use DNS to locate Kerberos services for name. If not + * defined, check dns_fallback, whose default value is true. */ private boolean useDNS(String name, boolean defaultValue) { Boolean value = getBooleanObject("libdefaults", name); diff --git a/jdk/src/share/classes/sun/security/krb5/internal/KDCOptions.java b/jdk/src/share/classes/sun/security/krb5/internal/KDCOptions.java index d9fdf43d616..76a71cb603c 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/KDCOptions.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/KDCOptions.java @@ -301,14 +301,14 @@ private void setDefault() { if ((options & KDC_OPT_RENEWABLE_OK) == KDC_OPT_RENEWABLE_OK) { set(RENEWABLE_OK, true); } else { - if (config.getBooleanValue("libdefaults", "renewable")) { + if (config.getBooleanObject("libdefaults", "renewable") == Boolean.TRUE) { set(RENEWABLE_OK, true); } } if ((options & KDC_OPT_PROXIABLE) == KDC_OPT_PROXIABLE) { set(PROXIABLE, true); } else { - if (config.getBooleanValue("libdefaults", "proxiable")) { + if (config.getBooleanObject("libdefaults", "proxiable") == Boolean.TRUE) { set(PROXIABLE, true); } } @@ -316,7 +316,7 @@ private void setDefault() { if ((options & KDC_OPT_FORWARDABLE) == KDC_OPT_FORWARDABLE) { set(FORWARDABLE, true); } else { - if (config.getBooleanValue("libdefaults", "forwardable")) { + if (config.getBooleanObject("libdefaults", "forwardable") == Boolean.TRUE) { set(FORWARDABLE, true); } } diff --git a/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java b/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java index abccce82415..2f314c9c09e 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java @@ -58,8 +58,8 @@ public static void initStatic() { boolean allowed = false; try { Config cfg = Config.getInstance(); - String temp = cfg.get("libdefaults", "allow_weak_crypto"); - if (temp != null && temp.equals("true")) allowed = true; + allowed = cfg.getBooleanObject("libdefaults", "allow_weak_crypto") + == Boolean.TRUE; } catch (Exception exc) { if (DEBUG) { System.out.println ("Exception in getting allow_weak_crypto, " + diff --git a/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java b/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java index 1adc6b966cf..ce3c97120ce 100644 --- a/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java +++ b/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java @@ -27,6 +27,7 @@ import sun.security.validator.Validator; +import java.lang.ref.SoftReference; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.security.AlgorithmParameters; @@ -55,6 +56,7 @@ import java.util.Collection; import java.util.Collections; import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Pattern; import java.util.regex.Matcher; @@ -99,6 +101,8 @@ private static class JarHolder { private final List disabledAlgorithms; private final Constraints algorithmConstraints; + private volatile SoftReference> cacheRef = + new SoftReference<>(null); public static DisabledAlgorithmConstraints certPathConstraints() { return CertPathHolder.CONSTRAINTS; @@ -158,7 +162,10 @@ public DisabledAlgorithmConstraints(String propertyName, @Override public final boolean permits(Set primitives, String algorithm, AlgorithmParameters parameters) { - if (!checkAlgorithm(disabledAlgorithms, algorithm, decomposer)) { + if (algorithm == null || algorithm.isEmpty()) { + throw new IllegalArgumentException("No algorithm name specified"); + } + if (!cachedCheckAlgorithm(algorithm)) { return false; } @@ -242,7 +249,7 @@ public final void permits(String algorithm, ConstraintsParameters cp, // Check if named curves in the key are disabled. for (Key key : cp.getKeys()) { for (String curve : getNamedCurveFromKey(key)) { - if (!checkAlgorithm(disabledAlgorithms, curve, decomposer)) { + if (!cachedCheckAlgorithm(curve)) { throw new CertPathValidatorException( "Algorithm constraints check failed on disabled " + "algorithm: " + curve, @@ -950,6 +957,25 @@ private boolean permitsImpl(Key key) { } } + private boolean cachedCheckAlgorithm(String algorithm) { + Map cache; + if ((cache = cacheRef.get()) == null) { + synchronized (this) { + if ((cache = cacheRef.get()) == null) { + cache = new ConcurrentHashMap<>(); + cacheRef = new SoftReference<>(cache); + } + } + } + Boolean result = cache.get(algorithm); + if (result != null) { + return result; + } + result = checkAlgorithm(disabledAlgorithms, algorithm, decomposer); + cache.put(algorithm, result); + return result; + } + /* * This constraint is used for the complete disabling of the algorithm. */ diff --git a/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java b/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java index c335e964f63..afdfa406b92 100644 --- a/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java +++ b/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java @@ -855,16 +855,16 @@ private static int initializeMaxSigFileSize() { * the maximum allowed number of bytes for the signature-related files * in a JAR file. */ - Integer tmp = AccessController.doPrivileged(new GetIntegerAction( - "jdk.jar.maxSignatureFileSize", 8000000)); + int tmp = AccessController.doPrivileged(new GetIntegerAction( + "jdk.jar.maxSignatureFileSize", 16000000)); if (tmp < 0 || tmp > MAX_ARRAY_SIZE) { if (debug != null) { - debug.println("Default signature file size 8000000 bytes " + - "is used as the specified size for the " + - "jdk.jar.maxSignatureFileSize system property " + + debug.println("The default signature file size of 16000000 bytes " + + "will be used for the jdk.jar.maxSignatureFileSize " + + "system property since the specified value " + "is out of range: " + tmp); } - tmp = 8000000; + tmp = 16000000; } return tmp; } diff --git a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c index 1a20b404ad0..94f0228191b 100644 --- a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c +++ b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c @@ -205,6 +205,8 @@ findWithTemplate(XVisualInfo *vinfo, visualList = XGetVisualInfo(awt_display, mask, vinfo, &visualsMatched); if (visualList) { + int id = -1; + VisualID defaultVisual = XVisualIDFromVisual(DefaultVisual(awt_display, vinfo->screen)); defaultConfig = ZALLOC(_AwtGraphicsConfigData); for (i = 0; i < visualsMatched; i++) { memcpy(&defaultConfig->awt_visInfo, &visualList[i], sizeof(XVisualInfo)); @@ -213,20 +215,31 @@ findWithTemplate(XVisualInfo *vinfo, /* we can't use awtJNI_CreateColorData here, because it'll pull, SystemColor, which in turn will cause toolkit to be reinitialized */ if (awtCreateX11Colormap(defaultConfig)) { - /* Allocate white and black pixels for this visual */ - color.flags = DoRed | DoGreen | DoBlue; - color.red = color.green = color.blue = 0x0000; - XAllocColor(awt_display, defaultConfig->awt_cmap, &color); - x11Screens[visualList[i].screen].blackpixel = color.pixel; - color.flags = DoRed | DoGreen | DoBlue; - color.red = color.green = color.blue = 0xffff; - XAllocColor(awt_display, defaultConfig->awt_cmap, &color); - x11Screens[visualList[i].screen].whitepixel = color.pixel; - - XFree(visualList); - return defaultConfig; + if (visualList[i].visualid == defaultVisual) { + id = i; + break; + } else if (-1 == id) { + // Keep 1st match for fallback + id = i; + } } } + if (-1 != id) { + memcpy(&defaultConfig->awt_visInfo, &visualList[id], sizeof(XVisualInfo)); + defaultConfig->awt_depth = visualList[id].depth; + /* Allocate white and black pixels for this visual */ + color.flags = DoRed | DoGreen | DoBlue; + color.red = color.green = color.blue = 0x0000; + XAllocColor(awt_display, defaultConfig->awt_cmap, &color); + x11Screens[visualList[id].screen].blackpixel = color.pixel; + color.flags = DoRed | DoGreen | DoBlue; + color.red = color.green = color.blue = 0xffff; + XAllocColor(awt_display, defaultConfig->awt_cmap, &color); + x11Screens[visualList[id].screen].whitepixel = color.pixel; + + XFree(visualList); + return defaultConfig; + } XFree(visualList); free((void *)defaultConfig); } diff --git a/jdk/src/solaris/native/sun/awt/awt_InputMethod.c b/jdk/src/solaris/native/sun/awt/awt_InputMethod.c index 30b197719e5..f4a828279c3 100644 --- a/jdk/src/solaris/native/sun/awt/awt_InputMethod.c +++ b/jdk/src/solaris/native/sun/awt/awt_InputMethod.c @@ -676,9 +676,10 @@ static StatusWindow *createStatusWindow( return NULL; } statusWindow->w = status; - //12-point font + //12, 13-point fonts statusWindow->fontset = XCreateFontSet(dpy, - "-*-*-medium-r-normal-*-*-120-*-*-*-*", + "-*-*-medium-r-normal-*-*-120-*-*-*-*," \ + "-*-*-medium-r-normal-*-*-130-*-*-*-*", &mclr, &mccr, &dsr); /* In case we didn't find the font set, release the list of missing characters */ if (mccr > 0) { diff --git a/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c b/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c index bd836bfcd6b..e70a8a58813 100644 --- a/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c +++ b/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c @@ -29,6 +29,7 @@ #include "jlong.h" #include +#include #include #include #include diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT index 355b251e66c..b2d2ba1bcc3 100644 --- a/jdk/test/TEST.ROOT +++ b/jdk/test/TEST.ROOT @@ -25,3 +25,7 @@ requires.properties=sun.arch.data.model # Group definitions groups=TEST.groups [closed/TEST.groups] + +# Path to libraries in the topmost test directory. This is needed so @library +# does not need ../../ notation to reach them +external.lib.roots = ../../ diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java index 880a72e13f9..aee5cafecd5 100644 --- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java +++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, 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 @@ -56,8 +56,7 @@ public class GetCommittedVirtualMemorySize { // Careful with these values. private static final long MIN_SIZE_FOR_PASS = 1; - // Max size for pass dynamically determined below - private static long max_size_for_pass = Long.MAX_VALUE; + private static long MAX_SIZE_FOR_PASS = Long.MAX_VALUE; private static boolean trace = false; @@ -66,16 +65,6 @@ public static void main(String args[]) throws Exception { trace = true; } - // 4934082: On Linux, VM size *can* be larger than total swap - // size. Linux might not reserve swap memory immediately when - // a page is mmaped. This means that the reported committed - // memory size can grow beyond the swap limit. - long max_size = mbean.getTotalSwapSpaceSize() + - mbean.getTotalPhysicalMemorySize(); - - if (max_size > 0) { - max_size_for_pass = max_size; - } long size = mbean.getCommittedVirtualMemorySize(); if (size == -1) { System.out.println("getCommittedVirtualMemorySize() is not supported"); @@ -87,11 +76,11 @@ public static void main(String args[]) throws Exception { size); } - if (size < MIN_SIZE_FOR_PASS || size > max_size_for_pass) { + if (size < MIN_SIZE_FOR_PASS || size > MAX_SIZE_FOR_PASS) { throw new RuntimeException("Committed virtual memory size " + "illegal value: " + size + " bytes " + "(MIN = " + MIN_SIZE_FOR_PASS + "; " + - "MAX = " + max_size_for_pass + ")"); + "MAX = " + MAX_SIZE_FOR_PASS + ")"); } System.out.println("Test passed."); diff --git a/jdk/test/java/awt/color/ICC_ColorSpace/SimpleSRGBConversionQualityTest.java b/jdk/test/java/awt/color/ICC_ColorSpace/SimpleSRGBConversionQualityTest.java new file mode 100644 index 00000000000..57239dd41e7 --- /dev/null +++ b/jdk/test/java/awt/color/ICC_ColorSpace/SimpleSRGBConversionQualityTest.java @@ -0,0 +1,51 @@ +/* + * Copyright Amazon.com Inc. 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. + */ + +import java.awt.Color; +import java.awt.color.ColorSpace; + +/** + * @test + * @bug 6528710 + * @summary Verifies sRGB-ColorSpace to sRGB-ColorSpace conversion quality + */ +public final class SimpleSRGBConversionQualityTest { + + public static void main(String[] args) { + ColorSpace cspace = ColorSpace.getInstance(ColorSpace.CS_sRGB); + float fvalue[] = {1.0f, 1.0f, 1.0f}; + + Color c = new Color(cspace, fvalue, 1.0f); + if (c.getRed() != 255 || c.getGreen() != 255 || c.getBlue() != 255) { + throw new RuntimeException("Wrong color: " + c); + } + + float frgbvalue[] = cspace.toRGB(fvalue); + for (int i = 0; i < 3; ++i) { + if (frgbvalue[i] != 1.0f) { + System.err.println(fvalue[i] + " -> " + frgbvalue[i]); + throw new RuntimeException("Wrong value"); + } + } + } +} diff --git a/jdk/test/java/lang/ProcessBuilder/Basic.java b/jdk/test/java/lang/ProcessBuilder/Basic.java index a1c64309422..223b011e7dd 100644 --- a/jdk/test/java/lang/ProcessBuilder/Basic.java +++ b/jdk/test/java/lang/ProcessBuilder/Basic.java @@ -62,6 +62,10 @@ public class Basic { /* used for AIX only */ static final String libpath = System.getenv("LIBPATH"); + /* Used for regex String matching for long error messages */ + static final String PERMISSION_DENIED_ERROR_MSG = "(Permission denied|error=13)"; + static final String NO_SUCH_FILE_ERROR_MSG = "(No such file|error=2)"; + /** * Returns the number of milliseconds since time given by * startNanoTime, which must have been previously returned from a @@ -295,7 +299,7 @@ static void checkPermissionDenied(ProcessBuilder pb) { } catch (IOException e) { String m = e.getMessage(); if (EnglishUnix.is() && - ! matches(m, "Permission denied")) + ! matches(m, PERMISSION_DENIED_ERROR_MSG)) unexpected(e); } catch (Throwable t) { unexpected(t); } } @@ -403,7 +407,7 @@ public static void main(String args[]) throws Throwable { } catch (IOException e) { String m = e.getMessage(); if (EnglishUnix.is() && - ! matches(m, "No such file")) + ! matches(m, NO_SUCH_FILE_ERROR_MSG)) unexpected(e); } catch (Throwable t) { unexpected(t); } @@ -416,7 +420,7 @@ public static void main(String args[]) throws Throwable { } catch (IOException e) { String m = e.getMessage(); if (EnglishUnix.is() && - ! matches(m, "No such file")) + ! matches(m, NO_SUCH_FILE_ERROR_MSG)) unexpected(e); } catch (Throwable t) { unexpected(t); } @@ -1854,7 +1858,7 @@ public void doIt(Map environ) { } catch (IOException e) { String m = e.getMessage(); if (EnglishUnix.is() && - ! matches(m, "No such file or directory")) + ! matches(m, NO_SUCH_FILE_ERROR_MSG)) unexpected(e); } catch (Throwable t) { unexpected(t); } @@ -1871,7 +1875,7 @@ public void doIt(Map environ) { Pattern p = Pattern.compile(programName); if (! matches(m, programName) || (EnglishUnix.is() - && ! matches(m, "No such file or directory"))) + && ! matches(m, NO_SUCH_FILE_ERROR_MSG))) unexpected(e); } catch (Throwable t) { unexpected(t); } @@ -1887,7 +1891,7 @@ public void doIt(Map environ) { String m = e.getMessage(); if (! matches(m, "in directory") || (EnglishUnix.is() && - ! matches(m, "No such file or directory"))) + ! matches(m, NO_SUCH_FILE_ERROR_MSG))) unexpected(e); } catch (Throwable t) { unexpected(t); } @@ -2122,7 +2126,7 @@ public void run() { new File("./emptyCommand").delete(); String m = e.getMessage(); if (EnglishUnix.is() && - ! matches(m, "Permission denied")) + ! matches(m, PERMISSION_DENIED_ERROR_MSG)) unexpected(e); } catch (Throwable t) { unexpected(t); } diff --git a/jdk/test/java/net/MulticastSocket/JoinLeave.java b/jdk/test/java/net/MulticastSocket/JoinLeave.java index 93dd93930b6..a3e714eecb1 100644 --- a/jdk/test/java/net/MulticastSocket/JoinLeave.java +++ b/jdk/test/java/net/MulticastSocket/JoinLeave.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019, 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 @@ -21,13 +21,15 @@ * questions. */ -/* +/** * @test * @bug 4091811 4148753 4102731 * @summary Test java.net.MulticastSocket joinGroup and leaveGroup - * @library /lib/testlibrary - * @build jdk.testlibrary.NetworkConfiguration + * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform * @run main JoinLeave + * @run main/othervm -Djava.net.preferIPv4Stack=true JoinLeave */ import java.io.IOException; @@ -35,11 +37,11 @@ import java.net.InetAddress; import java.net.MulticastSocket; import java.net.NetworkInterface; -import jdk.testlibrary.NetworkConfiguration; +import jdk.test.lib.NetworkConfiguration; public class JoinLeave { - public static void main(String args[]) throws IOException { + public static void main(String args[]) throws IOException { InetAddress ip4Group = InetAddress.getByName("224.80.80.80"); InetAddress ip6Group = InetAddress.getByName("ff02::a"); @@ -48,8 +50,7 @@ public static void main(String args[]) throws IOException { nc.ip6MulticastInterfaces().forEach(nic -> joinLeave(ip6Group, nic)); } - static void joinLeave(InetAddress group, NetworkInterface nif) - { + static void joinLeave(InetAddress group, NetworkInterface nif) { System.out.println("Joining:" + group + " on " + nif); try (MulticastSocket soc = new MulticastSocket()) { soc.setNetworkInterface(nif); diff --git a/jdk/test/java/net/MulticastSocket/SetGetNetworkInterfaceTest.java b/jdk/test/java/net/MulticastSocket/SetGetNetworkInterfaceTest.java index b46bdbedbce..7e888d31d22 100644 --- a/jdk/test/java/net/MulticastSocket/SetGetNetworkInterfaceTest.java +++ b/jdk/test/java/net/MulticastSocket/SetGetNetworkInterfaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, 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 @@ -21,105 +21,50 @@ * questions. */ - -/* - * @test - * @bug 6458027 - * @summary Disabling IPv6 on a specific network interface causes problems. - * - */ - import java.io.IOException; -import java.net.InetAddress; +import java.io.UncheckedIOException; import java.net.MulticastSocket; import java.net.NetworkInterface; -import java.net.SocketException; -import java.util.Arrays; -import java.util.Enumeration; +import jdk.test.lib.NetworkConfiguration; -public class SetGetNetworkInterfaceTest { +/** + * @test + * @bug 6458027 + * @summary Disabling IPv6 on a specific network interface causes problems. + * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform + * @run main SetGetNetworkInterfaceTest + * @run main/othervm -Djava.net.preferIPv4Stack=true SetGetNetworkInterfaceTest +*/ +public class SetGetNetworkInterfaceTest { public static void main(String[] args) throws Exception { - - boolean passed = true; - try { - MulticastSocket ms = new MulticastSocket(); - Enumeration networkInterfaces = NetworkInterface - .getNetworkInterfaces(); - while (networkInterfaces.hasMoreElements()) { - NetworkInterface netIf = networkInterfaces.nextElement(); - if (isNetworkInterfaceTestable(netIf)) { - printNetIfDetails(netIf); - ms.setNetworkInterface(netIf); - NetworkInterface msNetIf = ms.getNetworkInterface(); - if (netIf.equals(msNetIf)) { - System.out.println(" OK"); - } else { - System.out.println("FAILED!!!"); - printNetIfDetails(msNetIf); - passed = false; - } - System.out.println("------------------"); - } - } + NetworkConfiguration nc = NetworkConfiguration.probe(); + try (MulticastSocket ms = new MulticastSocket()) { + nc.multicastInterfaces(true).forEach(nif -> setGetNetworkInterface(ms, nif)); } catch (IOException e) { e.printStackTrace(); - passed = false; } - if (!passed) { - throw new RuntimeException("Test Fail"); - } - System.out.println("Test passed "); - } - - private static boolean isNetworkInterfaceTestable(NetworkInterface netIf) throws Exception { - System.out.println("checking netif == " + netIf.getName()); - return (netIf.isUp() && netIf.supportsMulticast() && isIpAddrAvailable(netIf)); + System.out.println("Test passed."); } - private static boolean isIpAddrAvailable (NetworkInterface netIf) { - boolean ipAddrAvailable = false; - byte[] nullIpAddr = {'0', '0', '0', '0'}; - byte[] testIpAddr = null; - - Enumeration ipAddresses = netIf.getInetAddresses(); - while (ipAddresses.hasMoreElements()) { - InetAddress testAddr = ipAddresses.nextElement(); - testIpAddr = testAddr.getAddress(); - if ((testIpAddr != null) && (!Arrays.equals(testIpAddr, nullIpAddr))) { - ipAddrAvailable = true; - break; + static void setGetNetworkInterface(MulticastSocket ms, NetworkInterface nif) { + try { + System.out.println(NetworkConfiguration.interfaceInformation(nif)); + ms.setNetworkInterface(nif); + NetworkInterface msNetIf = ms.getNetworkInterface(); + if (nif.equals(msNetIf)) { + System.out.println(" OK"); } else { - System.out.println("ignore netif " + netIf.getName()); - } - } - return ipAddrAvailable; - } - - private static void printNetIfDetails(NetworkInterface ni) - throws SocketException { - System.out.println("Name " + ni.getName() + " index " + ni.getIndex()); - Enumeration en = ni.getInetAddresses(); - while (en.hasMoreElements()) { - System.out.println(" InetAdress: " + en.nextElement()); - } - System.out.println("HardwareAddress: " + createMacAddrString(ni)); - System.out.println("loopback: " + ni.isLoopback() + "; pointToPoint: " - + ni.isPointToPoint() + "; virtual: " + ni.isVirtual() - + "; MTU: " + ni.getMTU()); - } - - private static String createMacAddrString(NetworkInterface netIf) - throws SocketException { - byte[] macAddr = netIf.getHardwareAddress(); - StringBuilder sb = new StringBuilder(); - if (macAddr != null) { - for (int i = 0; i < macAddr.length; i++) { - sb.append(String.format("%02X%s", macAddr[i], - (i < macAddr.length - 1) ? "-" : "")); + System.out.println("FAILED!!!"); + System.out.println(NetworkConfiguration.interfaceInformation(msNetIf)); + throw new RuntimeException("Test Fail"); } + System.out.println("------------------"); + } catch (IOException e) { + throw new UncheckedIOException(e); } - return sb.toString(); } } diff --git a/jdk/test/java/net/MulticastSocket/Test.java b/jdk/test/java/net/MulticastSocket/Test.java index 53fa961d2d4..df72cdae1f9 100644 --- a/jdk/test/java/net/MulticastSocket/Test.java +++ b/jdk/test/java/net/MulticastSocket/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2019, 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 @@ -21,21 +21,31 @@ * questions. */ -/* +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetAddress; +import java.net.MulticastSocket; +import java.net.SocketTimeoutException; + +import jdk.test.lib.NetworkConfiguration; + +/** * @test * @bug 4488458 * @summary IPv4 and IPv6 multicasting broken on Linux + * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform + * @run main Test + * @run main/othervm -Djava.net.preferIPv4Stack=true Test */ -import java.net.*; -import java.io.IOException; -import java.util.Enumeration; - public class Test { static int count = 0; static int failures = 0; - void doTest(String address) throws Exception { + void doTest(String address) throws IOException { boolean failed = false; InetAddress ia = InetAddress.getByName(address); @@ -61,7 +71,7 @@ void doTest(String address) throws Exception { /* packets should be received */ - for (int j=0; j<2; j++) { + for (int j = 0; j < 2; j++) { p.setAddress(ia); p.setPort(port); @@ -123,59 +133,26 @@ void doTest(String address) throws Exception { } } - void allTests() throws Exception { + void allTests() throws IOException { + NetworkConfiguration nc = NetworkConfiguration.probe(); - /* - * Assume machine has IPv4 address - */ + // unconditionally test IPv4 address doTest("224.80.80.80"); - /* - * Check if IPv6 is enabled and the scope of the addresses - */ - boolean has_ipv6 = false; - boolean has_siteaddress = false; - boolean has_linklocaladdress = false; - boolean has_globaladdress = false; - - Enumeration nifs = NetworkInterface.getNetworkInterfaces(); - while (nifs.hasMoreElements()) { - NetworkInterface ni = (NetworkInterface)nifs.nextElement(); - Enumeration addrs = ni.getInetAddresses(); - - while (addrs.hasMoreElements()) { - InetAddress ia = (InetAddress)addrs.nextElement(); - - if (ia instanceof Inet6Address) { - has_ipv6 = true; - if (ia.isLinkLocalAddress()) has_linklocaladdress = true; - if (ia.isSiteLocalAddress()) has_siteaddress = true; - - if (!ia.isLinkLocalAddress() && - !ia.isSiteLocalAddress() && - !ia.isLoopbackAddress()) { - has_globaladdress = true; - } - } - } - } - - /* - * If IPv6 is enabled perform multicast tests with various scopes - */ - if (has_ipv6) { + // If IPv6 is enabled perform multicast tests with various scopes + if (nc.hasTestableIPv6Address()) { doTest("ff01::a"); } - if (has_linklocaladdress) { + if (nc.hasLinkLocalAddress()) { doTest("ff02::a"); } - if (has_siteaddress) { + if (nc.hasSiteLocalAddress()) { doTest("ff05::a"); } - if (has_globaladdress) { + if (nc.has_globaladdress()) { doTest("ff0e::a"); } } @@ -186,7 +163,7 @@ public static void main(String args[]) throws Exception { if (args.length == 0) { t.allTests(); } else { - for (int i=0; i= 8) - * @library /lib / + * @library /test/lib / * @key jfr * @run main/othervm/timeout=30 -XX:+FlightRecorder -XX:StartFlightRecording JFRSecurityTestSuite * @author Martin Balao (mbalao@redhat.com) diff --git a/jdk/test/jdk/jfr/startupargs/TestBadOptionValues.java b/jdk/test/jdk/jfr/startupargs/TestBadOptionValues.java index 4744178499e..b457e9d7c3b 100644 --- a/jdk/test/jdk/jfr/startupargs/TestBadOptionValues.java +++ b/jdk/test/jdk/jfr/startupargs/TestBadOptionValues.java @@ -35,7 +35,7 @@ * @key jfr * * - * @library /lib / + * @library /test/lib / * * diff --git a/jdk/test/jdk/jfr/startupargs/TestDumpOnExit.java b/jdk/test/jdk/jfr/startupargs/TestDumpOnExit.java index 312c70d41eb..85fde363fef 100644 --- a/jdk/test/jdk/jfr/startupargs/TestDumpOnExit.java +++ b/jdk/test/jdk/jfr/startupargs/TestDumpOnExit.java @@ -43,7 +43,7 @@ * @summary Start a FlightRecording with dumponexit. Verify dump exists. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.startupargs.TestDumpOnExit */ public class TestDumpOnExit { diff --git a/jdk/test/jdk/jfr/startupargs/TestMemoryOptions.java b/jdk/test/jdk/jfr/startupargs/TestMemoryOptions.java index 934a0b97538..31725449749 100644 --- a/jdk/test/jdk/jfr/startupargs/TestMemoryOptions.java +++ b/jdk/test/jdk/jfr/startupargs/TestMemoryOptions.java @@ -38,7 +38,7 @@ * @test * @key jfr * - * @library /lib / + * @library /test/lib / * * @run main/timeout=900 jdk.jfr.startupargs.TestMemoryOptions */ diff --git a/jdk/test/jdk/jfr/startupargs/TestMultipleStartupRecordings.java b/jdk/test/jdk/jfr/startupargs/TestMultipleStartupRecordings.java index 4c156c8cfcf..174794ab298 100644 --- a/jdk/test/jdk/jfr/startupargs/TestMultipleStartupRecordings.java +++ b/jdk/test/jdk/jfr/startupargs/TestMultipleStartupRecordings.java @@ -34,7 +34,7 @@ * @key jfr * * - * @library /lib / + * @library /test/lib / * * @run main jdk.jfr.startupargs.TestMultipleStartupRecordings */ diff --git a/jdk/test/jdk/jfr/startupargs/TestOldObjectQueueSize.java b/jdk/test/jdk/jfr/startupargs/TestOldObjectQueueSize.java index 6af49232a53..1c6ed4cece6 100644 --- a/jdk/test/jdk/jfr/startupargs/TestOldObjectQueueSize.java +++ b/jdk/test/jdk/jfr/startupargs/TestOldObjectQueueSize.java @@ -39,7 +39,7 @@ * @summary Test -XX:FlightRecorderOptions=old-object-queue-size * * - * @library /lib / + * @library /test/lib / * @key jfr * * @run main/othervm -XX:TLABSize=2k -XX:-FastTLABRefill -XX:FlightRecorderOptions=old-object-queue-size=0 jdk.jfr.startupargs.TestOldObjectQueueSize off diff --git a/jdk/test/jdk/jfr/startupargs/TestRepositoryPath.java b/jdk/test/jdk/jfr/startupargs/TestRepositoryPath.java index 56deefc611f..3df0a36d91a 100644 --- a/jdk/test/jdk/jfr/startupargs/TestRepositoryPath.java +++ b/jdk/test/jdk/jfr/startupargs/TestRepositoryPath.java @@ -36,7 +36,7 @@ * @summary Set repository path. Verify recording created in repo. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm -XX:StartFlightRecording=name=TestStartRecording,settings=profile -XX:FlightRecorderOptions=repository=./repo jdk.jfr.startupargs.TestRepositoryPath */ public class TestRepositoryPath { diff --git a/jdk/test/jdk/jfr/startupargs/TestRepositoryPathLong.java b/jdk/test/jdk/jfr/startupargs/TestRepositoryPathLong.java index 5a5176c56e3..72bb60ed90d 100644 --- a/jdk/test/jdk/jfr/startupargs/TestRepositoryPathLong.java +++ b/jdk/test/jdk/jfr/startupargs/TestRepositoryPathLong.java @@ -36,7 +36,7 @@ * @summary Set repository path. Verify recording created in repo. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm -XX:StartFlightRecording=name=myrec,settings=profile -XX:FlightRecorderOptions=repository=./subdirectory/subdirectory1/subdirectory2/subdirectory3/subdirectory4/subdirectory5/subdirectory6/subdirectory7/subdirectory8/subdirectory9/subdirectory10/subdirectory11/subdirectory12/subdirectory13/subdirectory14/subdirectory15 jdk.jfr.startupargs.TestRepositoryPathLong */ public class TestRepositoryPathLong { diff --git a/jdk/test/jdk/jfr/startupargs/TestRetransform.java b/jdk/test/jdk/jfr/startupargs/TestRetransform.java index 3703f276efa..af8f3083684 100644 --- a/jdk/test/jdk/jfr/startupargs/TestRetransform.java +++ b/jdk/test/jdk/jfr/startupargs/TestRetransform.java @@ -36,7 +36,7 @@ * @test * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm -XX:FlightRecorderOptions=retransform=false jdk.jfr.startupargs.TestRetransform * @run main/othervm -XX:FlightRecorderOptions=retransform=true jdk.jfr.startupargs.TestRetransform */ diff --git a/jdk/test/jdk/jfr/startupargs/TestRetransformUsingLog.java b/jdk/test/jdk/jfr/startupargs/TestRetransformUsingLog.java index c7aefbb9405..65e788c07de 100644 --- a/jdk/test/jdk/jfr/startupargs/TestRetransformUsingLog.java +++ b/jdk/test/jdk/jfr/startupargs/TestRetransformUsingLog.java @@ -38,7 +38,7 @@ * @test * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.startupargs.TestRetransformUsingLog */ public class TestRetransformUsingLog { diff --git a/jdk/test/jdk/jfr/startupargs/TestStartDelay.java b/jdk/test/jdk/jfr/startupargs/TestStartDelay.java index bd00da2e978..5fe8c26765e 100644 --- a/jdk/test/jdk/jfr/startupargs/TestStartDelay.java +++ b/jdk/test/jdk/jfr/startupargs/TestStartDelay.java @@ -38,7 +38,7 @@ * @summary Start a recording with delay. Verify recording starts later. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm -XX:StartFlightRecording=name=TestStartDelay,delay=5000s jdk.jfr.startupargs.TestStartDelay */ public class TestStartDelay { diff --git a/jdk/test/jdk/jfr/startupargs/TestStartDelayRunning.java b/jdk/test/jdk/jfr/startupargs/TestStartDelayRunning.java index 97af7fb211a..5e649514759 100644 --- a/jdk/test/jdk/jfr/startupargs/TestStartDelayRunning.java +++ b/jdk/test/jdk/jfr/startupargs/TestStartDelayRunning.java @@ -37,7 +37,7 @@ * @summary Verify that a recopding with a delay is started. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm -XX:StartFlightRecording=name=TestStartDelay,delay=1s jdk.jfr.startupargs.TestStartDelayRunning */ public class TestStartDelayRunning { diff --git a/jdk/test/jdk/jfr/startupargs/TestStartDuration.java b/jdk/test/jdk/jfr/startupargs/TestStartDuration.java index 8173a4d9839..b84f00fffb0 100644 --- a/jdk/test/jdk/jfr/startupargs/TestStartDuration.java +++ b/jdk/test/jdk/jfr/startupargs/TestStartDuration.java @@ -39,7 +39,7 @@ * @summary Start a recording with duration. Verify recording stops. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main jdk.jfr.startupargs.TestStartDuration */ public class TestStartDuration { diff --git a/jdk/test/jdk/jfr/startupargs/TestStartMaxAgeSize.java b/jdk/test/jdk/jfr/startupargs/TestStartMaxAgeSize.java index d1b0971b231..6897c2c0056 100644 --- a/jdk/test/jdk/jfr/startupargs/TestStartMaxAgeSize.java +++ b/jdk/test/jdk/jfr/startupargs/TestStartMaxAgeSize.java @@ -37,7 +37,7 @@ * @summary Start a recording with delay. Verify recording starts later. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm -XX:StartFlightRecording=name=TestStartMaxAgeSize,maxage=10s,maxsize=1000000 jdk.jfr.startupargs.TestStartMaxAgeSize */ public class TestStartMaxAgeSize { diff --git a/jdk/test/jdk/jfr/startupargs/TestStartName.java b/jdk/test/jdk/jfr/startupargs/TestStartName.java index 1c0e38d5f0f..6d376c7633f 100644 --- a/jdk/test/jdk/jfr/startupargs/TestStartName.java +++ b/jdk/test/jdk/jfr/startupargs/TestStartName.java @@ -34,7 +34,7 @@ * @test * @key jfr * - * @library /lib / + * @library /test/lib / * @run main jdk.jfr.startupargs.TestStartName */ public class TestStartName { diff --git a/jdk/test/jdk/jfr/startupargs/TestStartNoSettings.java b/jdk/test/jdk/jfr/startupargs/TestStartNoSettings.java index 9b452c93325..ce32ccac635 100644 --- a/jdk/test/jdk/jfr/startupargs/TestStartNoSettings.java +++ b/jdk/test/jdk/jfr/startupargs/TestStartNoSettings.java @@ -35,7 +35,7 @@ * @test * @summary Start a FlightRecording without any settings (not even default). * @key jfr - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.startupargs.TestStartNoSettings * -XX:StartFlightRecording=settings=none */ diff --git a/jdk/test/jdk/jfr/startupargs/TestStartRecording.java b/jdk/test/jdk/jfr/startupargs/TestStartRecording.java index 104905c23d2..16abb088fde 100644 --- a/jdk/test/jdk/jfr/startupargs/TestStartRecording.java +++ b/jdk/test/jdk/jfr/startupargs/TestStartRecording.java @@ -37,7 +37,7 @@ * @summary Start a recording with -XX:StartFlightRecording. Dump recording with jcmd. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm -XX:StartFlightRecording=name=TestStartRecording,settings=profile jdk.jfr.startupargs.TestStartRecording */ public class TestStartRecording { diff --git a/jdk/test/jdk/jfr/tool/TestAssemble.java b/jdk/test/jdk/jfr/tool/TestAssemble.java index e1188c4b212..b2a6c2758b7 100644 --- a/jdk/test/jdk/jfr/tool/TestAssemble.java +++ b/jdk/test/jdk/jfr/tool/TestAssemble.java @@ -45,7 +45,7 @@ * @test * @summary Test jfr reconstruct * @key jfr - * @library /lib / + * @library /test/lib / * @modules jdk.jfr/jdk.jfr.internal * @run main/othervm jdk.jfr.tool.TestAssemble */ diff --git a/jdk/test/jdk/jfr/tool/TestDisassemble.java b/jdk/test/jdk/jfr/tool/TestDisassemble.java index f749cd5f9cf..d73a4f50ea4 100644 --- a/jdk/test/jdk/jfr/tool/TestDisassemble.java +++ b/jdk/test/jdk/jfr/tool/TestDisassemble.java @@ -42,7 +42,7 @@ * @test * @summary Test jfr split * @key jfr - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.tool.TestDisassemble */ public class TestDisassemble { diff --git a/jdk/test/jdk/jfr/tool/TestHelp.java b/jdk/test/jdk/jfr/tool/TestHelp.java index ee5361ab11a..cc7122280eb 100644 --- a/jdk/test/jdk/jfr/tool/TestHelp.java +++ b/jdk/test/jdk/jfr/tool/TestHelp.java @@ -31,7 +31,7 @@ * @test * @summary Test help * @key jfr - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.tool.TestHelp */ public class TestHelp { diff --git a/jdk/test/jdk/jfr/tool/TestMetadata.java b/jdk/test/jdk/jfr/tool/TestMetadata.java index ee953e7738f..151095b245e 100644 --- a/jdk/test/jdk/jfr/tool/TestMetadata.java +++ b/jdk/test/jdk/jfr/tool/TestMetadata.java @@ -35,7 +35,7 @@ * @test * @summary Test jfr info * @key jfr - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.tool.TestMetadata */ public class TestMetadata { diff --git a/jdk/test/jdk/jfr/tool/TestPrint.java b/jdk/test/jdk/jfr/tool/TestPrint.java index 70401c5a392..f1fc42b0e2a 100644 --- a/jdk/test/jdk/jfr/tool/TestPrint.java +++ b/jdk/test/jdk/jfr/tool/TestPrint.java @@ -36,7 +36,7 @@ * @test * @summary Test jfr print * @key jfr - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.tool.TestPrint */ public class TestPrint { diff --git a/jdk/test/jdk/jfr/tool/TestPrintDefault.java b/jdk/test/jdk/jfr/tool/TestPrintDefault.java index 98f6484c87f..a366d563830 100644 --- a/jdk/test/jdk/jfr/tool/TestPrintDefault.java +++ b/jdk/test/jdk/jfr/tool/TestPrintDefault.java @@ -34,7 +34,7 @@ * @key jfr * @summary Tests print --json * - * @library /lib / + * @library /test/lib / * @modules java.scripting * jdk.jfr * diff --git a/jdk/test/jdk/jfr/tool/TestPrintJSON.java b/jdk/test/jdk/jfr/tool/TestPrintJSON.java index 26f5e199af6..4cef144a81c 100644 --- a/jdk/test/jdk/jfr/tool/TestPrintJSON.java +++ b/jdk/test/jdk/jfr/tool/TestPrintJSON.java @@ -49,7 +49,7 @@ * @key jfr * @summary Tests print --json * - * @library /lib / + * @library /test/lib / * @modules jdk.scripting.nashorn * jdk.jfr * diff --git a/jdk/test/jdk/jfr/tool/TestPrintXML.java b/jdk/test/jdk/jfr/tool/TestPrintXML.java index 589c8f4d62b..5e745c95cdd 100644 --- a/jdk/test/jdk/jfr/tool/TestPrintXML.java +++ b/jdk/test/jdk/jfr/tool/TestPrintXML.java @@ -64,7 +64,7 @@ * @key jfr * @summary Tests print --xml * - * @library /lib / + * @library /test/lib / * @modules java.scripting java.xml jdk.jfr * * @run main/othervm jdk.jfr.tool.TestPrintXML diff --git a/jdk/test/jdk/jfr/tool/TestSummary.java b/jdk/test/jdk/jfr/tool/TestSummary.java index b9dc94f178d..505c58f2d9e 100644 --- a/jdk/test/jdk/jfr/tool/TestSummary.java +++ b/jdk/test/jdk/jfr/tool/TestSummary.java @@ -35,7 +35,7 @@ * @test * @summary Test jfr info * @key jfr - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.tool.TestSummary */ public class TestSummary { diff --git a/jdk/test/jdk/tools/launcher/JliLaunchTest.sh b/jdk/test/jdk/tools/launcher/JliLaunchTest.sh index 8a149ee628e..667ad778fef 100644 --- a/jdk/test/jdk/tools/launcher/JliLaunchTest.sh +++ b/jdk/test/jdk/tools/launcher/JliLaunchTest.sh @@ -2,7 +2,7 @@ # @test JliLaunchTest.sh # @bug 8238225 -# @library /lib +# @library /test/lib # @build JliLaunchTest # @run shell JliLaunchTest.sh diff --git a/jdk/test/lib/RedefineClassHelper.java b/jdk/test/lib/RedefineClassHelper.java deleted file mode 100644 index 2c236907a7a..00000000000 --- a/jdk/test/lib/RedefineClassHelper.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2014, 2016, 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. - */ - -import java.io.PrintWriter; -import java.lang.instrument.*; -import jdk.test.lib.compiler.InMemoryJavaCompiler; - -/* - * Helper class to write tests that redefine classes. - * When main method is run, it will create a redefineagent.jar that can be used - * with the -javaagent option to support redefining classes in jtreg tests. - * - * See sample test in test/testlibrary_tests/RedefineClassTest.java - */ -public class RedefineClassHelper { - - public static Instrumentation instrumentation; - public static void premain(String agentArgs, Instrumentation inst) { - instrumentation = inst; - } - - /** - * Redefine a class - * - * @param clazz Class to redefine - * @param javacode String with the new java code for the class to be redefined - */ - public static void redefineClass(Class clazz, String javacode) throws Exception { - byte[] bytecode = InMemoryJavaCompiler.compile(clazz.getName(), javacode); - redefineClass(clazz, bytecode); - } - - /** - * Redefine a class - * - * @param clazz Class to redefine - * @param bytecode byte[] with the new class - */ - public static void redefineClass(Class clazz, byte[] bytecode) throws Exception { - instrumentation.redefineClasses(new ClassDefinition(clazz, bytecode)); - } - - /** - * Main method to be invoked before test to create the redefineagent.jar - */ - public static void main(String[] args) throws Exception { - ClassFileInstaller.main("RedefineClassHelper"); - - PrintWriter pw = new PrintWriter("MANIFEST.MF"); - pw.println("Premain-Class: RedefineClassHelper"); - pw.println("Can-Redefine-Classes: true"); - pw.close(); - - sun.tools.jar.Main jarTool = new sun.tools.jar.Main(System.out, System.err, "jar"); - if (!jarTool.run(new String[] { "-cmf", "MANIFEST.MF", "redefineagent.jar", "RedefineClassHelper.class" })) { - throw new Exception("jar operation failed"); - } - } -} diff --git a/jdk/test/lib/jdk/test/lib/SecurityTools.java b/jdk/test/lib/jdk/test/lib/SecurityTools.java deleted file mode 100644 index 240801fb87f..00000000000 --- a/jdk/test/lib/jdk/test/lib/SecurityTools.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2016, 2017, 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. - */ - -package jdk.test.lib; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.process.ProcessTools; - -public class SecurityTools { - - public static final String RESPONSE_FILE = "security_tools_response.txt"; - - private static ProcessBuilder getProcessBuilder(String tool, List args) { - JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK(tool) - .addVMArg("-Duser.language=en") - .addVMArg("-Duser.country=US"); - if (!Platform.isWindows()) { - launcher.addVMArg("-Djava.security.egd=file:/dev/./urandom"); - } - for (String arg : args) { - if (arg.startsWith("-J")) { - launcher.addVMArg(arg.substring(2)); - } else { - launcher.addToolArg(arg); - } - } - return new ProcessBuilder(launcher.getCommand()); - } - - // keytool - - public static OutputAnalyzer keytool(List args) - throws Exception { - - ProcessBuilder pb = getProcessBuilder("keytool", args); - - Path p = Paths.get(RESPONSE_FILE); - if (!Files.exists(p)) { - Files.createFile(p); - } - pb.redirectInput(ProcessBuilder.Redirect.from(new File(RESPONSE_FILE))); - - try { - return execute(pb); - } finally { - Files.delete(p); - } - } - - // Only call this if there is no white space in every argument - public static OutputAnalyzer keytool(String args) throws Exception { - return keytool(args.split("\\s+")); - } - - public static OutputAnalyzer keytool(String... args) throws Exception { - return keytool(List.of(args)); - } - - public static void setResponse(String... responses) throws IOException { - String text; - if (responses.length > 0) { - text = Stream.of(responses).collect( - Collectors.joining("\n", "", "\n")); - } else { - text = ""; - } - Files.write(Paths.get(RESPONSE_FILE), text.getBytes()); - } - - // jarsigner - - public static OutputAnalyzer jarsigner(List args) - throws Exception { - return execute(getProcessBuilder("jarsigner", args)); - } - - private static OutputAnalyzer execute(ProcessBuilder pb) throws Exception { - try { - OutputAnalyzer oa = ProcessTools.executeCommand(pb); - System.out.println("Exit value: " + oa.getExitValue()); - return oa; - } catch (Throwable t) { - if (t instanceof Exception) { - throw (Exception) t; - } else { - throw new Exception(t); - } - } - } - - // Only call this if there is no white space in every argument - public static OutputAnalyzer jarsigner(String args) throws Exception { - - return jarsigner(args.split("\\s+")); - } - - public static OutputAnalyzer jarsigner(String... args) throws Exception { - return jarsigner(List.of(args)); - } -} - diff --git a/jdk/test/lib/jdk/test/lib/apps/LingeredApp.java b/jdk/test/lib/jdk/test/lib/apps/LingeredApp.java deleted file mode 100644 index 0070dcfd717..00000000000 --- a/jdk/test/lib/jdk/test/lib/apps/LingeredApp.java +++ /dev/null @@ -1,518 +0,0 @@ -/* - * Copyright (c) 2015, 2018, 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. - */ - -package jdk.test.lib.apps; - -import java.io.BufferedReader; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.StringReader; -import java.nio.file.Files; -import java.nio.file.NoSuchFileException; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.attribute.BasicFileAttributes; -import java.nio.file.attribute.FileTime; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; -import java.util.UUID; - -import jdk.test.lib.Utils; -import jdk.test.lib.process.OutputBuffer; -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.StreamPumper; - -/** - * This is a framework to launch an app that could be synchronized with caller - * to make further attach actions reliable across supported platforms - - * Caller example: - * SmartTestApp a = SmartTestApp.startApp(cmd); - * // do something - * a.stopApp(); - * - * or fine grained control - * - * a = new SmartTestApp("MyLock.lck"); - * a.createLock(); - * a.runApp(); - * a.waitAppReady(); - * // do something - * a.deleteLock(); - * a.waitAppTerminate(); - * - * Then you can work with app output and process object - * - * output = a.getAppOutput(); - * process = a.getProcess(); - * - */ -public class LingeredApp { - - private static final long spinDelay = 1000; - - private long lockCreationTime; - private ByteArrayOutputStream stderrBuffer; - private ByteArrayOutputStream stdoutBuffer; - private Thread outPumperThread; - private Thread errPumperThread; - - protected Process appProcess; - protected OutputBuffer output; - protected static final int appWaitTime = 100; - protected final String lockFileName; - - /** - * Create LingeredApp object on caller side. Lock file have be a valid filename - * at writable location - * - * @param lockFileName - the name of lock file - */ - public LingeredApp(String lockFileName) { - this.lockFileName = lockFileName; - } - - public LingeredApp() { - final String lockName = UUID.randomUUID().toString() + ".lck"; - this.lockFileName = lockName; - } - - /** - * - * @return name of lock file - */ - public String getLockFileName() { - return this.lockFileName; - } - - /** - * - * @return name of testapp - */ - public String getAppName() { - return this.getClass().getName(); - } - - /** - * - * @return pid of java process running testapp - */ - public long getPid() { - if (appProcess == null) { - throw new RuntimeException("Process is not alive"); - } - return appProcess.pid(); - } - - /** - * - * @return process object - */ - public Process getProcess() { - return appProcess; - } - - /** - * - * @return OutputBuffer object for the LingeredApp's output. Can only be called - * after LingeredApp has exited. - */ - public OutputBuffer getOutput() { - if (appProcess.isAlive()) { - throw new RuntimeException("Process is still alive. Can't get its output."); - } - if (output == null) { - output = new OutputBuffer(stdoutBuffer.toString(), stderrBuffer.toString()); - } - return output; - } - - /* - * Capture all stdout and stderr output from the LingeredApp so it can be returned - * to the driver app later. This code is modeled after ProcessTools.getOutput(). - */ - private void startOutputPumpers() { - stderrBuffer = new ByteArrayOutputStream(); - stdoutBuffer = new ByteArrayOutputStream(); - StreamPumper outPumper = new StreamPumper(appProcess.getInputStream(), stdoutBuffer); - StreamPumper errPumper = new StreamPumper(appProcess.getErrorStream(), stderrBuffer); - outPumperThread = new Thread(outPumper); - errPumperThread = new Thread(errPumper); - - outPumperThread.setDaemon(true); - errPumperThread.setDaemon(true); - - outPumperThread.start(); - errPumperThread.start(); - } - - /** - * - * @return application output as List. Empty List if application produced no output - */ - public List getAppOutput() { - if (appProcess.isAlive()) { - throw new RuntimeException("Process is still alive. Can't get its output."); - } - BufferedReader bufReader = new BufferedReader(new StringReader(output.getStdout())); - return bufReader.lines().collect(Collectors.toList()); - } - - /* Make sure all part of the app use the same method to get dates, - as different methods could produce different results - */ - private static long epoch() { - return new Date().getTime(); - } - - private static long lastModified(String fileName) throws IOException { - Path path = Paths.get(fileName); - BasicFileAttributes attr = Files.readAttributes(path, BasicFileAttributes.class); - return attr.lastModifiedTime().toMillis(); - } - - private static void setLastModified(String fileName, long newTime) throws IOException { - Path path = Paths.get(fileName); - FileTime fileTime = FileTime.fromMillis(newTime); - Files.setLastModifiedTime(path, fileTime); - } - - /** - * create lock - * - * @throws IOException - */ - public void createLock() throws IOException { - Path path = Paths.get(lockFileName); - // Files.deleteIfExists(path); - Files.createFile(path); - lockCreationTime = lastModified(lockFileName); - } - - /** - * Delete lock - * - * @throws IOException - */ - public void deleteLock() throws IOException { - try { - Path path = Paths.get(lockFileName); - Files.delete(path); - } catch (NoSuchFileException ex) { - // Lock already deleted. Ignore error - } - } - - public void waitAppTerminate() { - // This code is modeled after tail end of ProcessTools.getOutput(). - try { - // If the app hangs, we don't want to wait for the to test timeout. - if (!appProcess.waitFor(Utils.adjustTimeout(appWaitTime), TimeUnit.SECONDS)) { - appProcess.destroy(); - appProcess.waitFor(); - } - outPumperThread.join(); - errPumperThread.join(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - // pass - } - } - - /** - * The app touches the lock file when it's started - * wait while it happens. Caller have to delete lock on wait error. - * - * @param timeout - * @throws java.io.IOException - */ - public void waitAppReady(long timeout) throws IOException { - long here = epoch(); - while (true) { - long epoch = epoch(); - if (epoch - here > (timeout * 1000)) { - throw new IOException("App waiting timeout"); - } - - // Live process should touch lock file every second - long lm = lastModified(lockFileName); - if (lm > lockCreationTime) { - break; - } - - // Make sure process didn't already exit - if (!appProcess.isAlive()) { - throw new IOException("App exited unexpectedly with " + appProcess.exitValue()); - } - - try { - Thread.sleep(spinDelay); - } catch (InterruptedException ex) { - // pass - } - } - } - - /** - * Analyze an environment and prepare a command line to - * run the app, app name should be added explicitly - */ - public List runAppPrepare(List vmArguments) { - // We should always use testjava or throw an exception, - // so we can't use JDKToolFinder.getJDKTool("java"); - // that falls back to compile java on error - String jdkPath = System.getProperty("test.jdk"); - if (jdkPath == null) { - // we are not under jtreg, try env - Map env = System.getenv(); - jdkPath = env.get("TESTJAVA"); - } - - if (jdkPath == null) { - throw new RuntimeException("Can't determine jdk path neither test.jdk property no TESTJAVA env are set"); - } - - String osname = System.getProperty("os.name"); - String javapath = jdkPath + ((osname.startsWith("window")) ? "/bin/java.exe" : "/bin/java"); - - List cmd = new ArrayList(); - cmd.add(javapath); - - if (vmArguments == null) { - // Propagate test.vm.options to LingeredApp, filter out possible empty options - String testVmOpts[] = System.getProperty("test.vm.opts","").split("\\s+"); - for (String s : testVmOpts) { - if (!s.equals("")) { - cmd.add(s); - } - } - } else { - // Lets user manage LingeredApp options - cmd.addAll(vmArguments); - } - - // Make sure we set correct classpath to run the app - cmd.add("-cp"); - String classpath = System.getProperty("test.class.path"); - cmd.add((classpath == null) ? "." : classpath); - - return cmd; - } - - /** - * Assemble command line to a printable string - */ - public void printCommandLine(List cmd) { - // A bit of verbosity - StringBuilder cmdLine = new StringBuilder(); - for (String strCmd : cmd) { - cmdLine.append("'").append(strCmd).append("' "); - } - - System.err.println("Command line: [" + cmdLine.toString() + "]"); - } - - /** - * Run the app. - * - * @param vmArguments - * @throws IOException - */ - public void runApp(List vmArguments) - throws IOException { - - List cmd = runAppPrepare(vmArguments); - - cmd.add(this.getAppName()); - cmd.add(lockFileName); - - printCommandLine(cmd); - - ProcessBuilder pb = new ProcessBuilder(cmd); - // ProcessBuilder.start can throw IOException - appProcess = pb.start(); - - startOutputPumpers(); - } - - private void finishApp() { - OutputBuffer output = getOutput(); - String msg = - " LingeredApp stdout: [" + output.getStdout() + "];\n" + - " LingeredApp stderr: [" + output.getStderr() + "]\n" + - " LingeredApp exitValue = " + appProcess.exitValue(); - - System.err.println(msg); - } - - /** - * Delete lock file that signals app to terminate, then - * wait until app is actually terminated. - * @throws IOException - */ - public void stopApp() throws IOException { - deleteLock(); - // The startApp() of the derived app can throw - // an exception before the LA actually starts - if (appProcess != null) { - waitAppTerminate(); - int exitcode = appProcess.exitValue(); - if (exitcode != 0) { - throw new IOException("LingeredApp terminated with non-zero exit code " + exitcode); - } - } - finishApp(); - } - - /** - * High level interface for test writers - */ - /** - * Factory method that creates LingeredApp object with ready to use application - * lock name is autogenerated - * @param cmd - vm options, could be null to auto add testvm.options - * @return LingeredApp object - * @throws IOException - */ - public static LingeredApp startApp(List cmd) throws IOException { - LingeredApp a = new LingeredApp(); - a.createLock(); - try { - a.runApp(cmd); - a.waitAppReady(appWaitTime); - } catch (Exception ex) { - a.deleteLock(); - System.err.println("LingeredApp failed to start: " + ex); - a.finishApp(); - throw ex; - } - - return a; - } - - /** - * Factory method that starts pre-created LingeredApp - * lock name is autogenerated - * @param cmd - vm options, could be null to auto add testvm.options - * @param theApp - app to start - * @return LingeredApp object - * @throws IOException - */ - - public static void startApp(List cmd, LingeredApp theApp) throws IOException { - theApp.createLock(); - try { - theApp.runApp(cmd); - theApp.waitAppReady(appWaitTime); - } catch (Exception ex) { - theApp.deleteLock(); - throw ex; - } - } - - public static LingeredApp startApp() throws IOException { - return startApp(null); - } - - public static void stopApp(LingeredApp app) throws IOException { - if (app != null) { - // LingeredApp can throw an exception during the intialization, - // make sure we don't have cascade NPE - app.stopApp(); - } - } - - /** - * LastModified time might not work correctly in some cases it might - * cause later failures - */ - - public static boolean isLastModifiedWorking() { - boolean sane = true; - try { - long lm = lastModified("."); - if (lm == 0) { - System.err.println("SANITY Warning! The lastModifiedTime() doesn't work on this system, it returns 0"); - sane = false; - } - - long now = epoch(); - if (lm > now) { - System.err.println("SANITY Warning! The Clock is wrong on this system lastModifiedTime() > getTime()"); - sane = false; - } - - setLastModified(".", epoch()); - long lm1 = lastModified("."); - if (lm1 <= lm) { - System.err.println("SANITY Warning! The setLastModified doesn't work on this system"); - sane = false; - } - } - catch(IOException e) { - System.err.println("SANITY Warning! IOException during sanity check " + e); - sane = false; - } - - return sane; - } - - /** - * This part is the application it self - */ - public static void main(String args[]) { - - if (args.length != 1) { - System.err.println("Lock file name is not specified"); - System.exit(7); - } - - String theLockFileName = args[0]; - - try { - Path path = Paths.get(theLockFileName); - - while (Files.exists(path)) { - // Touch the lock to indicate our readiness - setLastModified(theLockFileName, epoch()); - Thread.sleep(spinDelay); - } - } catch (NoSuchFileException ex) { - // Lock deleted while we are setting last modified time. - // Ignore error and lets the app exits - } catch (Exception ex) { - System.err.println("LingeredApp ERROR: " + ex); - // Leave exit_code = 1 to Java launcher - System.exit(3); - } - - System.exit(0); - } -} diff --git a/jdk/test/lib/jdk/test/lib/apps/LingeredAppWithDeadlock.java b/jdk/test/lib/jdk/test/lib/apps/LingeredAppWithDeadlock.java deleted file mode 100644 index 2b52c1523db..00000000000 --- a/jdk/test/lib/jdk/test/lib/apps/LingeredAppWithDeadlock.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2005, 2016, 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. - */ -package jdk.test.lib.apps; - -import java.util.concurrent.Phaser; - -public class LingeredAppWithDeadlock extends LingeredApp { - - private static final Object Lock1 = new Object(); - private static final Object Lock2 = new Object(); - - private static volatile int reachCount = 0; - - private static final Phaser p = new Phaser(2); - - private static class ThreadOne extends Thread { - public void run() { - // wait Lock2 is locked - p.arriveAndAwaitAdvance(); - synchronized (Lock1) { - // signal Lock1 is locked - p.arriveAndAwaitAdvance(); - synchronized (Lock2) { - reachCount += 1; - } - } - } - } - - private static class ThreadTwo extends Thread { - public void run() { - synchronized (Lock2) { - // signal Lock2 is locked - p.arriveAndAwaitAdvance(); - // wait Lock1 is locked - p.arriveAndAwaitAdvance(); - synchronized (Lock1) { - reachCount += 1; - } - } - } - } - - public static void main(String args[]) { - if (args.length != 1) { - System.err.println("Lock file name is not specified"); - System.exit(7); - } - - // Run two theads that should come to deadlock - new ThreadOne().start(); - new ThreadTwo().start(); - - if (reachCount > 0) { - // Not able to deadlock, exiting - System.exit(3); - } - - LingeredApp.main(args); - } - } diff --git a/jdk/test/lib/jdk/test/lib/compiler/CompilerUtils.java b/jdk/test/lib/jdk/test/lib/compiler/CompilerUtils.java deleted file mode 100644 index 138ad84da41..00000000000 --- a/jdk/test/lib/jdk/test/lib/compiler/CompilerUtils.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2015, 2018, 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. - */ - -package jdk.test.lib.compiler; - -import javax.tools.JavaCompiler; -import javax.tools.StandardJavaFileManager; -import javax.tools.StandardLocation; -import javax.tools.ToolProvider; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -/** - * This class consists exclusively of static utility methods for invoking the - * java compiler. - */ -public final class CompilerUtils { - private CompilerUtils() { } - - /** - * Compile all the java sources in {@code /**} to - * {@code /**}. The destination directory will be created if - * it doesn't exist. - * - * Equivalent to calling {@code compile(source, destination, true, options);}. - * - * All warnings/errors emitted by the compiler are output to System.out/err. - * - * @param source Path to the source directory - * @param destination Path to the destination directory - * @param options Any options to pass to the compiler - * - * @return true if the compilation is successful - * - * @throws IOException - * if there is an I/O error scanning the source tree or - * creating the destination directory - * @throws UnsupportedOperationException - * if there is no system java compiler - */ - public static boolean compile(Path source, Path destination, String... options) - throws IOException - { - return compile(source, destination, true, options); - } - - /** - * Compile all the java sources in {@code } and optionally its - * subdirectories, to - * {@code }. The destination directory will be created if - * it doesn't exist. - * - * All warnings/errors emitted by the compiler are output to System.out/err. - * - * @param source Path to the source directory - * @param destination Path to the destination directory - * @param recurse If {@code true} recurse into any {@code source} subdirectories - * to compile all java source files; else only compile those directly in - * {@code source}. - * @param options Any options to pass to the compiler - * - * @return true if the compilation is successful - * - * @throws IOException - * if there is an I/O error scanning the source tree or - * creating the destination directory - * @throws UnsupportedOperationException - * if there is no system java compiler - */ - - public static boolean compile(Path source, Path destination, boolean recurse, String... options) - throws IOException - { - JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); - if (compiler == null) { - // no compiler available - throw new UnsupportedOperationException("Unable to get system java compiler. " - + "Perhaps, jdk.compiler module is not available."); - } - StandardJavaFileManager jfm = compiler.getStandardFileManager(null, null, null); - - List sources - = Files.find(source, (recurse ? Integer.MAX_VALUE : 1), - (file, attrs) -> (file.toString().endsWith(".java"))) - .collect(Collectors.toList()); - - Files.createDirectories(destination); - jfm.setLocation(StandardLocation.CLASS_PATH, Collections.emptyList()); - jfm.setLocationFromPaths(StandardLocation.CLASS_OUTPUT, - Collections.singletonList(destination)); - - List opts = Arrays.asList(options); - JavaCompiler.CompilationTask task - = compiler.getTask(null, jfm, null, opts, null, - jfm.getJavaFileObjectsFromPaths(sources)); - - return task.call(); - } -} diff --git a/jdk/test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java b/jdk/test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java deleted file mode 100644 index 9444e4cc97b..00000000000 --- a/jdk/test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (c) 2013, 2017, 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. - */ - -package jdk.test.lib.compiler; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -import java.net.URI; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javax.tools.ForwardingJavaFileManager; -import javax.tools.FileObject; -import javax.tools.JavaCompiler; -import javax.tools.JavaCompiler.CompilationTask; -import javax.tools.JavaFileObject; -import javax.tools.JavaFileObject.Kind; -import javax.tools.SimpleJavaFileObject; -import javax.tools.StandardLocation; -import javax.tools.ToolProvider; - -/** - * {@code InMemoryJavaCompiler} can be used for compiling a {@link - * CharSequence} to a {@code byte[]}. - * - * The compiler will not use the file system at all, instead using a {@link - * ByteArrayOutputStream} for storing the byte code. For the source code, any - * kind of {@link CharSequence} can be used, e.g. {@link String}, {@link - * StringBuffer} or {@link StringBuilder}. - * - * The {@code InMemoryCompiler} can easily be used together with a {@code - * ByteClassLoader} to easily compile and load source code in a {@link String}: - * - *

- * {@code
- * import jdk.test.lib.compiler.InMemoryJavaCompiler;
- * import jdk.test.lib.ByteClassLoader;
- *
- * class Example {
- *     public static void main(String[] args) {
- *         String className = "Foo";
- *         String sourceCode = "public class " + className + " {" +
- *                             "    public void bar() {" +
- *                             "        System.out.println("Hello from bar!");" +
- *                             "    }" +
- *                             "}";
- *         byte[] byteCode = InMemoryJavaCompiler.compile(className, sourceCode);
- *         Class fooClass = ByteClassLoader.load(className, byteCode);
- *     }
- * }
- * }
- * 
- */ -public class InMemoryJavaCompiler { - private static class MemoryJavaFileObject extends SimpleJavaFileObject { - private final String className; - private final CharSequence sourceCode; - private final ByteArrayOutputStream byteCode; - - public MemoryJavaFileObject(String className, CharSequence sourceCode) { - super(URI.create("string:///" + className.replace('.','/') + Kind.SOURCE.extension), Kind.SOURCE); - this.className = className; - this.sourceCode = sourceCode; - this.byteCode = new ByteArrayOutputStream(); - } - - @Override - public CharSequence getCharContent(boolean ignoreEncodingErrors) { - return sourceCode; - } - - @Override - public OutputStream openOutputStream() throws IOException { - return byteCode; - } - - public byte[] getByteCode() { - return byteCode.toByteArray(); - } - - public String getClassName() { - return className; - } - } - - private static class FileManagerWrapper extends ForwardingJavaFileManager { - private static final Location PATCH_LOCATION = new Location() { - @Override - public String getName() { - return "patch module location"; - } - - @Override - public boolean isOutputLocation() { - return false; - } - }; - private final MemoryJavaFileObject file; - private final String moduleOverride; - - public FileManagerWrapper(MemoryJavaFileObject file, String moduleOverride) { - super(getCompiler().getStandardFileManager(null, null, null)); - this.file = file; - this.moduleOverride = moduleOverride; - } - - @Override - public JavaFileObject getJavaFileForOutput(Location location, String className, - Kind kind, FileObject sibling) - throws IOException { - if (!file.getClassName().equals(className)) { - throw new IOException("Expected class with name " + file.getClassName() + - ", but got " + className); - } - return file; - } - - @Override - public Location getLocationForModule(Location location, JavaFileObject fo) throws IOException { - if (fo == file && moduleOverride != null) { - return PATCH_LOCATION; - } - return super.getLocationForModule(location, fo); - } - - @Override - public String inferModuleName(Location location) throws IOException { - if (location == PATCH_LOCATION) { - return moduleOverride; - } - return super.inferModuleName(location); - } - - @Override - public boolean hasLocation(Location location) { - return super.hasLocation(location) || location == StandardLocation.PATCH_MODULE_PATH; - } - - } - - /** - * Compiles the class with the given name and source code. - * - * @param className The name of the class - * @param sourceCode The source code for the class with name {@code className} - * @param options additional command line options - * @throws RuntimeException if the compilation did not succeed - * @return The resulting byte code from the compilation - */ - public static byte[] compile(String className, CharSequence sourceCode, String... options) { - MemoryJavaFileObject file = new MemoryJavaFileObject(className, sourceCode); - CompilationTask task = getCompilationTask(file, options); - - if(!task.call()) { - throw new RuntimeException("Could not compile " + className + " with source code " + sourceCode); - } - - return file.getByteCode(); - } - - private static JavaCompiler getCompiler() { - return ToolProvider.getSystemJavaCompiler(); - } - - private static CompilationTask getCompilationTask(MemoryJavaFileObject file, String... options) { - List opts = new ArrayList<>(); - String moduleOverride = null; - for (String opt : options) { - if (opt.startsWith("--patch-module=")) { - moduleOverride = opt.substring("--patch-module=".length()); - } else { - opts.add(opt); - } - } - return getCompiler().getTask(null, new FileManagerWrapper(file, moduleOverride), null, opts, null, Arrays.asList(file)); - } -} diff --git a/jdk/test/lib/jdk/test/lib/compiler/ModuleInfoMaker.java b/jdk/test/lib/jdk/test/lib/compiler/ModuleInfoMaker.java deleted file mode 100644 index f6438a678ca..00000000000 --- a/jdk/test/lib/jdk/test/lib/compiler/ModuleInfoMaker.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2016, 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. - */ - -package jdk.test.lib.compiler; - -import java.io.BufferedWriter; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Stream; - -/** - * Utility class for creating test modules. - */ -public class ModuleInfoMaker { - private static final String MODULE_INFO_JAVA = "module-info.java"; - private static final Pattern MODULE_PATTERN = - Pattern.compile("module\\s+((?:\\w+\\.)*)"); - private static final Pattern PACKAGE_PATTERN = - Pattern.compile("package\\s+(((?:\\w+\\.)*)(?:\\w+))"); - private static final Pattern CLASS_PATTERN = - Pattern.compile("(?:public\\s+)?(?:class|enum|interface)\\s+(\\w+)"); - - private final Path dir; - - public ModuleInfoMaker(Path dir) { - this.dir = dir; - } - - /** - * Create java source files of the given module - */ - public void writeJavaFiles(String module, String moduleInfoJava, String... contents) - throws IOException - { - Path msrc = dir.resolve(module); - new JavaSource(moduleInfoJava).write(msrc); - for (String c : contents) { - new JavaSource(c).write(msrc); - } - } - - /** - * Compile the module to the given destination. - */ - public void compile(String module, Path dest, String... options) - throws IOException - { - Path msrc = dir.resolve(module); - String[] args = - Stream.concat(Arrays.stream(options), - Stream.of("--module-source-path", - dir.toString())).toArray(String[]::new); - if (!CompilerUtils.compile(msrc, dest, args)) { - throw new Error("Fail to compile " + module); - } - } - - static class JavaSource { - final String source; - JavaSource(String source) { - this.source = source; - } - - /** - * Writes the source code to a file in a specified directory. - * @param dir the directory - * @throws IOException if there is a problem writing the file - */ - public void write(Path dir) throws IOException { - Path file = dir.resolve(getJavaFileNameFromSource(source)); - Files.createDirectories(file.getParent()); - try (BufferedWriter out = Files.newBufferedWriter(file)) { - out.write(source.replace("\n", System.lineSeparator())); - } - } - - /** - * Extracts the Java file name from the class declaration. - * This method is intended for simple files and uses regular expressions, - * so comments matching the pattern can make the method fail. - */ - static String getJavaFileNameFromSource(String source) { - String packageName = null; - - Matcher matcher = MODULE_PATTERN.matcher(source); - if (matcher.find()) - return MODULE_INFO_JAVA; - - matcher = PACKAGE_PATTERN.matcher(source); - if (matcher.find()) - packageName = matcher.group(1).replace(".", "/"); - - matcher = CLASS_PATTERN.matcher(source); - if (matcher.find()) { - String className = matcher.group(1) + ".java"; - return (packageName == null) ? className : packageName + "/" + className; - } else if (packageName != null) { - return packageName + "/package-info.java"; - } else { - throw new Error("Could not extract the java class " + - "name from the provided source"); - } - } - } -} diff --git a/jdk/test/lib/jdk/test/lib/util/JarUtils.java b/jdk/test/lib/jdk/test/lib/util/JarUtils.java deleted file mode 100644 index bc752d96a91..00000000000 --- a/jdk/test/lib/jdk/test/lib/util/JarUtils.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2015, 2017, 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. - */ - -package jdk.test.lib.util; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.InvalidPathException; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Map; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; -import java.util.jar.JarOutputStream; -import java.util.jar.Manifest; - -/** - * Common library for various test jar file utility functions. - */ -public final class JarUtils { - - /** - * Create jar file with specified files. If a specified file does not exist, - * a new jar entry will be created with the file name itself as the content. - */ - public static void createJar(String dest, String... files) - throws IOException { - try (JarOutputStream jos = new JarOutputStream( - new FileOutputStream(dest), new Manifest())) { - for (String file : files) { - System.out.println(String.format("Adding %s to %s", - file, dest)); - - // add an archive entry, and write a file - jos.putNextEntry(new JarEntry(file)); - try (FileInputStream fis = new FileInputStream(file)) { - fis.transferTo(jos); - } catch (FileNotFoundException e) { - jos.write(file.getBytes()); - } - } - } - System.out.println(); - } - - /** - * Add or remove specified files to existing jar file. If a specified file - * to be updated or added does not exist, the jar entry will be created - * with the file name itself as the content. - * - * @param src the original jar file name - * @param dest the new jar file name - * @param files the files to update. The list is broken into 2 groups - * by a "-" string. The files before in the 1st group will - * be either updated or added. The files in the 2nd group - * will be removed. If no "-" exists, all files belong to - * the 1st group. - */ - public static void updateJar(String src, String dest, String... files) - throws IOException { - Map changes = new HashMap<>(); - boolean update = true; - for (String file : files) { - if (file.equals("-")) { - update = false; - } else if (update) { - try { - Path p = Paths.get(file); - if (Files.exists(p)) { - changes.put(file, p); - } else { - changes.put(file, file); - } - } catch (InvalidPathException e) { - // Fallback if file not a valid Path. - changes.put(file, file); - } - } else { - changes.put(file, Boolean.FALSE); - } - } - updateJar(src, dest, changes); - } - - /** - * Update content of a jar file. - * - * @param src the original jar file name - * @param dest the new jar file name - * @param changes a map of changes, key is jar entry name, value is content. - * Value can be Path, byte[] or String. If key exists in - * src but value is Boolean FALSE. The entry is removed. - * Existing entries in src not a key is unmodified. - * @throws IOException - */ - public static void updateJar(String src, String dest, - Map changes) - throws IOException { - - // What if input changes is immutable? - changes = new HashMap<>(changes); - - System.out.printf("Creating %s from %s...\n", dest, src); - try (JarOutputStream jos = new JarOutputStream( - new FileOutputStream(dest))) { - - try (JarFile srcJarFile = new JarFile(src)) { - Enumeration entries = srcJarFile.entries(); - while (entries.hasMoreElements()) { - JarEntry entry = entries.nextElement(); - String name = entry.getName(); - if (changes.containsKey(name)) { - System.out.println(String.format("- Update %s", name)); - updateEntry(jos, name, changes.get(name)); - changes.remove(name); - } else { - System.out.println(String.format("- Copy %s", name)); - jos.putNextEntry(entry); - srcJarFile.getInputStream(entry).transferTo(jos); - } - } - } - for (Map.Entry e : changes.entrySet()) { - System.out.println(String.format("- Add %s", e.getKey())); - updateEntry(jos, e.getKey(), e.getValue()); - } - } - System.out.println(); - } - - private static void updateEntry(JarOutputStream jos, String name, Object content) - throws IOException { - if (content instanceof Boolean) { - if (((Boolean) content).booleanValue()) { - throw new RuntimeException("Boolean value must be FALSE"); - } - } else { - jos.putNextEntry(new JarEntry(name)); - if (content instanceof Path) { - Files.newInputStream((Path) content).transferTo(jos); - } else if (content instanceof byte[]) { - jos.write((byte[]) content); - } else if (content instanceof String) { - jos.write(((String) content).getBytes()); - } else { - throw new RuntimeException("Unknown type " + content.getClass()); - } - } - } -} diff --git a/jdk/test/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java b/jdk/test/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java index 6cb50066b6d..dec0ff8872a 100644 --- a/jdk/test/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java +++ b/jdk/test/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -51,291 +51,325 @@ public class AmazonCA { public static void main(String[] args) throws Exception { ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - boolean ocspEnabled = false; if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { pathValidator.enableCRLCheck(); } else { // OCSP check by default pathValidator.enableOCSPCheck(); - ocspEnabled = true; } - new AmazonCA_1().runTest(pathValidator, ocspEnabled); - new AmazonCA_2().runTest(pathValidator, ocspEnabled); - new AmazonCA_3().runTest(pathValidator, ocspEnabled); - new AmazonCA_4().runTest(pathValidator, ocspEnabled); + new AmazonCA_1().runTest(pathValidator); + new AmazonCA_2().runTest(pathValidator); + new AmazonCA_3().runTest(pathValidator); + new AmazonCA_4().runTest(pathValidator); } } class AmazonCA_1 { - // Owner: CN=Amazon, OU=Server CA 1A, O=Amazon, C=US + // Owner: CN=Amazon RSA 2048 M02, O=Amazon, C=US // Issuer: CN=Amazon Root CA 1, O=Amazon, C=US - // Serial number: 67f9457508c648c09ca652e71791830e72592 - // Valid from: Wed Oct 21 17:00:00 PDT 2015 until: Sat Oct 18 17:00:00 PDT 2025 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIERzCCAy+gAwIBAgITBn+UV1CMZIwJymUucXkYMOclkjANBgkqhkiG9w0BAQsF\n" + + // Serial number: 773124a4bcbd44ec7b53beaf194842d3a0fa1 + // Valid from: Tue Aug 23 15:25:30 PDT 2022 until: Fri Aug 23 15:25:30 PDT 2030 + private static final String INT_VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIEXjCCA0agAwIBAgITB3MSSkvL1E7HtTvq8ZSELToPoTANBgkqhkiG9w0BAQsF\n" + + "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" + + "b24gUm9vdCBDQSAxMB4XDTIyMDgyMzIyMjUzMFoXDTMwMDgyMzIyMjUzMFowPDEL\n" + + "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEcMBoGA1UEAxMTQW1hem9uIFJT\n" + + "QSAyMDQ4IE0wMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALtDGMZa\n" + + "qHneKei1by6+pUPPLljTB143Si6VpEWPc6mSkFhZb/6qrkZyoHlQLbDYnI2D7hD0\n" + + "sdzEqfnuAjIsuXQLG3A8TvX6V3oFNBFVe8NlLJHvBseKY88saLwufxkZVwk74g4n\n" + + "WlNMXzla9Y5F3wwRHwMVH443xGz6UtGSZSqQ94eFx5X7Tlqt8whi8qCaKdZ5rNak\n" + + "+r9nUThOeClqFd4oXych//Rc7Y0eX1KNWHYSI1Nk31mYgiK3JvH063g+K9tHA63Z\n" + + "eTgKgndlh+WI+zv7i44HepRZjA1FYwYZ9Vv/9UkC5Yz8/yU65fgjaE+wVHM4e/Yy\n" + + "C2osrPWE7gJ+dXMCAwEAAaOCAVowggFWMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYD\n" + + "VR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAdBgNV\n" + + "HQ4EFgQUwDFSzVpQw4J8dHHOy+mc+XrrguIwHwYDVR0jBBgwFoAUhBjMhTTsvAyU\n" + + "lC4IWZzHshBOCggwewYIKwYBBQUHAQEEbzBtMC8GCCsGAQUFBzABhiNodHRwOi8v\n" + + "b2NzcC5yb290Y2ExLmFtYXpvbnRydXN0LmNvbTA6BggrBgEFBQcwAoYuaHR0cDov\n" + + "L2NydC5yb290Y2ExLmFtYXpvbnRydXN0LmNvbS9yb290Y2ExLmNlcjA/BgNVHR8E\n" + + "ODA2MDSgMqAwhi5odHRwOi8vY3JsLnJvb3RjYTEuYW1hem9udHJ1c3QuY29tL3Jv\n" + + "b3RjYTEuY3JsMBMGA1UdIAQMMAowCAYGZ4EMAQIBMA0GCSqGSIb3DQEBCwUAA4IB\n" + + "AQAtTi6Fs0Azfi+iwm7jrz+CSxHH+uHl7Law3MQSXVtR8RV53PtR6r/6gNpqlzdo\n" + + "Zq4FKbADi1v9Bun8RY8D51uedRfjsbeodizeBB8nXmeyD33Ep7VATj4ozcd31YFV\n" + + "fgRhvTSxNrrTlNpWkUk0m3BMPv8sg381HhA6uEYokE5q9uws/3YkKqRiEz3TsaWm\n" + + "JqIRZhMbgAfp7O7FUwFIb7UIspogZSKxPIWJpxiPo3TcBambbVtQOcNRWz5qCQdD\n" + + "slI2yayq0n2TXoHyNCLEH8rpsJRVILFsg0jc7BaFrMnF462+ajSehgj12IidNeRN\n" + + "4zl+EoNaWdpnWndvSpAEkq2P\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=Amazon RSA 2048 M01, O=Amazon, C=US + // Issuer: CN=Amazon Root CA 1, O=Amazon, C=US + // Serial number: 77312380b9d6688a33b1ed9bf9ccda68e0e0f + // Valid from: Tue Aug 23 15:21:28 PDT 2022 until: Fri Aug 23 15:21:28 PDT 2030 + private static final String INT_REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIEXjCCA0agAwIBAgITB3MSOAudZoijOx7Zv5zNpo4ODzANBgkqhkiG9w0BAQsF\n" + "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" + - "b24gUm9vdCBDQSAxMB4XDTE1MTAyMjAwMDAwMFoXDTI1MTAxOTAwMDAwMFowRjEL\n" + - "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEVMBMGA1U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EEbzBtMC8GCCsGAQUFBzABhiNodHRwOi8v\n" + + "b2NzcC5yb290Y2ExLmFtYXpvbnRydXN0LmNvbTA6BggrBgEFBQcwAoYuaHR0cDov\n" + + "L2NydC5yb290Y2ExLmFtYXpvbnRydXN0LmNvbS9yb290Y2ExLmNlcjA/BgNVHR8E\n" + + "ODA2MDSgMqAwhi5odHRwOi8vY3JsLnJvb3RjYTEuYW1hem9udHJ1c3QuY29tL3Jv\n" + + "b3RjYTEuY3JsMBMGA1UdIAQMMAowCAYGZ4EMAQIBMA0GCSqGSIb3DQEBCwUAA4IB\n" + + "AQCtAN4CBSMuBjJitGuxlBbkEUDeK/pZwTXv4KqPK0G50fOHOQAd8j21p0cMBgbG\n" + + "kfMHVwLU7b0XwZCav0h1ogdPMN1KakK1DT0VwA/+hFvGPJnMV1Kx2G4S1ZaSk0uU\n" + + "5QfoiYIIano01J5k4T2HapKQmmOhS/iPtuo00wW+IMLeBuKMn3OLn005hcrOGTad\n" + + "hcmeyfhQP7Z+iKHvyoQGi1C0ClymHETx/chhQGDyYSWqB/THwnN15AwLQo0E5V9E\n" + + "SJlbe4mBlqeInUsNYugExNf+tOiybcrswBy8OFsd34XOW3rjSUtsuafd9AWySa3h\n" + + "xRRrwszrzX/WWGm6wyB+f7C4\n" + "-----END CERTIFICATE-----"; - // Owner: CN=good.sca1a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=Amazon, OU=Server CA 1A, O=Amazon, C=US - // Serial number: 703e4e4bbd78e2b6db5634f36c4ee944cb1a4 - // Valid from: Mon Jul 29 16:53:36 PDT 2019 until: Sat Aug 29 16:53:36 PDT 2020 + // Owner: CN=valid.rootca1.demo.amazontrust.com + // Issuer: CN=Amazon RSA 2048 M02, O=Amazon, C=US + // Serial number: 60c6e837b2e7586d8464eb34f4a85fe + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIFEzCCA/ugAwIBAgITBwPk5LvXjitttWNPNsTulEyxpDANBgkqhkiG9w0BAQsF\n" + - "ADBGMQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2\n" + - "ZXIgQ0EgMUExDzANBgNVBAMTBkFtYXpvbjAeFw0xOTA3MjkyMzUzMzZaFw0yMDA4\n" + - "MjkyMzUzMzZaMIHaMRMwEQYLKwYBBAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwC\n" + - "AQITCERlbGF3YXJlMR0wGwYDVQQPExRQcml2YXRlIE9yZ2FuaXphdGlvbjEQMA4G\n" + - "A1UEBRMHNTg0Njc0MzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x\n" + - "EDAOBgNVBAcTB1NlYXR0bGUxHjAcBgNVBAoTFUFtYXpvbiBUcnVzdCBTZXJ2aWNl\n" + - "czEjMCEGA1UEAxMaZ29vZC5zY2ExYS5hbWF6b250cnVzdC5jb20wggEiMA0GCSqG\n" + - "SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQyuJ83c2Zf9k29f6iLqd8nJSuHSk1v+SS\n" + - "0sYyG8tjscfCC1HcOdNj37vtiNN65sXh/e/kBKH9wvzhCLOJbBqVKRHOZuHdJEpH\n" + - "35R6C/PbcV/tp49g6mNmBe+lcmm/cwwCtYvkL0rgL/OKB0liFhhRIqy2TPg08op/\n" + - "RlY2DdbgBA2B3g7wdMo0hK3SO56/QUccUtLRm43km9Yd4E3U+CEUyDd0Bmc/YbPa\n" + - "htuXVsXJwiwlwooomujIIENhFw3htdcsu2apRj8EYUrKL8Mvvn+h16gDyobj0f01\n" + - "jWXlUgmH2lzUzca5eGuphfvmWN/ME/yqC2mMvWGnWySycqtT8VdJAg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PMcEPC2YRN2PgBg67c5+A7eIOluuw=\n" + "-----END CERTIFICATE-----"; - // Owner: CN=revoked.sca1a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=PrivateOrganization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=Amazon, OU=Server CA 1A, O=Amazon, C=US - // Serial number: 6f1d774ad5e7b6d251d217661782bbdb6f37d - // Valid from: Mon Jan 28 15:34:38 PST 2019 until: Thu Apr 28 16:34:38 PDT 2022 + // Owner: CN=revoked.rootca1.demo.amazontrust.com + // Issuer: CN=Amazon RSA 2048 M01, O=Amazon, C=US + // Serial number: e1023665b1268d788cc25bf69a9d05e + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIE2zCCA8OgAwIBAgITBvHXdK1ee20lHSF2YXgrvbbzfTANBgkqhkiG9w0BAQsF\n" + - "ADBGMQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2\n" + - "ZXIgQ0EgMUExDzANBgNVBAMTBkFtYXpvbjAeFw0xOTAxMjgyMzM0MzhaFw0yMjA0\n" + - "MjgyMzM0MzhaMIHcMRMwEQYLKwYBBAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwC\n" + - "AQITCERlbGF3YXJlMRwwGgYDVQQPExNQcml2YXRlT3JnYW5pemF0aW9uMRAwDgYD\n" + - "VQQFEwc1ODQ2NzQzMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQ\n" + - "MA4GA1UEBxMHU2VhdHRsZTEeMBwGA1UEChMVQW1hem9uIFRydXN0IFNlcnZpY2Vz\n" + - "MSYwJAYDVQQDEx1yZXZva2VkLnNjYTFhLmFtYXpvbnRydXN0LmN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kZW1vLmFtYXpvbnRydXN0LmNvbYIdcmV2b2tlZC5zY2EwYS5hbWF6\n" + + "b250cnVzdC5jb22CHXJldm9rZWQuc2NhMWEuYW1hem9udHJ1c3QuY29tMA4GA1Ud\n" + + "DwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwOwYDVR0f\n" + + "BDQwMjAwoC6gLIYqaHR0cDovL2NybC5yMm0wMS5hbWF6b250cnVzdC5jb20vcjJt\n" + + "MDEuY3JsMBMGA1UdIAQMMAowCAYGZ4EMAQIBMHUGCCsGAQUFBwEBBGkwZzAtBggr\n" + + "BgEFBQcwAYYhaHR0cDovL29jc3AucjJtMDEuYW1hem9udHJ1c3QuY29tMDYGCCsG\n" + + "AQUFBzAChipodHRwOi8vY3J0LnIybTAxLmFtYXpvbnRydXN0LmNvbS9yMm0wMS5j\n" + + "ZXIwDAYDVR0TAQH/BAIwADCCAX4GCisGAQQB1nkCBAIEggFuBIIBagFoAHYA7s3Q\n" + + "ZNXbGs7FXLedtM0TojKHRny87N7DUUhZRnEftZsAAAGIB72TggAABAMARzBFAiAZ\n" + + "naLbRHRuaRrE304GSuWX/79MU/e+SSlr0cNJ0kNNaAIhAPnz9HayL4txhkTEZiMs\n" + + "nttNnNqD17I0J17JLVOF4i/4AHYASLDja9qmRzQP5WoC+p0w6xxSActW3SyB2bu/\n" + + "qznYhHMAAAGIB72TmwAABAMARzBFAiEAgEqT7CYGQ/u36/3YcxBH78QfknI9kgcY\n" + + "sgJLkurUF6cCIFZZ/b803+ek6o+bmdV/uVx2UlskAyyolZ2okBAb6IscAHYA2ra/\n" + + "az+1tiKfm8K7XGvocJFxbLtRhIU0vaQ9MEjX+6sAAAGIB72TbQAABAMARzBFAiEA\n" + + "6z2RSoK263hvYF71rj1d0TpC70/6zagSRR4glHOT6IACICYvaMAnrCNSTSiZ20Wz\n" + + "Ju5roTippO3BWKhQYrTKZuu4MA0GCSqGSIb3DQEBCwUAA4IBAQB4S1JGulFpMIaP\n" + + "NtLUJmjWz8eexQdWLDVF+H8dd6xpZgpiYtig/Ynphzuk1IIF8DkT3CeK/9vrezgI\n" + + "igNjneN9B4eIuzi/rJzIKeUwpZ2k5D+36Ab4esseoc+TopmNerw8hidt2g818jER\n" + + "D71ppSMakeQFPGe/Hs2/cVa/G1DNVcU2XAut45yRZ/+xsZ0/mcBDVsG9P5uGCN5O\n" + + "7SAp4J959WnKDqgVuU9WowPE5IjmS9BAv2gjniFYdDV2yksyf7+8edHd1KfSVX06\n" + + "pLx6CuCVZGJFG4Q2Aa1YAh1Wvt9hqWeXXpNRO2/wChL5rhT4GajsrGepsk4bjxYX\n" + + "Wf2iZ8mX\n" + "-----END CERTIFICATE-----"; - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // EE certificates don't have CRLDP extension - if (!ocspEnabled){ - pathValidator.validate(new String[]{INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - return; - } + public void runTest(ValidatePathWithParams pathValidator) throws Exception { // Validate valid - pathValidator.validate(new String[]{VALID, INT}, + pathValidator.validate(new String[]{VALID, INT_VALID}, ValidatePathWithParams.Status.GOOD, null, System.out); // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, + pathValidator.validate(new String[]{REVOKED, INT_REVOKED}, ValidatePathWithParams.Status.REVOKED, - "Mon Jan 28 15:35:56 PST 2019", System.out); + "Mon May 15 13:36:57 PDT 2023", System.out); } } class AmazonCA_2 { - // Owner: CN=Amazon, OU=Server CA 2A, O=Amazon, C=US + // Owner: CN=Amazon RSA 4096 M02, O=Amazon, C=US // Issuer: CN=Amazon Root CA 2, O=Amazon, C=US - // Serial number: 67f945755f187a91f8163f3e624620177ff38 - // Valid from: Wed Oct 21 17:00:00 PDT 2015 until: Sat Oct 18 17:00:00 PDT 2025 + // Serial number: 773125b0c34c3c940299a9f04a39e5a52ccd9 + // Valid from: Tue Aug 23 15:29:13 PDT 2022 until: Fri Aug 23 15:29:13 PDT 2030 private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIGRzCCBC+gAwIBAgITBn+UV1Xxh6kfgWPz5iRiAXf/ODANBgkqhkiG9w0BAQwF\n" + + "MIIGXjCCBEagAwIBAgITB3MSWww0w8lAKZqfBKOeWlLM2TANBgkqhkiG9w0BAQwF\n" + "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" + - "b24gUm9vdCBDQSAyMB4XDTE1MTAyMjAwMDAwMFoXDTI1MTAxOTAwMDAwMFowRjEL\n" + - "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEVMBMGA1UECxMMU2VydmVyIENB\n" + - "IDJBMQ8wDQYDVQQDEwZBbWF6b24wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK\n" + - "AoICAQC0P8hSLewmrZ41CCPBQytZs5NBFMq5ztbnMf+kZUp9S25LPfjNW3zgC/6E\n" + - "qCTWNVMMHhq7ez9IQJk48qbfBTLlZkuKnUWbA9vowrDfcxUN0mRE4B/TJbveXyTf\n" + - "vE91iDlqDrERecE9D8sdjzURrtHTp27lZdRkXFvfEVCq4hl3sHkzjodisaQthLp1\n" + - "gLsiA7vKt+8zcL4Aeq52UyYb8r4/jdZ3KaQp8O/T4VwDCRKm8ey3kttpJWaflci7\n" + - "eRzNjY7gE3NMANVXCeQwOBfH2GjINFCObmPsqiBuoAnsv2k5aQLNoU1OZk08ClXm\n" + - "mEZ2rI5qZUTX1HuefBJnpMkPugFCw8afaHnB13SkLE7wxX8SZRdDIe5WiwyDL1tR\n" + - "2+8lpz4JsMoFopHmD3GaHyjbN+hkOqHgLltwewOsiyM0u3CZphypN2KeD+1FLjnY\n" + - "TgdIAd1FRgK2ZXDDrEdjnsSEfShKf0l4mFPSBs9E3U6sLmubDRXKLLLpa/dF4eKu\n" + - "LEKS1bXYT28iM6D5gSCnzho5G4d18jQD/slmc5XmRo5Pig0RyBwDaLuxeIZuiJ0A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wThz5iRbU/0CvDFnTMgebWGUZ2UZJ+az/rb3KYXGfVWasLIonkvYT7z\n" + + "vHOGNAA9oQ8TTgPOmPfSVyfpplKtO/aybWp5QSH2csIwuvw5dkmpkc42iD57XHob\n" + + "5LbMJg99z3vQBmod/ipmOpND95/BeA2mllBZgZ53S0nvDXDzbzR9Fd81PAz9Qruo\n" + + "dOJKcD6plKQjZjkLzNh1v/RoCFO8kiJGE4UBMTM8FUk0DXH4bALII4wwmDelrSUu\n" + + "lKvDTDxZvPF4dbEXICNPd51EMGPgETxwboOV+bzWFVI0IWQ8PhZ2VuMPDk2taOMp\n" + + "NsuLtlYc2twPb9r/Hvgv7G6+ItpBHZwOVt1oI3pHbjMp7P3pOZSPr6G1WkNy9mX8\n" + + "rVc=\n" + "-----END CERTIFICATE-----"; - // Owner: CN=good.sca2a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=Amazon, OU=Server CA 2A, O=Amazon, C=US - // Serial number: 703e4e70616c90d611fd04a5ecc635665184e - // Valid from: Mon Jul 29 16:54:06 PDT 2019 until: Sat Aug 29 16:54:06 PDT 2020 + // Owner: CN=valid.rootca2.demo.amazontrust.com + // Issuer: CN=Amazon RSA 4096 M02, O=Amazon, C=US + // Serial number: 662f7646d76193cbb76946d111e49fa + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHEzCCBPugAwIBAgITBwPk5wYWyQ1hH9BKXsxjVmUYTjANBgkqhkiG9w0BAQwF\n" + - "ADBGMQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2\n" + - "ZXIgQ0EgMkExDzANBgNVBAMTBkFtYXpvbjA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8zbBb/f+UXHDKVWt\n" + - "9l1lL6HQGY/tTo253pj6/FgDD35bZdjLQeUVmbnz679S5oUmoH5ZtSdnpUTghU3p\n" + - "bae9adBFY9S1pm50Q3ckRVBAwNqNmI0KKUh14Ms8KSAUHg19NvGsBonqwOT2rdbv\n" + - "xZ47N6c2eCl/cjMvzre0v0NoUO+3og2GHeAoOwVos6480YDbMqp739tOFPxBcsII\n" + - "6SjpDVh+14dkSW6kEKeaCFLR+eChqutri1VQbQ49nmADQWw9Al8vBytSnPv0YN6W\n" + - "XfIE1Qj7YmHu/UuoeKVsqDqoP/no29+96dtfd4afJqlIoyZUqXpt\n" + + "MIIICzCCBfOgAwIBAgIQBmL3ZG12GTy7dpRtER5J+jANBgkqhkiG9w0BAQwFADA8\n" + + "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRwwGgYDVQQDExNBbWF6b24g\n" + + "UlNBIDQwOTYgTTAyMB4XDTIzMDUxMDAwMDAwMFoXDTI0MDYwNzIzNTk1OVowLTEr\n" + + "MCkGA1UEAxMidmFsaWQucm9vdGNhMi5kZW1vLmFtYXpvbnRydXN0LmNvbTCCAiIw\n" + + "DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAON5EbEKoBiujI7Ja8mLZLJbaY7f\n" + + "RtoWIjU/F0l9ueWFogXmEaA1jWsl97F3WTHTyGKz6ChCjPMSyoXXpY+yoE90QUyX\n" + + "w35uWEhNrc40drMJkyN+QXitSrH346GCOKvpYVvu18UD4W8hDhg8vvbOQYhtmSf7\n" + + "Rfrs7/qUdXpzpvR9VjWktbQAzJT8fB/jFNjNQJTknynjGiYO5GF51+peOCLK6qw8\n" + + "9kKYEigR4K8/aWL283rC4xRxZqVioy433VG02l/Fwdv8o/vL9YYIqkyspCB9fpFw\n" + + "Q50yYrwEomxuOz7rXhmdfeNaFYuyTtOUSKff6p2oqO0S7pcLujUVMlO4dYBDELQF\n" + + "cabByNjwblviCtGKJMIzD6Thkgamp3iXQgcU498+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+ "+rTcuke2feOvQ4EnVviM0k85JZNiqPDH2iafAWyqZFUYTnb7XK3HhJflAniv/SLq\n" + + "DQfbJmtQtNHdJYgVmC1u2RT9gbJDIAj0ZI4vU2WVB5Hmd9F31un6jundEuG4+S4=\n" + "-----END CERTIFICATE-----"; - // Owner: CN=revoked.sca2a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=PrivateOrganization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - //Issuer: CN=Amazon, OU=Server CA 2A, O=Amazon, C=US - //Serial number: 6f1d782c0aa2f4866b7b522c279b939b92369 - //Valid from: Mon Jan 28 15:37:45 PST 2019 until: Thu Apr 28 16:37:45 PDT 2022 + // Owner: CN=revoked.rootca2.demo.amazontrust.com + // Issuer: CN=Amazon RSA 4096 M02, O=Amazon, C=US + // Serial number: 788baa8f47bc5b1c624424216240fd3 + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIG2zCCBMOgAwIBAgITBvHXgsCqL0hmt7Uiwnm5ObkjaTANBgkqhkiG9w0BAQwF\n" + - "ADBGMQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2\n" + - "ZXIgQ0EgMkExDzANBgNVBAMTBkFtYXpvbjAeFw0xOTAxMjgyMzM3NDVaFw0yMjA0\n" + - "MjgyMzM3NDVaMIHcMRMwEQYLKwYBBAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwC\n" + - "AQITCERlbGF3YXJlMRwwGgYDVQQPExNQcml2YXRlT3JnYW5pemF0aW9uMRAwDgYD\n" + - "VQQFEwc1ODQ2NzQzMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQ\n" + - "MA4GA1UEBxMHU2V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EAAaOCAxswggMXMB8GA1UdIwQYMBaAFJ5xHxodk6nZ\n" + + "LY7MSFM/A1TznuZmMB0GA1UdDgQWBBQXpWT7gMHO+HKoHM1gU1VQVnylRzBOBgNV\n" + + "HREERzBFgiRyZXZva2VkLnJvb3RjYTIuZGVtby5hbWF6b250cnVzdC5jb22CHXJl\n" + + "dm9rZWQuc2NhMmEuYW1hem9udHJ1c3QuY29tMA4GA1UdDwEB/wQEAwIFoDAdBgNV\n" + + "HSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwOwYDVR0fBDQwMjAwoC6gLIYqaHR0\n" + + "cDovL2NybC5yNG0wMi5hbWF6b250cnVzdC5jb20vcjRtMDIuY3JsMBMGA1UdIAQM\n" + + "MAowCAYGZ4EMAQIBMHUGCCsGAQUFBwEBBGkwZzAtBggrBgEFBQcwAYYhaHR0cDov\n" + + "L29jc3AucjRtMDIuYW1hem9udHJ1c3QuY29tMDYGCCsGAQUFBzAChipodHRwOi8v\n" + + "Y3J0LnI0bTAyLmFtYXpvbnRydXN0LmNvbS9yNG0wMi5jZXIwDAYDVR0TAQH/BAIw\n" + + "ADCCAX0GCisGAQQB1nkCBAIEggFtBIIBaQFnAHYA7s3QZNXbGs7FXLedtM0TojKH\n" + + "Rny87N7DUUhZRnEftZsAAAGIB72CzgAABAMARzBFAiEA2vPYIPfGJeynPaZHq/c0\n" + + "GGvyT6MpvFGMW0s0woLRT28CIEFbZbFSCnKugaqw9QDNi7vYmIF3Gyi3s6G2cCxY\n" + + "4RJXAHYASLDja9qmRzQP5WoC+p0w6xxSActW3SyB2bu/qznYhHMAAAGIB72DDgAA\n" + + "BAMARzBFAiAvfNcgtFEwk5C9dvMUYANbIAv0IOdF1new8Umn3cM+JwIhALbs/3L9\n" + + "0ndF7sRKDZmfronNruptFlrI528P5Qi2P528AHUA2ra/az+1tiKfm8K7XGvocJFx\n" + + "bLtRhIU0vaQ9MEjX+6sAAAGIB72CxQAABAMARjBEAiBKUns2FPbs0cThb6e7SnyL\n" + + "y4/qP3V1Q/ASt/ZDRTeEQQIgWSQO4Gsz32srtqYuTM9AsFd92WA44kJHincdcGVX\n" + + "XbIwDQYJKoZIhvcNAQEMBQADggIBAAnaNbn2wXylTCS7dtgB3rWdUf6hja1UDuvB\n" + + "uZEL2dUOvyXfVFLNxKdeWBPzqpwEBNNwPQXhoI97TXlyu2x60jLzQamoGoRQ3s0P\n" + + "NLhasLGEIQH/oYdMV/yp8EI8fUuRVE3xyw39FRqOrmsUFAnxNQmBO/09JM7sLcvS\n" + + "wwh14p9dFTTolJHgnL4ZEtmZxSddFG+GBSTJ/A7dVSmwIudwzd+goA6173BI6yeT\n" + + "hhQumLctQiOM7y1MzFeV8rL+oIpd2xuzyhKKT1EgvU6/wyt0Ib8QqsFsrXPnUOKk\n" + + "HAq3SeZyq35QUaTKoaH9L1iZMbSCG9Jm6FMb12SdAz53653tYvAiUS76oD8Jot13\n" + + "RZu5NUlWAVLLq0OaEtuGp0bh+cVtzVnCC9m1qa46YpY0SojpvSbakgQMMGIgDlT3\n" + + "wFE7tST4WlsDC1f/m+H9V5qz/j0U8D3eNNdowxPqx/JZq/sk9ZK5KyMFARrvM+fh\n" + + "YrVYjKt91mu7JaS4pPOyZmJ8OQ14EvrN7BXc7IkNrI1reeaRFe49k5DAETB8VmP5\n" + + "2F0SWou2KkgtJvU4Z7YjlZ2HNHnpjTK5KdPNpRSt7EUy2zn9NCNoyQhnws70FyXv\n" + + "oPFyG92lnUQOKaAUhVRwTr9fvnkdMOzSKg/spxi2Ogdzym5Jw68eguwi0dVqX2+9\n" + + "3zViP2aH\n" + "-----END CERTIFICATE-----"; - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // EE certificates don't have CRLDP extension - if (!ocspEnabled){ - pathValidator.validate(new String[]{INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - return; - } + public void runTest(ValidatePathWithParams pathValidator) throws Exception { // Validate valid pathValidator.validate(new String[]{VALID, INT}, @@ -344,201 +378,228 @@ public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) t // Validate Revoked pathValidator.validate(new String[]{REVOKED, INT}, ValidatePathWithParams.Status.REVOKED, - "Mon Jan 28 15:38:57 PST 2019", System.out); + "Mon May 15 13:38:54 PDT 2023", System.out); } } class AmazonCA_3 { - // Owner: CN=Amazon, OU=Server CA 3A, O=Amazon, C=US + // Owner: CN=Amazon ECDSA 256 M02, O=Amazon, C=US // Issuer: CN=Amazon Root CA 3, O=Amazon, C=US - // Serial number: 67f945758fe55b9ee3f75831d47f07d226c8a - // Valid from: Wed Oct 21 17:00:00 PDT 2015 until: Sat Oct 18 17:00:00 PDT 2025 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIICuzCCAmGgAwIBAgITBn+UV1j+VbnuP3WDHUfwfSJsijAKBggqhkjOPQQDAjA5\n" + + // Serial number: 773126de2c2fafd2c47ad88b1566e0182046d + // Valid from: Tue Aug 23 15:33:24 PDT 2022 until: Fri Aug 23 15:33:24 PDT 2030 + private static final String INT_VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIC1DCCAnmgAwIBAgITB3MSbeLC+v0sR62IsVZuAYIEbTAKBggqhkjOPQQDAjA5\n" + + "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g\n" + + "Um9vdCBDQSAzMB4XDTIyMDgyMzIyMzMyNFoXDTMwMDgyMzIyMzMyNFowPTELMAkG\n" + + "A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEdMBsGA1UEAxMUQW1hem9uIEVDRFNB\n" + + "IDI1NiBNMDIwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAS9vQLD4W/Kg4AnFRl8\n" + + "x/FUbLqtd5ICYjUijGsytF9hmgb/Dyk+Ebt4cw6rAlGbaiOLapSJKZiZr+UQdh3I\n" + + "QOr+o4IBWjCCAVYwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYw\n" + + "HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB0GA1UdDgQWBBS7eJrXaDMy\n" + + "nRq7bP2xNEwB3svQdTAfBgNVHSMEGDAWgBSrttvXBp43rDCGB5Fwx5zEGbF4wDB7\n" + + "BggrBgEFBQcBAQRvMG0wLwYIKwYBBQUHMAGGI2h0dHA6Ly9vY3NwLnJvb3RjYTMu\n" + + "YW1hem9udHJ1c3QuY29tMDoGCCsGAQUFBzAChi5odHRwOi8vY3J0LnJvb3RjYTMu\n" + + "YW1hem9udHJ1c3QuY29tL3Jvb3RjYTMuY2VyMD8GA1UdHwQ4MDYwNKAyoDCGLmh0\n" + + "dHA6Ly9jcmwucm9vdGNhMy5hbWF6b250cnVzdC5jb20vcm9vdGNhMy5jcmwwEwYD\n" + + "VR0gBAwwCjAIBgZngQwBAgEwCgYIKoZIzj0EAwIDSQAwRgIhAKSYEcDcp3kcPMzh\n" + + "OIYDWZOLu4InPod4fQhRTmc2zBAgAiEAmwdGE4AuNWhw9N8REhf82rJLNm7h9Myg\n" + + "TsR9Wu0bQYU=\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=Amazon ECDSA 256 M01, O=Amazon, C=US + // Issuer: CN=Amazon Root CA 3, O=Amazon, C=US + // Serial number: 773126684d577c0fcf8d3a342bea86f94fc8f + // Valid from: Tue Aug 23 15:31:46 PDT 2022 until: Fri Aug 23 15:31:46 PDT 2030 + private static final String INT_REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIC0zCCAnmgAwIBAgITB3MSZoTVd8D8+NOjQr6ob5T8jzAKBggqhkjOPQQDAjA5\n" + "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g\n" + - "Um9vdCBDQSAzMB4XDTE1MTAyMjAwMDAwMFoXDTI1MTAxOTAwMDAwMFowRjELMAkG\n" + - "A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEVMBMG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VYwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYw\n" + + "HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB0GA1UdDgQWBBRPWfy8BhYo\n" + + "v6LI2wj7zxMkumlCXDAfBgNVHSMEGDAWgBSrttvXBp43rDCGB5Fwx5zEGbF4wDB7\n" + + "BggrBgEFBQcBAQRvMG0wLwYIKwYBBQUHMAGGI2h0dHA6Ly9vY3NwLnJvb3RjYTMu\n" + + "YW1hem9udHJ1c3QuY29tMDoGCCsGAQUFBzAChi5odHRwOi8vY3J0LnJvb3RjYTMu\n" + + "YW1hem9udHJ1c3QuY29tL3Jvb3RjYTMuY2VyMD8GA1UdHwQ4MDYwNKAyoDCGLmh0\n" + + "dHA6Ly9jcmwucm9vdGNhMy5hbWF6b250cnVzdC5jb20vcm9vdGNhMy5jcmwwEwYD\n" + + "VR0gBAwwCjAIBgZngQwBAgEwCgYIKoZIzj0EAwIDSAAwRQIhALRfxq3SQIhj5xA4\n" + + "S5UAY/KlKqayZDpnbBdCDH8Kqmf/AiAUVZddALefnqRe+ifxN2FUp461LL6/cgVM\n" + + "EH3Ty27f1Q==\n" + "-----END CERTIFICATE-----"; - // Owner: CN=good.sca3a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=Amazon, OU=Server CA 3A, O=Amazon, C=US - // Serial number: 703e4e9bbc2605f37967a0e95f31f4789a677 - // Valid from: Mon Jul 29 16:54:43 PDT 2019 until: Sat Aug 29 16:54:43 PDT 2020 + // Owner: CN=valid.rootca3.demo.amazontrust.com + // Issuer: CN=Amazon ECDSA 256 M02, O=Amazon, C=US + // Serial number: 8e2f14864fb28e4a1da0f15a5118cc8 + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIDhzCCAy2gAwIBAgITBwPk6bvCYF83lnoOlfMfR4mmdzAKBggqhkjOPQQDAjBG\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2ZXIg\n" + - "Q0EgM0ExDzANBgNVBAMTBkFtYXpvbjAeFw0xOTA3MjkyMzU0NDNaFw0yMDA4Mjky\n" + - "MzU0NDNaMIHaMRMwEQYLKwYBBAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwCAQIT\n" + - "CERlbGF3YXJlMR0wGwYDVQQPExRQcml2YXRlIE9yZ2FuaXphdGlvbjEQMA4GA1UE\n" + - "BRMHNTg0Njc0MzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAO\n" + - "BgNVBAcTB1NlYXR0bGUxHjAcBgNVBAoTFUFtYXpvbiBUcnVzdCBTZXJ2aWNlczEj\n" + - "MCEGA1UEAxMaZ29vZC5zY2EzYS5hbWF6b250cnVzdC5jb20wWTATBgcqhkjOPQIB\n" + - "BggqhkjOPQMBBwNCAARl4yxf8XcvWR0LZ+YuBC0CpkwtU2NiMdlIM7eX0lxhQp53\n" + - "NpLlCrPRNzOWrjCJDdn21D0u7PrtN94UHLHOg9X0o4IBYzCCAV8wDgYDVR0PAQH/\n" + - "BAQDAgeAMB0GA1UdDgQWBBT2cHmOJFLWfg1Op7xAdAnqYcwaPzAfBgNVHSMEGDAW\n" + - "gBQE3OCV5ei5a5Sh74xbMR4TflWX2jAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYB\n" + - "BQUHAwIwdQYIKwYBBQUHAQEEaTBnMC0GCCsGAQUFBzABhiFodHRwOi8vb2NzcC5z\n" + - "Y2EzYS5hbWF6b250cnVzdC5jb20wNgYIKwYBBQUHMAKGKmh0dHA6Ly9jcnQuc2Nh\n" + - "M2EuYW1hem9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Mi5hbWF6b250cnVzdC5jb20vZTJtMDIu\n" + + "Y3JsMBMGA1UdIAQMMAowCAYGZ4EMAQIBMHUGCCsGAQUFBwEBBGkwZzAtBggrBgEF\n" + + "BQcwAYYhaHR0cDovL29jc3AuZTJtMDIuYW1hem9udHJ1c3QuY29tMDYGCCsGAQUF\n" + + "BzAChipodHRwOi8vY3J0LmUybTAyLmFtYXpvbnRydXN0LmNvbS9lMm0wMi5jZXIw\n" + + "DAYDVR0TAQH/BAIwADCCAXwGCisGAQQB1nkCBAIEggFsBIIBaAFmAHUA7s3QZNXb\n" + + "Gs7FXLedtM0TojKHRny87N7DUUhZRnEftZsAAAGIB71y/gAABAMARjBEAiAEAXIb\n" + + "aOVR26HgFaI+qoIasCb8w2sOqVxGAxf5iPgX6QIgdAlMjqeoihi1arnJpzN8Bqxy\n" + + "5ULMUO7GK3JEgcogJHMAdgBIsONr2qZHNA/lagL6nTDrHFIBy1bdLIHZu7+rOdiE\n" + + "cwAAAYgHvXLkAAAEAwBHMEUCIF7wDDmWxTHwBZM7Me8eOCM1aQ/g1c1rJg/I+NJa\n" + + "HkZYAiEA8p+IviuY5piHBELjUtVlZLiS9XSSMxpQNhUerqC/YFoAdQDatr9rP7W2\n" + + "Ip+bwrtca+hwkXFsu1GEhTS9pD0wSNf7qwAAAYgHvXKvAAAEAwBGMEQCIFLskZDs\n" + + "UG4+/88D/5/QbD9zT6ZmZlwXiPZ6H2YR/KiJAiBvi4vvNsb9KNAhJMgI2T2iCg9U\n" + + "CIru+US6y3ua7dKKDTAKBggqhkjOPQQDAgNHADBEAiAzvgzKV/kvBbKWCT1NNUBD\n" + + "AF9okIEcJx/ukFgzmYMwUQIgXeJeVf3izkxsgiEUSknwHsErLFs/cEme2PSRj2AW\n" + + "dYA=\n" + "-----END CERTIFICATE-----"; - // Owner: CN=revoked.sca3a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=PrivateOrganization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=Amazon, OU=Server CA 3A, O=Amazon, C=US - // Serial number: 6f1d78cf0ca64ce7f551a6f2a0715cc0e8b50 - // Valid from: Mon Jan 28 15:40:01 PST 2019 until: Thu Apr 28 16:40:01 PDT 2022 + // Owner: CN=revoked.rootca3.demo.amazontrust.com + // Issuer: CN=Amazon ECDSA 256 M01, O=Amazon, C=US + // Serial number: c458bfaeedae16a5e61fe64773fc898 + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIDTzCCAvWgAwIBAgITBvHXjPDKZM5/VRpvKgcVzA6LUDAKBggqhkjOPQQDAjBG\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2ZXIg\n" + - "Q0EgM0ExDzANBgNVBAMTBkFtYXpvbjAeFw0xOTAxMjgyMzQwMDFaFw0yMjA0Mjgy\n" + - "MzQwMDFaMIHcMRMwEQYLKwYBBAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwCAQIT\n" + - "CERlbGF3YXJlMRwwGgYDVQQPExNQcml2YXRlT3JnYW5pemF0aW9uMRAwDgYDVQQF\n" + - "Ewc1ODQ2NzQzMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G\n" + - "A1UEBxMHU2VhdHRsZTEeMBwGA1UEChMVQW1hem9uIFRydXN0IFNlcnZpY2VzMSYw\n" + - "JAYDVQQDEx1yZXZva2VkLnNjYTNhLmFtYXpvbnRydXN0LmNvbTBZMBMGByqGSM49\n" + - "AgEGCCqGSM49AwEHA0IABJNl90Jq0wddpFj+JbLtmvGR/1geL5t1tvV406jGpYn2\n" + - "C5lAFjwASFy7pAnazZbfSkIDUU2i2XU0+7Cs+j1S/EOjggEpMIIB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Mfe6MAoGCCqGSM49BAMCA0gAMEUCIQC+6VdX9X5g\n" + + "x3NSUmJ7py01Zxf26TNBv1ildxqesvZ/7wIgIrefriRzPiIFDHCUbdjk0VlmMwZR\n" + + "VzXXHINsGCiCKOs=\n" + "-----END CERTIFICATE-----"; - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // EE certificates don't have CRLDP extension - if (!ocspEnabled){ - pathValidator.validate(new String[]{INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - return; - } + public void runTest(ValidatePathWithParams pathValidator) throws Exception { // Validate valid - pathValidator.validate(new String[]{VALID, INT}, + pathValidator.validate(new String[]{VALID, INT_VALID}, ValidatePathWithParams.Status.GOOD, null, System.out); // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, + pathValidator.validate(new String[]{REVOKED, INT_REVOKED}, ValidatePathWithParams.Status.REVOKED, - "Mon Jan 28 15:40:35 PST 2019", System.out); + "Mon May 15 13:41:22 PDT 2023", System.out); } } class AmazonCA_4 { - // Owner: CN=Amazon, OU=Server CA 4A, O=Amazon, C=US + // Owner: CN=Amazon ECDSA 384 M02, O=Amazon, C=US // Issuer: CN=Amazon Root CA 4, O=Amazon, C=US - // Serial number: 67f94575a8862a9072e3239c37ceba1274e18 - // Valid from: Wed Oct 21 17:00:00 PDT 2015 until: Sat Oct 18 17:00:00 PDT 2025 + // Serial number: 773127dfaa6b9e2b95538aa76dde4307f17c4 + // Valid from: Tue Aug 23 15:36:58 PDT 2022 until: Fri Aug 23 15:36:58 PDT 2030 private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIC+TCCAn6gAwIBAgITBn+UV1qIYqkHLjI5w3zroSdOGDAKBggqhkjOPQQDAzA5\n" + + "MIIDETCCApagAwIBAgITB3MSffqmueK5VTiqdt3kMH8XxDAKBggqhkjOPQQDAzA5\n" + "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g\n" + - "Um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kFtYXpvbjEdMBsGA1UEAxMUQW1hem9uIEVDRFNB\n" + + "IDM4NCBNMDIwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAATNYzWQDXV0NoNmR0hJPwJq\n" + + "hjYOOS9z0B2Z7MQudxg5x3Vsib6N+tJkq8dljRq5o6K0bbh/kRVfoi9wfKhB03Yz\n" + + "gkerrwRCH7Z9gU5nbBY+Y5+EtImq4yOB0n7JQgQxWemjggFaMIIBVjASBgNVHRMB\n" + + "Af8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBhjAdBgNVHSUEFjAUBggrBgEFBQcD\n" + + "AQYIKwYBBQUHAwIwHQYDVR0OBBYEFKbZqzuHmTP/6Gj4i2GDbNCyuq+9MB8GA1Ud\n" + + "IwQYMBaAFNPsxzplbszh2naaVvuc84ZtV+WBMHsGCCsGAQUFBwEBBG8wbTAvBggr\n" + + "BgEFBQcwAYYjaHR0cDovL29jc3Aucm9vdGNhNC5hbWF6b250cnVzdC5jb20wOgYI\n" + + "KwYBBQUHMAKGLmh0dHA6Ly9jcnQucm9vdGNhNC5hbWF6b250cnVzdC5jb20vcm9v\n" + + "dGNhNC5jZXIwPwYDVR0fBDgwNjA0oDKgMIYuaHR0cDovL2NybC5yb290Y2E0LmFt\n" + + "YXpvbnRydXN0LmNvbS9yb290Y2E0LmNybDATBgNVHSAEDDAKMAgGBmeBDAECATAK\n" + + "BggqhkjOPQQDAwNpADBmAjEA2zCG6x0xMlgSXWEGLN8+1XN+OCYF5vj0Z1jtVy+A\n" + + "pdLlzuxNt9HBWn3hvqvO2W8KAjEApNdsZOCmk5uZBYiuCSBnDH3jyKhN6dWyuuHW\n" + + "9Wj7SxKnOU5+wYWZA0BQAv1KT62i\n" + "-----END CERTIFICATE-----"; - // Owner: CN=good.sca4a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=Amazon, OU=Server CA 4A, O=Amazon, C=US - // Serial number: 703e4ec57c72d5669efbc98875c3f6bc3f934 - // Valid from: Mon Jul 29 16:55:17 PDT 2019 until: Sat Aug 29 16:55:17 PDT 2020 + // Owner: CN=valid.rootca4.demo.amazontrust.com + // Issuer: CN=Amazon ECDSA 384 M02, O=Amazon, C=US + // Serial number: f579bed3369f1a147ea5d0e8e6532d3 + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIDxTCCA0qgAwIBAgITBwPk7FfHLVZp77yYh1w/a8P5NDAKBggqhkjOPQQDAzBG\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2ZXIg\n" + - "Q0EgNEExDzANBgNVBAMTBkFtYXpvbjAeFw0xOTA3MjkyMzU1MTdaFw0yMDA4Mjky\n" + - "MzU1MTdaMIHaMRMwEQYLKwYBBAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwCAQIT\n" + - "CERlbGF3YXJlMR0wGwYDVQQPExRQcml2YXRlIE9yZ2FuaXphdGlvbjEQMA4GA1UE\n" + - "BRMHNTg0Njc0MzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAO\n" + - "BgNVBAcTB1NlYXR0bGUxHjAcBgNVBAoTFUFtYXpvbiBUcnVzdCBTZXJ2aWNlczEj\n" + - "MCEGA1UEAxMaZ29vZC5zY2E0YS5hbWF6b250cnVzdC5jb20wdjAQBgcqhkjOPQIB\n" + - "BgUrgQQAIgNiAAS9fqMYfOBsdXMSsPjqOlTgIGOlOQWA7Wg6XwVvHTr0+UN+XTeC\n" + - "yZN+XjLbEDQ0CF5eryRZ535sDpwh3qNe0lYFO1n1+2iDtDI1jhhLNYNxBpVnR2BU\n" + - "2l9EuRmgRbQ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M/X+EAdgDatr9rP7W2Ip+bwrtca+hwkXFsu1GEhTS9\n" + + "pD0wSNf7qwAAAYgHvZBeAAAEAwBHMEUCIAI+m4mVE3HtZOEMC5VI7m0nEPdPPJUq\n" + + "fxUKPpeIVmk5AiEA0scVJy7g3Fv+2nTVhbcwWCwn/Gvc+0txQrc529juflcwCgYI\n" + + "KoZIzj0EAwMDaAAwZQIxAKV837BpqlNHg35EsCCtrJPoQ6RuY9UoHm1O2CdsCXGR\n" + + "Z3kAnlgIV8A/waI6wQqfsQIwdCqaC+qN60JCnX09YKRD15eQjq1rN3w+llI+lEbS\n" + + "FSMsnoHJcqMZLo9s+4Rf0zS3\n" + "-----END CERTIFICATE-----"; - // Owner: CN=revoked.sca4a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=PrivateOrganization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=Amazon, OU=Server CA 4A, O=Amazon, C=US - // Serial number: 6f1d79295c384a699d51c2d756bd46213b5b3 - // Valid from: Mon Jan 28 15:41:16 PST 2019 until: Thu Apr 28 16:41:16 PDT 2022 + // Owner: CN=revoked.rootca4.demo.amazontrust.com + // Issuer: CN=Amazon ECDSA 384 M02, O=Amazon, C=US + // Serial number: 4a5d392936b4decb818b7fb106ebbd8 + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIDjTCCAxKgAwIBAgITBvHXkpXDhKaZ1RwtdWvUYhO1szAKBggqhkjOPQQDAzBG\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2ZXIg\n" + - "Q0EgNEExDzANBgNVBAMTBkFtYXpvbjAeFw0xOTAxMjgyMzQxMTZaFw0yMjA0Mjgy\n" + - "Mz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vbS9lM20wMi5jZXIwDAYDVR0TAQH/BAIw\n" + + "ADCCAX8GCisGAQQB1nkCBAIEggFvBIIBawFpAHYAdv+IPwq2+5VRwmHM9Ye6NLSk\n" + + "zbsp3GhCCp/mZ0xaOnQAAAGIB72QJQAABAMARzBFAiA74zKrlL+y5rYwSLxBL8fs\n" + + "QYRYXF0s0sGoaSEeAg1DkgIhAPu8Z0TLIFoppmyiv+A5z6S+SG+v/kOsAYmQmiUO\n" + + "5scIAHcASLDja9qmRzQP5WoC+p0w6xxSActW3SyB2bu/qznYhHMAAAGIB72QJgAA\n" + + "BAMASDBGAiEAg+x7JBT3oIaZdnfgGN1G6SAiNUL7zR/tBhbWIG9tz94CIQDGwBiV\n" + + "Tslt11+W3ZaNsS7UtUIiB45YHUc4qKm5ry2fTAB2ANq2v2s/tbYin5vCu1xr6HCR\n" + + "cWy7UYSFNL2kPTBI1/urAAABiAe9kAgAAAQDAEcwRQIgPvKfSpMJKRocGk9+GNr3\n" + + "hUj8x8WySB//0X116TNgA0gCIQDhGRqxnEZmEFGEfj5GY9vjEfm0kKwcL0lCuwBu\n" + + "NZG4dzAKBggqhkjOPQQDAwNoADBlAjEA1PLdsrko3tDs50aAeEU9Gn+0CG8QKy7R\n" + + "fQaXBTjGETDgGJk/7zGNpGelKPr/UYV9AjASwdA32S8jIADxA8HrqiMsVYDFMnbU\n" + + "jLLwR6CTLtAcWtwVmoQ2x0usvTvN8YJBPoA=\n" + "-----END CERTIFICATE-----"; - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // EE certificates don't have CRLDP extension - if (!ocspEnabled){ - pathValidator.validate(new String[]{INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - return; - } + public void runTest(ValidatePathWithParams pathValidator) throws Exception { // Validate valid pathValidator.validate(new String[]{VALID, INT}, @@ -547,6 +608,6 @@ public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) t // Validate Revoked pathValidator.validate(new String[]{REVOKED, INT}, ValidatePathWithParams.Status.REVOKED, - "Mon Jan 28 15:41:53 PST 2019", System.out); + "Mon May 15 13:42:48 PDT 2023", System.out); } } diff --git a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java index afad9cee62c..4007227c862 100644 --- a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java +++ b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java @@ -30,7 +30,7 @@ * @test * @bug 6216082 * @summary Redirect problem with HttpsURLConnection using a proxy - * @library .. /lib + * @library .. /test/lib * @build jdk.test.lib.NetworkConfiguration * jdk.test.lib.Platform * HttpCallback TestHttpsServer ClosedChannelList diff --git a/jdk/test/sun/security/ec/SignedObjectChain.java b/jdk/test/sun/security/ec/SignedObjectChain.java index 7e2610a512a..38e2d56c0ab 100644 --- a/jdk/test/sun/security/ec/SignedObjectChain.java +++ b/jdk/test/sun/security/ec/SignedObjectChain.java @@ -25,7 +25,7 @@ * @test * @bug 8050374 8146293 * @summary Verify a chain of signed objects - * @library /lib + * @library /test/lib * @compile ../../../java/security/SignedObject/Chain.java * @run main SignedObjectChain */ diff --git a/jdk/test/sun/security/krb5/config/YesNo.java b/jdk/test/sun/security/krb5/config/YesNo.java new file mode 100644 index 00000000000..c25c8279663 --- /dev/null +++ b/jdk/test/sun/security/krb5/config/YesNo.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2014, 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 8029995 + * @summary accept yes/no for boolean krb5.conf settings + * @compile -XDignore.symbol.file YesNo.java + * @run main/othervm YesNo + */ +import sun.security.krb5.Config; +import sun.security.krb5.internal.crypto.EType; + +import java.util.Arrays; + +public class YesNo { + static Config config = null; + public static void main(String[] args) throws Exception { + System.setProperty("java.security.krb5.conf", + System.getProperty("test.src", ".") +"/yesno.conf"); + config = Config.getInstance(); + check("a", Boolean.TRUE); + check("b", Boolean.FALSE); + check("c", Boolean.TRUE); + check("d", Boolean.FALSE); + check("e", null); + check("f", null); + + if (!Arrays.stream(EType.getBuiltInDefaults()) + .anyMatch(n -> n < 4)) { + throw new Exception(); + } + } + + static void check(String k, Boolean expected) throws Exception { + Boolean result = config.getBooleanObject("libdefaults", k); + if (expected != result) { + throw new Exception("value for " + k + " is " + result); + } + } +} diff --git a/jdk/test/sun/security/krb5/config/yesno.conf b/jdk/test/sun/security/krb5/config/yesno.conf new file mode 100644 index 00000000000..681c19daf51 --- /dev/null +++ b/jdk/test/sun/security/krb5/config/yesno.conf @@ -0,0 +1,7 @@ +[libdefaults] +a = true +b = FALSE +c = YES +d = no +e = nothing +allow_weak_crypto = yes diff --git a/jdk/test/sun/security/mscapi/SignedObjectChain.java b/jdk/test/sun/security/mscapi/SignedObjectChain.java index 931a0b30841..e6a5d848705 100644 --- a/jdk/test/sun/security/mscapi/SignedObjectChain.java +++ b/jdk/test/sun/security/mscapi/SignedObjectChain.java @@ -25,7 +25,7 @@ * @test * @bug 8050374 8146293 * @summary Verify a chain of signed objects - * @library /lib + * @library /test/lib * @compile ../../../java/security/SignedObject/Chain.java * @run main SignedObjectChain */ diff --git a/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java b/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java index 717590f62ae..51358b43228 100644 --- a/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java +++ b/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java @@ -31,7 +31,7 @@ * @bug 6405536 * @summary Verify that all ciphersuites work (incl. ECC using NSS crypto) * @author Andreas Sterbenz - * @library /lib .. ../../../../javax/net/ssl/TLSCommon + * @library /test/lib .. ../../../../javax/net/ssl/TLSCommon * @library ../../../../java/security/testlibrary * @run main/othervm -Djdk.tls.namedGroups="secp256r1,sect193r1" * ClientJSSEServerJSSE diff --git a/jdk/test/sun/security/pkcs12/EmptyPassword.java b/jdk/test/sun/security/pkcs12/EmptyPassword.java index 4a24b06d97b..23d3d22f4dd 100644 --- a/jdk/test/sun/security/pkcs12/EmptyPassword.java +++ b/jdk/test/sun/security/pkcs12/EmptyPassword.java @@ -26,7 +26,7 @@ * @bug 8202299 * @modules java.base/sun.security.tools.keytool * java.base/sun.security.x509 - * @library /lib / + * @library /test/lib / * @summary Java Keystore fails to load PKCS12/PFX certificates created in WindowsServer2016 */ diff --git a/jdk/test/sun/security/pkcs12/ParamsPreferences.java b/jdk/test/sun/security/pkcs12/ParamsPreferences.java index 8a1cf73cbb7..b08825e6167 100644 --- a/jdk/test/sun/security/pkcs12/ParamsPreferences.java +++ b/jdk/test/sun/security/pkcs12/ParamsPreferences.java @@ -38,7 +38,7 @@ /* * @test * @bug 8076190 - * @library /lib/testlibrary /lib + * @library /lib/testlibrary /test/lib * @modules java.base/sun.security.pkcs * java.base/sun.security.x509 * java.base/sun.security.util diff --git a/jdk/test/sun/security/pkcs12/ParamsTest.java b/jdk/test/sun/security/pkcs12/ParamsTest.java index 62f434e3d39..6c2ca7bffc2 100644 --- a/jdk/test/sun/security/pkcs12/ParamsTest.java +++ b/jdk/test/sun/security/pkcs12/ParamsTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8076190 - * @library /lib/testlibrary /lib + * @library /lib/testlibrary /test/lib * @modules java.base/sun.security.pkcs * java.base/sun.security.x509 * java.base/sun.security.util diff --git a/jdk/test/sun/security/rsa/SignatureTest.java b/jdk/test/sun/security/rsa/SignatureTest.java index 0752bd084b4..7b60384018c 100644 --- a/jdk/test/sun/security/rsa/SignatureTest.java +++ b/jdk/test/sun/security/rsa/SignatureTest.java @@ -38,7 +38,7 @@ * @summary Create a signature for RSA and get its signed data. re-initiate * the signature with the public key. The signature can be verified * by acquired signed data. - * @library /lib + * @library /test/lib * @key randomness * @library ../../../lib/testlibrary * @run main SignatureTest MD2withRSA 512 diff --git a/jdk/test/sun/security/rsa/SignedObjectChain.java b/jdk/test/sun/security/rsa/SignedObjectChain.java index fea6028d92e..d1923730dac 100644 --- a/jdk/test/sun/security/rsa/SignedObjectChain.java +++ b/jdk/test/sun/security/rsa/SignedObjectChain.java @@ -25,7 +25,7 @@ * @test * @bug 8050374 8146293 * @summary Verify a chain of signed objects - * @library /lib + * @library /test/lib * @compile ../../../java/security/SignedObject/Chain.java * @run main SignedObjectChain */ diff --git a/jdk/test/sun/security/rsa/TestKeyPairGenerator.java b/jdk/test/sun/security/rsa/TestKeyPairGenerator.java index 5039ed98060..4a64554045d 100644 --- a/jdk/test/sun/security/rsa/TestKeyPairGenerator.java +++ b/jdk/test/sun/security/rsa/TestKeyPairGenerator.java @@ -25,7 +25,7 @@ * @test * @bug 4853305 4865198 4888410 4963723 8146293 * @summary Verify that the RSA KeyPairGenerator works - * @library /lib + * @library /test/lib * @build jdk.test.lib.SigTestUtil * @run main TestKeyPairGenerator * @author Andreas Sterbenz diff --git a/jdk/test/sun/security/rsa/TestSignatures.java b/jdk/test/sun/security/rsa/TestSignatures.java index 1cda2929781..68dfd1adf05 100644 --- a/jdk/test/sun/security/rsa/TestSignatures.java +++ b/jdk/test/sun/security/rsa/TestSignatures.java @@ -25,7 +25,7 @@ * @test * @bug 4853305 4963723 8146293 * @summary Test signing/verifying using all the signature algorithms - * @library /lib + * @library /test/lib * @build jdk.test.lib.SigTestUtil * @run main TestSignatures * @author Andreas Sterbenz diff --git a/jdk/test/sun/security/rsa/pss/SignatureTestPSS.java b/jdk/test/sun/security/rsa/pss/SignatureTestPSS.java index b92cd925aa5..daa0fc51d8a 100644 --- a/jdk/test/sun/security/rsa/pss/SignatureTestPSS.java +++ b/jdk/test/sun/security/rsa/pss/SignatureTestPSS.java @@ -36,7 +36,7 @@ * @summary Create a signature for RSASSA-PSS and get its signed data. * re-initiate the signature with the public key. The signature * can be verified by acquired signed data. - * @library /lib + * @library /test/lib * @build jdk.test.lib.SigTestUtil * @run main SignatureTestPSS 512 * @run main SignatureTestPSS 768 diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java b/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java index 50bbb87868f..b9fb72b8faf 100644 --- a/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java +++ b/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java @@ -54,7 +54,7 @@ * @test * @bug 8165367 * @summary Verify the restrictions for certificate path on JSSE with custom trust store. - * @library /lib + * @library /test/lib * @build jdk.test.lib.Utils * jdk.test.lib.Asserts * jdk.test.lib.JDKToolFinder diff --git a/jdk/test/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java b/jdk/test/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java index 70a6f5ba831..378f97cd7a0 100644 --- a/jdk/test/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java +++ b/jdk/test/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java @@ -25,7 +25,7 @@ * @test * @bug 7126889 * @summary Incorrect SSLEngine debug output - * @library /lib /lib/security + * @library /test/lib /lib/security * @run main DebugReportsOneExtraByte */ /* diff --git a/jdk/test/sun/security/ssl/rsa/SignedObjectChain.java b/jdk/test/sun/security/ssl/rsa/SignedObjectChain.java index 1d5b21baa56..46957d83d43 100644 --- a/jdk/test/sun/security/ssl/rsa/SignedObjectChain.java +++ b/jdk/test/sun/security/ssl/rsa/SignedObjectChain.java @@ -25,7 +25,7 @@ * @test * @bug 8050374 8146293 * @summary Verify a chain of signed objects - * @library /lib + * @library /test/lib * @compile ../../../../java/security/SignedObject/Chain.java * @run main SignedObjectChain */ diff --git a/jdk/test/sun/security/util/DerInputBuffer/PaddedBitString.java b/jdk/test/sun/security/util/DerInputBuffer/PaddedBitString.java index b9a72957114..7a5719c18ac 100644 --- a/jdk/test/sun/security/util/DerInputBuffer/PaddedBitString.java +++ b/jdk/test/sun/security/util/DerInputBuffer/PaddedBitString.java @@ -25,7 +25,7 @@ * @test * @bug 4511556 * @summary Verify BitString value containing padding bits is accepted. - * @library /lib + * @library /test/lib */ import java.io.*; import java.math.BigInteger; diff --git a/make/Main.gmk b/make/Main.gmk index 19244c8dcd1..4292cfe6b02 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -167,6 +167,9 @@ docs-zip-only: start-make @($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-zip) @$(call TargetExit) +update-build-docs: + +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f UpdateBuildDocs.gmk) + sign-jars: jdk sign-jars-only sign-jars-only: start-make @$(call TargetEnter) @@ -258,7 +261,7 @@ reconfigure: @( cd $(OUTPUT_ROOT) && $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) ) .PHONY: langtools corba jaxp jaxws hotspot jdk nashorn images overlay-images install test docs docs-zip -.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only nashorn-only images-only overlay-images-only install-only test-only docs-only docs-zip-only +.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only nashorn-only images-only overlay-images-only install-only test-only docs-only docs-zip-only update-build-docs .PHONY: default all clean dist-clean bootcycle-images start-make .PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-docs clean-docs-zip clean-test clean-overlay-images clean-bootcycle-build .PHONY: profiles profiles-only diff --git a/make/UpdateBuildDocs.gmk b/make/UpdateBuildDocs.gmk new file mode 100644 index 00000000000..ae5bb733334 --- /dev/null +++ b/make/UpdateBuildDocs.gmk @@ -0,0 +1,97 @@ +# +# Copyright (c) 2017, 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. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# 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. +# + +default: all + +include $(SPEC) +include MakeBase.gmk + +################################################################################ +# This makefile updates the generated build html documentation. +# +################################################################################ + +ifeq ($(PANDOC), ) + $(info No pandoc executable was detected by configure) + $(error Cannot continue) +endif + +################################################################################ +# Setup make rules for converting a markdown file to html. +# +# Parameter 1 is the name of the rule. This name is used as variable prefix, +# and the targets generated are listed in a variable by that name. +# +# Remaining parameters are named arguments. These include: +# SOURCE_FILE The markdown source file +# TARGET_DIR The directory where to store the generated html file +# +define SetupMarkdownToHtml + $(foreach i,2 3, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) + $(call LogSetupMacroEntry,SetupMarkdownToHtml($1),$2,$3) + $(if $(4),$(error Internal makefile error: Too many arguments to SetupMarkdownToHtml, please update UpdateBuildDocs.gmk)) + + ifeq ($$($1_SOURCE_FILE), ) + $$(error SOURCE_FILE is missing in SetupMarkdownToHtml $1) + endif + + ifeq ($$($1_TARGET_DIR), ) + $$(error TARGET_DIR is missing in SetupMarkdownToHtml $1) + endif + + $1_BASENAME := $$(notdir $$(basename $$($1_SOURCE_FILE))) + $1_OUTPUT_FILE := $$($1_TARGET_DIR)/$$($1_BASENAME).html + +$$($1_OUTPUT_FILE): $$($1_SOURCE_FILE) + $$(ECHO) $$(LOG_INFO) Converting $$(notdir $1) to html + $$(MKDIR) -p $$($1_TARGET_DIR) + $$(PANDOC) -f markdown -t html --standalone '$$<' -o '$$@' + TOO_LONG_LINES=`$$(GREP) -E -e '^.{80}.+$$$$' $$<` ; \ + if [ "x$${TOO_LONG_LINES}" != x ]; then \ + $$(ECHO) "Warning: Unsuitable markdown in $$<:" ; \ + $$(ECHO) "The following lines are longer than 80 characters:" ; \ + $$(GREP) -E -e '^.{80}.+$$$$' $$< ; \ + fi + + $1 := $$($1_OUTPUT_FILE) + + TARGETS += $$($1) +endef + +################################################################################ + +BUILD_DOCS_DIR := $(TOPDIR)/doc +BUILD_DOCS_MD_FILE := building.md + +$(eval $(call SetupMarkdownToHtml,building, \ + SOURCE_FILE := $(BUILD_DOCS_DIR)/$(BUILD_DOCS_MD_FILE), \ + TARGET_DIR := $(BUILD_DOCS_DIR) \ +)) + +################################################################################ + +all: $(TARGETS) + +.PHONY: all default diff --git a/jdk/test/lib/ClassFileInstaller.java b/test/lib/ClassFileInstaller.java similarity index 100% rename from jdk/test/lib/ClassFileInstaller.java rename to test/lib/ClassFileInstaller.java diff --git a/jdk/test/lib/jdk/test/lib/Asserts.java b/test/lib/jdk/test/lib/Asserts.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/Asserts.java rename to test/lib/jdk/test/lib/Asserts.java diff --git a/jdk/test/lib/jdk/test/lib/BuildHelper.java b/test/lib/jdk/test/lib/BuildHelper.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/BuildHelper.java rename to test/lib/jdk/test/lib/BuildHelper.java diff --git a/jdk/test/lib/jdk/test/lib/ByteCodeLoader.java b/test/lib/jdk/test/lib/ByteCodeLoader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/ByteCodeLoader.java rename to test/lib/jdk/test/lib/ByteCodeLoader.java diff --git a/jdk/test/lib/jdk/test/lib/Container.java b/test/lib/jdk/test/lib/Container.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/Container.java rename to test/lib/jdk/test/lib/Container.java diff --git a/jdk/test/lib/jdk/test/lib/Convert.java b/test/lib/jdk/test/lib/Convert.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/Convert.java rename to test/lib/jdk/test/lib/Convert.java diff --git a/jdk/test/lib/jdk/test/lib/FileInstaller.java b/test/lib/jdk/test/lib/FileInstaller.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/FileInstaller.java rename to test/lib/jdk/test/lib/FileInstaller.java diff --git a/jdk/test/lib/jdk/test/lib/InfiniteLoop.java b/test/lib/jdk/test/lib/InfiniteLoop.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/InfiniteLoop.java rename to test/lib/jdk/test/lib/InfiniteLoop.java diff --git a/jdk/test/lib/jdk/test/lib/JDKToolFinder.java b/test/lib/jdk/test/lib/JDKToolFinder.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/JDKToolFinder.java rename to test/lib/jdk/test/lib/JDKToolFinder.java diff --git a/jdk/test/lib/jdk/test/lib/JDKToolLauncher.java b/test/lib/jdk/test/lib/JDKToolLauncher.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/JDKToolLauncher.java rename to test/lib/jdk/test/lib/JDKToolLauncher.java diff --git a/jdk/test/lib/jdk/test/lib/LockFreeLogger.java b/test/lib/jdk/test/lib/LockFreeLogger.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/LockFreeLogger.java rename to test/lib/jdk/test/lib/LockFreeLogger.java diff --git a/jdk/test/lib/jdk/test/lib/NetworkConfiguration.java b/test/lib/jdk/test/lib/NetworkConfiguration.java similarity index 60% rename from jdk/test/lib/jdk/test/lib/NetworkConfiguration.java rename to test/lib/jdk/test/lib/NetworkConfiguration.java index b8a4720643a..b6599627888 100644 --- a/jdk/test/lib/jdk/test/lib/NetworkConfiguration.java +++ b/test/lib/jdk/test/lib/NetworkConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2019, 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 @@ -23,9 +23,9 @@ package jdk.test.lib; +import java.io.IOException; import java.io.PrintStream; import java.io.UncheckedIOException; -import java.io.IOException; import java.net.Inet4Address; import java.net.Inet6Address; import java.net.InetAddress; @@ -35,9 +35,9 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; + import static java.net.NetworkInterface.getNetworkInterfaces; import static java.util.Collections.list; @@ -49,12 +49,140 @@ public class NetworkConfiguration { private Map> ip4Interfaces; private Map> ip6Interfaces; + private final boolean isIPv6Available; + private boolean has_testableipv6address = false; + private boolean has_sitelocaladdress = false; + private boolean has_linklocaladdress = false; + private boolean has_globaladdress = false; private NetworkConfiguration( Map> ip4Interfaces, Map> ip6Interfaces) { this.ip4Interfaces = ip4Interfaces; this.ip6Interfaces = ip6Interfaces; + + // initialize properties that can be queried + isIPv6Available = !ip6Interfaces().collect(Collectors.toList()).isEmpty(); + ip6Interfaces().forEach(nif -> { + ip6Addresses(nif) + // On Solaris or AIX, a configuration with only local or loopback + // addresses does not fully enable IPv6 operations. + // E.g. IPv6 multicasting does not work. + // So, don't set has_testableipv6address if we only find these. + .filter(addr -> Platform.isSolaris() || Platform.isAix() ? + !(addr.isAnyLocalAddress() || addr.isLoopbackAddress()) : true) + .forEach(ia -> { + has_testableipv6address = true; + if (ia.isLinkLocalAddress()) has_linklocaladdress = true; + if (ia.isSiteLocalAddress()) has_sitelocaladdress = true; + + if (!ia.isLinkLocalAddress() && + !ia.isSiteLocalAddress() && + !ia.isLoopbackAddress()) { + has_globaladdress = true; + } + }); + }); + } + + private static boolean isNotExcludedInterface(NetworkInterface nif) { + if (Platform.isOSX() && nif.getName().contains("awdl")) { + return false; + } + if (Platform.isWindows()) { + String dName = nif.getDisplayName(); + if (dName != null && dName.contains("Teredo")) { + return false; + } + } + return true; + } + + private static boolean isNotLoopback(NetworkInterface nif) { + try { + return !nif.isLoopback(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + private boolean hasIp4Addresses(NetworkInterface nif) { + return ip4Interfaces.get(nif).stream().anyMatch(a -> !a.isAnyLocalAddress()); + } + + private boolean hasIp6Addresses(NetworkInterface nif) { + return ip6Interfaces.get(nif).stream().anyMatch(a -> !a.isAnyLocalAddress()); + } + + private boolean supportsIp4Multicast(NetworkInterface nif) { + try { + if (!nif.supportsMulticast()) { + return false; + } + + // On AIX there is a bug: + // When IPv6 is enabled on the system, the JDK opens sockets as AF_INET6. + // If there's an interface configured with IPv4 addresses only, it should + // be able to become the network interface for a multicast socket (that + // could be in both, IPv4 or IPv6 space). But both possible setsockopt + // calls for either IPV6_MULTICAST_IF or IP_MULTICAST_IF return + // EADDRNOTAVAIL. So we must skip such interfaces here. + if (Platform.isAix() && isIPv6Available() && !hasIp6Addresses(nif)) { + return false; + } + + return hasIp4Addresses(nif); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + private boolean supportsIp6Multicast(NetworkInterface nif) { + try { + if (!nif.supportsMulticast()) { + return false; + } + + return hasIp6Addresses(nif); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + /** + * Returns whether IPv6 is available at all. + * This should resemble the result of native ipv6_available() in net_util.c + */ + public boolean isIPv6Available() { + return isIPv6Available; + } + + /** + * Does any (usable) IPv6 address exist in the network configuration? + */ + public boolean hasTestableIPv6Address() { + return has_testableipv6address; + } + + /** + * Does any site local address exist? + */ + public boolean hasSiteLocalAddress() { + return has_sitelocaladdress; + } + + /** + * Does any link local address exist? + */ + public boolean hasLinkLocalAddress() { + return has_linklocaladdress; + } + + /** + * Does any global IPv6 address exist? + */ + public boolean has_globaladdress() { + return has_globaladdress; } /** @@ -72,7 +200,7 @@ public Stream ip4Interfaces() { return ip4Interfaces.keySet() .stream() .filter(NetworkConfiguration::isNotExcludedInterface) - .filter(hasIp4Addresses); + .filter(this::hasIp4Addresses); } /** @@ -82,63 +210,56 @@ public Stream ip6Interfaces() { return ip6Interfaces.keySet() .stream() .filter(NetworkConfiguration::isNotExcludedInterface) - .filter(hasIp6Addresses); + .filter(this::hasIp6Addresses); } - private static boolean isNotExcludedInterface(NetworkInterface nif) { - if (Platform.isOSX() && nif.getName().contains("awdl")) { - return false; - } - String dName = nif.getDisplayName(); - if (Platform.isWindows() && dName != null && dName.contains("Teredo")) { - return false; - } - return true; + /** + * Returns a stream of interfaces suitable for functional tests. + */ + public Stream multicastInterfaces(boolean includeLoopback) { + return Stream + .concat(ip4MulticastInterfaces(includeLoopback), + ip6MulticastInterfaces(includeLoopback)) + .distinct(); } - private final Predicate hasIp4Addresses = nif -> - ip4Interfaces.get(nif).stream().anyMatch(a -> !a.isAnyLocalAddress()); - - private final Predicate hasIp6Addresses = nif -> - ip6Interfaces.get(nif).stream().anyMatch(a -> !a.isAnyLocalAddress()); - - /** * Returns a stream of interfaces suitable for IPv4 multicast tests. + * + * The loopback interface will not be included. */ public Stream ip4MulticastInterfaces() { - return ip4Interfaces().filter(supportsIp4Multicast); + return ip4MulticastInterfaces(false); + } + + /** + * Returns a stream of interfaces suitable for IPv4 multicast tests. + */ + public Stream ip4MulticastInterfaces(boolean includeLoopback) { + return (includeLoopback) ? + ip4Interfaces().filter(this::supportsIp4Multicast) : + ip4Interfaces().filter(this::supportsIp4Multicast) + .filter(NetworkConfiguration::isNotLoopback); } /** * Returns a stream of interfaces suitable for IPv6 multicast tests. + * + * The loopback interface will not be included. */ public Stream ip6MulticastInterfaces() { - return ip6Interfaces().filter(supportsIp6Multicast); + return ip6MulticastInterfaces(false); } - private final Predicate supportsIp4Multicast = nif -> { - try { - if (!nif.supportsMulticast() || nif.isLoopback()) { - return false; - } - return hasIp4Addresses.test(nif); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - }; - - private final Predicate supportsIp6Multicast = nif -> { - try { - if (!nif.supportsMulticast() || nif.isLoopback()) { - return false; - } - - return hasIp6Addresses.test(nif); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - }; + /** + * Returns a stream of interfaces suitable for IPv6 multicast tests. + */ + public Stream ip6MulticastInterfaces(boolean includeLoopback) { + return (includeLoopback) ? + ip6Interfaces().filter(this::supportsIp6Multicast) : + ip6Interfaces().filter(this::supportsIp6Multicast) + .filter(NetworkConfiguration::isNotLoopback); + } /** * Returns all addresses on all "functional" interfaces. @@ -176,6 +297,12 @@ public Stream ip6Addresses(NetworkInterface nif) { return ip6Interfaces.get(nif).stream(); } + @Override + public String toString() { + return interfaces().map(NetworkConfiguration::interfaceInformation) + .collect(Collectors.joining()); + } + /** * Return a NetworkConfiguration instance. */ @@ -205,12 +332,6 @@ public static NetworkConfiguration probe() throws IOException { return new NetworkConfiguration(ip4Interfaces, ip6Interfaces); } - @Override - public String toString() { - return interfaces().map(NetworkConfiguration::interfaceInformation) - .collect(Collectors.joining()); - } - /** Returns detailed information for the given interface. */ public static String interfaceInformation(NetworkInterface nif) { StringBuilder sb = new StringBuilder(); diff --git a/jdk/test/lib/jdk/test/lib/Platform.java b/test/lib/jdk/test/lib/Platform.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/Platform.java rename to test/lib/jdk/test/lib/Platform.java diff --git a/jdk/test/lib/jdk/test/lib/RandomFactory.java b/test/lib/jdk/test/lib/RandomFactory.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/RandomFactory.java rename to test/lib/jdk/test/lib/RandomFactory.java diff --git a/jdk/test/lib/jdk/test/lib/SigTestUtil.java b/test/lib/jdk/test/lib/SigTestUtil.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/SigTestUtil.java rename to test/lib/jdk/test/lib/SigTestUtil.java diff --git a/jdk/test/lib/jdk/test/lib/TimeLimitedRunner.java b/test/lib/jdk/test/lib/TimeLimitedRunner.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/TimeLimitedRunner.java rename to test/lib/jdk/test/lib/TimeLimitedRunner.java diff --git a/jdk/test/lib/jdk/test/lib/Utils.java b/test/lib/jdk/test/lib/Utils.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/Utils.java rename to test/lib/jdk/test/lib/Utils.java diff --git a/jdk/test/lib/jdk/test/lib/artifacts/Artifact.java b/test/lib/jdk/test/lib/artifacts/Artifact.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/artifacts/Artifact.java rename to test/lib/jdk/test/lib/artifacts/Artifact.java diff --git a/jdk/test/lib/jdk/test/lib/artifacts/ArtifactContainer.java b/test/lib/jdk/test/lib/artifacts/ArtifactContainer.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/artifacts/ArtifactContainer.java rename to test/lib/jdk/test/lib/artifacts/ArtifactContainer.java diff --git a/jdk/test/lib/jdk/test/lib/artifacts/ArtifactManager.java b/test/lib/jdk/test/lib/artifacts/ArtifactManager.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/artifacts/ArtifactManager.java rename to test/lib/jdk/test/lib/artifacts/ArtifactManager.java diff --git a/jdk/test/lib/jdk/test/lib/artifacts/ArtifactResolver.java b/test/lib/jdk/test/lib/artifacts/ArtifactResolver.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/artifacts/ArtifactResolver.java rename to test/lib/jdk/test/lib/artifacts/ArtifactResolver.java diff --git a/jdk/test/lib/jdk/test/lib/artifacts/ArtifactResolverException.java b/test/lib/jdk/test/lib/artifacts/ArtifactResolverException.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/artifacts/ArtifactResolverException.java rename to test/lib/jdk/test/lib/artifacts/ArtifactResolverException.java diff --git a/jdk/test/lib/jdk/test/lib/artifacts/DefaultArtifactManager.java b/test/lib/jdk/test/lib/artifacts/DefaultArtifactManager.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/artifacts/DefaultArtifactManager.java rename to test/lib/jdk/test/lib/artifacts/DefaultArtifactManager.java diff --git a/jdk/test/lib/jdk/test/lib/artifacts/JibArtifactManager.java b/test/lib/jdk/test/lib/artifacts/JibArtifactManager.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/artifacts/JibArtifactManager.java rename to test/lib/jdk/test/lib/artifacts/JibArtifactManager.java diff --git a/jdk/test/lib/jdk/test/lib/cds/CDSOptions.java b/test/lib/jdk/test/lib/cds/CDSOptions.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cds/CDSOptions.java rename to test/lib/jdk/test/lib/cds/CDSOptions.java diff --git a/jdk/test/lib/jdk/test/lib/cds/CDSTestUtils.java b/test/lib/jdk/test/lib/cds/CDSTestUtils.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cds/CDSTestUtils.java rename to test/lib/jdk/test/lib/cds/CDSTestUtils.java diff --git a/jdk/test/lib/jdk/test/lib/classloader/ClassLoadUtils.java b/test/lib/jdk/test/lib/classloader/ClassLoadUtils.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/classloader/ClassLoadUtils.java rename to test/lib/jdk/test/lib/classloader/ClassLoadUtils.java diff --git a/jdk/test/lib/jdk/test/lib/classloader/FilterClassLoader.java b/test/lib/jdk/test/lib/classloader/FilterClassLoader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/classloader/FilterClassLoader.java rename to test/lib/jdk/test/lib/classloader/FilterClassLoader.java diff --git a/jdk/test/lib/jdk/test/lib/classloader/GeneratingClassLoader.java b/test/lib/jdk/test/lib/classloader/GeneratingClassLoader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/classloader/GeneratingClassLoader.java rename to test/lib/jdk/test/lib/classloader/GeneratingClassLoader.java diff --git a/jdk/test/lib/jdk/test/lib/classloader/ParentLastURLClassLoader.java b/test/lib/jdk/test/lib/classloader/ParentLastURLClassLoader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/classloader/ParentLastURLClassLoader.java rename to test/lib/jdk/test/lib/classloader/ParentLastURLClassLoader.java diff --git a/jdk/test/lib/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java b/test/lib/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java rename to test/lib/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java diff --git a/jdk/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java b/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java rename to test/lib/jdk/test/lib/cli/CommandLineOptionTest.java diff --git a/jdk/test/lib/jdk/test/lib/cli/predicate/AndPredicate.java b/test/lib/jdk/test/lib/cli/predicate/AndPredicate.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cli/predicate/AndPredicate.java rename to test/lib/jdk/test/lib/cli/predicate/AndPredicate.java diff --git a/jdk/test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java b/test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java rename to test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java diff --git a/jdk/test/lib/jdk/test/lib/cli/predicate/NotPredicate.java b/test/lib/jdk/test/lib/cli/predicate/NotPredicate.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cli/predicate/NotPredicate.java rename to test/lib/jdk/test/lib/cli/predicate/NotPredicate.java diff --git a/jdk/test/lib/jdk/test/lib/cli/predicate/OrPredicate.java b/test/lib/jdk/test/lib/cli/predicate/OrPredicate.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cli/predicate/OrPredicate.java rename to test/lib/jdk/test/lib/cli/predicate/OrPredicate.java diff --git a/jdk/test/lib/jdk/test/lib/containers/cgroup/CPUSetsReader.java b/test/lib/jdk/test/lib/containers/cgroup/CPUSetsReader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/cgroup/CPUSetsReader.java rename to test/lib/jdk/test/lib/containers/cgroup/CPUSetsReader.java diff --git a/jdk/test/lib/jdk/test/lib/containers/cgroup/CgroupMetricsTester.java b/test/lib/jdk/test/lib/containers/cgroup/CgroupMetricsTester.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/cgroup/CgroupMetricsTester.java rename to test/lib/jdk/test/lib/containers/cgroup/CgroupMetricsTester.java diff --git a/jdk/test/lib/jdk/test/lib/containers/cgroup/MetricsTester.java b/test/lib/jdk/test/lib/containers/cgroup/MetricsTester.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/cgroup/MetricsTester.java rename to test/lib/jdk/test/lib/containers/cgroup/MetricsTester.java diff --git a/jdk/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV1.java b/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV1.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV1.java rename to test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV1.java diff --git a/jdk/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV2.java b/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV2.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV2.java rename to test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV2.java diff --git a/jdk/test/lib/jdk/test/lib/containers/docker/Common.java b/test/lib/jdk/test/lib/containers/docker/Common.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/docker/Common.java rename to test/lib/jdk/test/lib/containers/docker/Common.java diff --git a/jdk/test/lib/jdk/test/lib/containers/docker/DockerRunOptions.java b/test/lib/jdk/test/lib/containers/docker/DockerRunOptions.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/docker/DockerRunOptions.java rename to test/lib/jdk/test/lib/containers/docker/DockerRunOptions.java diff --git a/jdk/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java b/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java rename to test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java diff --git a/jdk/test/lib/jdk/test/lib/containers/docker/DockerfileConfig.java b/test/lib/jdk/test/lib/containers/docker/DockerfileConfig.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/docker/DockerfileConfig.java rename to test/lib/jdk/test/lib/containers/docker/DockerfileConfig.java diff --git a/jdk/test/lib/jdk/test/lib/dcmd/CommandExecutor.java b/test/lib/jdk/test/lib/dcmd/CommandExecutor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/dcmd/CommandExecutor.java rename to test/lib/jdk/test/lib/dcmd/CommandExecutor.java diff --git a/jdk/test/lib/jdk/test/lib/dcmd/CommandExecutorException.java b/test/lib/jdk/test/lib/dcmd/CommandExecutorException.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/dcmd/CommandExecutorException.java rename to test/lib/jdk/test/lib/dcmd/CommandExecutorException.java diff --git a/jdk/test/lib/jdk/test/lib/dcmd/FileJcmdExecutor.java b/test/lib/jdk/test/lib/dcmd/FileJcmdExecutor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/dcmd/FileJcmdExecutor.java rename to test/lib/jdk/test/lib/dcmd/FileJcmdExecutor.java diff --git a/jdk/test/lib/jdk/test/lib/dcmd/JMXExecutor.java b/test/lib/jdk/test/lib/dcmd/JMXExecutor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/dcmd/JMXExecutor.java rename to test/lib/jdk/test/lib/dcmd/JMXExecutor.java diff --git a/jdk/test/lib/jdk/test/lib/dcmd/JcmdExecutor.java b/test/lib/jdk/test/lib/dcmd/JcmdExecutor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/dcmd/JcmdExecutor.java rename to test/lib/jdk/test/lib/dcmd/JcmdExecutor.java diff --git a/jdk/test/lib/jdk/test/lib/dcmd/MainClassJcmdExecutor.java b/test/lib/jdk/test/lib/dcmd/MainClassJcmdExecutor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/dcmd/MainClassJcmdExecutor.java rename to test/lib/jdk/test/lib/dcmd/MainClassJcmdExecutor.java diff --git a/jdk/test/lib/jdk/test/lib/dcmd/PidJcmdExecutor.java b/test/lib/jdk/test/lib/dcmd/PidJcmdExecutor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/dcmd/PidJcmdExecutor.java rename to test/lib/jdk/test/lib/dcmd/PidJcmdExecutor.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/HprofParser.java b/test/lib/jdk/test/lib/hprof/HprofParser.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/HprofParser.java rename to test/lib/jdk/test/lib/hprof/HprofParser.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/README b/test/lib/jdk/test/lib/hprof/README similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/README rename to test/lib/jdk/test/lib/hprof/README diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/AbstractJavaHeapObjectVisitor.java b/test/lib/jdk/test/lib/hprof/model/AbstractJavaHeapObjectVisitor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/AbstractJavaHeapObjectVisitor.java rename to test/lib/jdk/test/lib/hprof/model/AbstractJavaHeapObjectVisitor.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/ArrayTypeCodes.java b/test/lib/jdk/test/lib/hprof/model/ArrayTypeCodes.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/ArrayTypeCodes.java rename to test/lib/jdk/test/lib/hprof/model/ArrayTypeCodes.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/HackJavaValue.java b/test/lib/jdk/test/lib/hprof/model/HackJavaValue.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/HackJavaValue.java rename to test/lib/jdk/test/lib/hprof/model/HackJavaValue.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaBoolean.java b/test/lib/jdk/test/lib/hprof/model/JavaBoolean.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaBoolean.java rename to test/lib/jdk/test/lib/hprof/model/JavaBoolean.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaByte.java b/test/lib/jdk/test/lib/hprof/model/JavaByte.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaByte.java rename to test/lib/jdk/test/lib/hprof/model/JavaByte.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaChar.java b/test/lib/jdk/test/lib/hprof/model/JavaChar.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaChar.java rename to test/lib/jdk/test/lib/hprof/model/JavaChar.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaClass.java b/test/lib/jdk/test/lib/hprof/model/JavaClass.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaClass.java rename to test/lib/jdk/test/lib/hprof/model/JavaClass.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaDouble.java b/test/lib/jdk/test/lib/hprof/model/JavaDouble.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaDouble.java rename to test/lib/jdk/test/lib/hprof/model/JavaDouble.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaField.java b/test/lib/jdk/test/lib/hprof/model/JavaField.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaField.java rename to test/lib/jdk/test/lib/hprof/model/JavaField.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaFloat.java b/test/lib/jdk/test/lib/hprof/model/JavaFloat.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaFloat.java rename to test/lib/jdk/test/lib/hprof/model/JavaFloat.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaHeapObject.java b/test/lib/jdk/test/lib/hprof/model/JavaHeapObject.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaHeapObject.java rename to test/lib/jdk/test/lib/hprof/model/JavaHeapObject.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaHeapObjectVisitor.java b/test/lib/jdk/test/lib/hprof/model/JavaHeapObjectVisitor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaHeapObjectVisitor.java rename to test/lib/jdk/test/lib/hprof/model/JavaHeapObjectVisitor.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaInt.java b/test/lib/jdk/test/lib/hprof/model/JavaInt.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaInt.java rename to test/lib/jdk/test/lib/hprof/model/JavaInt.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaLazyReadObject.java b/test/lib/jdk/test/lib/hprof/model/JavaLazyReadObject.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaLazyReadObject.java rename to test/lib/jdk/test/lib/hprof/model/JavaLazyReadObject.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaLong.java b/test/lib/jdk/test/lib/hprof/model/JavaLong.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaLong.java rename to test/lib/jdk/test/lib/hprof/model/JavaLong.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaObject.java b/test/lib/jdk/test/lib/hprof/model/JavaObject.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaObject.java rename to test/lib/jdk/test/lib/hprof/model/JavaObject.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaObjectArray.java b/test/lib/jdk/test/lib/hprof/model/JavaObjectArray.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaObjectArray.java rename to test/lib/jdk/test/lib/hprof/model/JavaObjectArray.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaObjectRef.java b/test/lib/jdk/test/lib/hprof/model/JavaObjectRef.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaObjectRef.java rename to test/lib/jdk/test/lib/hprof/model/JavaObjectRef.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaShort.java b/test/lib/jdk/test/lib/hprof/model/JavaShort.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaShort.java rename to test/lib/jdk/test/lib/hprof/model/JavaShort.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaStatic.java b/test/lib/jdk/test/lib/hprof/model/JavaStatic.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaStatic.java rename to test/lib/jdk/test/lib/hprof/model/JavaStatic.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaThing.java b/test/lib/jdk/test/lib/hprof/model/JavaThing.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaThing.java rename to test/lib/jdk/test/lib/hprof/model/JavaThing.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaValue.java b/test/lib/jdk/test/lib/hprof/model/JavaValue.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaValue.java rename to test/lib/jdk/test/lib/hprof/model/JavaValue.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaValueArray.java b/test/lib/jdk/test/lib/hprof/model/JavaValueArray.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaValueArray.java rename to test/lib/jdk/test/lib/hprof/model/JavaValueArray.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/ReachableExcludes.java b/test/lib/jdk/test/lib/hprof/model/ReachableExcludes.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/ReachableExcludes.java rename to test/lib/jdk/test/lib/hprof/model/ReachableExcludes.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/ReachableExcludesImpl.java b/test/lib/jdk/test/lib/hprof/model/ReachableExcludesImpl.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/ReachableExcludesImpl.java rename to test/lib/jdk/test/lib/hprof/model/ReachableExcludesImpl.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/ReachableObjects.java b/test/lib/jdk/test/lib/hprof/model/ReachableObjects.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/ReachableObjects.java rename to test/lib/jdk/test/lib/hprof/model/ReachableObjects.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/ReferenceChain.java b/test/lib/jdk/test/lib/hprof/model/ReferenceChain.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/ReferenceChain.java rename to test/lib/jdk/test/lib/hprof/model/ReferenceChain.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/Root.java b/test/lib/jdk/test/lib/hprof/model/Root.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/Root.java rename to test/lib/jdk/test/lib/hprof/model/Root.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/Snapshot.java b/test/lib/jdk/test/lib/hprof/model/Snapshot.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/Snapshot.java rename to test/lib/jdk/test/lib/hprof/model/Snapshot.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/StackFrame.java b/test/lib/jdk/test/lib/hprof/model/StackFrame.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/StackFrame.java rename to test/lib/jdk/test/lib/hprof/model/StackFrame.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/StackTrace.java b/test/lib/jdk/test/lib/hprof/model/StackTrace.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/StackTrace.java rename to test/lib/jdk/test/lib/hprof/model/StackTrace.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/parser/FileReadBuffer.java b/test/lib/jdk/test/lib/hprof/parser/FileReadBuffer.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/parser/FileReadBuffer.java rename to test/lib/jdk/test/lib/hprof/parser/FileReadBuffer.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/parser/HprofReader.java b/test/lib/jdk/test/lib/hprof/parser/HprofReader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/parser/HprofReader.java rename to test/lib/jdk/test/lib/hprof/parser/HprofReader.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/parser/MappedReadBuffer.java b/test/lib/jdk/test/lib/hprof/parser/MappedReadBuffer.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/parser/MappedReadBuffer.java rename to test/lib/jdk/test/lib/hprof/parser/MappedReadBuffer.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/parser/PositionDataInputStream.java b/test/lib/jdk/test/lib/hprof/parser/PositionDataInputStream.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/parser/PositionDataInputStream.java rename to test/lib/jdk/test/lib/hprof/parser/PositionDataInputStream.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/parser/PositionInputStream.java b/test/lib/jdk/test/lib/hprof/parser/PositionInputStream.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/parser/PositionInputStream.java rename to test/lib/jdk/test/lib/hprof/parser/PositionInputStream.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/parser/ReadBuffer.java b/test/lib/jdk/test/lib/hprof/parser/ReadBuffer.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/parser/ReadBuffer.java rename to test/lib/jdk/test/lib/hprof/parser/ReadBuffer.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/parser/Reader.java b/test/lib/jdk/test/lib/hprof/parser/Reader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/parser/Reader.java rename to test/lib/jdk/test/lib/hprof/parser/Reader.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/util/ArraySorter.java b/test/lib/jdk/test/lib/hprof/util/ArraySorter.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/util/ArraySorter.java rename to test/lib/jdk/test/lib/hprof/util/ArraySorter.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/util/Comparer.java b/test/lib/jdk/test/lib/hprof/util/Comparer.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/util/Comparer.java rename to test/lib/jdk/test/lib/hprof/util/Comparer.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/util/CompositeEnumeration.java b/test/lib/jdk/test/lib/hprof/util/CompositeEnumeration.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/util/CompositeEnumeration.java rename to test/lib/jdk/test/lib/hprof/util/CompositeEnumeration.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/util/Misc.java b/test/lib/jdk/test/lib/hprof/util/Misc.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/util/Misc.java rename to test/lib/jdk/test/lib/hprof/util/Misc.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/util/VectorSorter.java b/test/lib/jdk/test/lib/hprof/util/VectorSorter.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/util/VectorSorter.java rename to test/lib/jdk/test/lib/hprof/util/VectorSorter.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/AppExecutorHelper.java b/test/lib/jdk/test/lib/jfr/AppExecutorHelper.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/AppExecutorHelper.java rename to test/lib/jdk/test/lib/jfr/AppExecutorHelper.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/CommonHelper.java b/test/lib/jdk/test/lib/jfr/CommonHelper.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/CommonHelper.java rename to test/lib/jdk/test/lib/jfr/CommonHelper.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/EventField.java b/test/lib/jdk/test/lib/jfr/EventField.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/EventField.java rename to test/lib/jdk/test/lib/jfr/EventField.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/EventNames.java b/test/lib/jdk/test/lib/jfr/EventNames.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/EventNames.java rename to test/lib/jdk/test/lib/jfr/EventNames.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/EventTypePrototype.java b/test/lib/jdk/test/lib/jfr/EventTypePrototype.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/EventTypePrototype.java rename to test/lib/jdk/test/lib/jfr/EventTypePrototype.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/EventVerifier.java b/test/lib/jdk/test/lib/jfr/EventVerifier.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/EventVerifier.java rename to test/lib/jdk/test/lib/jfr/EventVerifier.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/Events.java b/test/lib/jdk/test/lib/jfr/Events.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/Events.java rename to test/lib/jdk/test/lib/jfr/Events.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/FileHelper.java b/test/lib/jdk/test/lib/jfr/FileHelper.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/FileHelper.java rename to test/lib/jdk/test/lib/jfr/FileHelper.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/GCHelper.java b/test/lib/jdk/test/lib/jfr/GCHelper.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/GCHelper.java rename to test/lib/jdk/test/lib/jfr/GCHelper.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/RecurseThread.java b/test/lib/jdk/test/lib/jfr/RecurseThread.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/RecurseThread.java rename to test/lib/jdk/test/lib/jfr/RecurseThread.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/SimpleEvent.java b/test/lib/jdk/test/lib/jfr/SimpleEvent.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/SimpleEvent.java rename to test/lib/jdk/test/lib/jfr/SimpleEvent.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/SimpleEventHelper.java b/test/lib/jdk/test/lib/jfr/SimpleEventHelper.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/SimpleEventHelper.java rename to test/lib/jdk/test/lib/jfr/SimpleEventHelper.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/SimpleSetting.java b/test/lib/jdk/test/lib/jfr/SimpleSetting.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/SimpleSetting.java rename to test/lib/jdk/test/lib/jfr/SimpleSetting.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/Stressor.java b/test/lib/jdk/test/lib/jfr/Stressor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/Stressor.java rename to test/lib/jdk/test/lib/jfr/Stressor.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/TestClassLoader.java b/test/lib/jdk/test/lib/jfr/TestClassLoader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/TestClassLoader.java rename to test/lib/jdk/test/lib/jfr/TestClassLoader.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/VoidFunction.java b/test/lib/jdk/test/lib/jfr/VoidFunction.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/VoidFunction.java rename to test/lib/jdk/test/lib/jfr/VoidFunction.java diff --git a/jdk/test/lib/jdk/test/lib/management/DynamicVMOption.java b/test/lib/jdk/test/lib/management/DynamicVMOption.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/management/DynamicVMOption.java rename to test/lib/jdk/test/lib/management/DynamicVMOption.java diff --git a/jdk/test/lib/jdk/test/lib/management/InputArguments.java b/test/lib/jdk/test/lib/management/InputArguments.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/management/InputArguments.java rename to test/lib/jdk/test/lib/management/InputArguments.java diff --git a/jdk/test/lib/jdk/test/lib/management/ThreadMXBeanTool.java b/test/lib/jdk/test/lib/management/ThreadMXBeanTool.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/management/ThreadMXBeanTool.java rename to test/lib/jdk/test/lib/management/ThreadMXBeanTool.java diff --git a/jdk/test/lib/jdk/test/lib/process/ExitCode.java b/test/lib/jdk/test/lib/process/ExitCode.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/process/ExitCode.java rename to test/lib/jdk/test/lib/process/ExitCode.java diff --git a/jdk/test/lib/jdk/test/lib/process/OutputAnalyzer.java b/test/lib/jdk/test/lib/process/OutputAnalyzer.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/process/OutputAnalyzer.java rename to test/lib/jdk/test/lib/process/OutputAnalyzer.java diff --git a/jdk/test/lib/jdk/test/lib/process/OutputBuffer.java b/test/lib/jdk/test/lib/process/OutputBuffer.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/process/OutputBuffer.java rename to test/lib/jdk/test/lib/process/OutputBuffer.java diff --git a/jdk/test/lib/jdk/test/lib/process/ProcessTools.java b/test/lib/jdk/test/lib/process/ProcessTools.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/process/ProcessTools.java rename to test/lib/jdk/test/lib/process/ProcessTools.java diff --git a/jdk/test/lib/jdk/test/lib/process/StreamPumper.java b/test/lib/jdk/test/lib/process/StreamPumper.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/process/StreamPumper.java rename to test/lib/jdk/test/lib/process/StreamPumper.java diff --git a/jdk/test/lib/jdk/test/lib/thread/TestThread.java b/test/lib/jdk/test/lib/thread/TestThread.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/thread/TestThread.java rename to test/lib/jdk/test/lib/thread/TestThread.java diff --git a/jdk/test/lib/jdk/test/lib/thread/XRun.java b/test/lib/jdk/test/lib/thread/XRun.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/thread/XRun.java rename to test/lib/jdk/test/lib/thread/XRun.java diff --git a/jdk/test/lib/jdk/test/lib/util/Pair.java b/test/lib/jdk/test/lib/util/Pair.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/util/Pair.java rename to test/lib/jdk/test/lib/util/Pair.java diff --git a/jdk/test/lib/jdk/test/lib/util/SerializationUtils.java b/test/lib/jdk/test/lib/util/SerializationUtils.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/util/SerializationUtils.java rename to test/lib/jdk/test/lib/util/SerializationUtils.java diff --git a/jdk/test/lib/jdk/test/lib/util/Triple.java b/test/lib/jdk/test/lib/util/Triple.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/util/Triple.java rename to test/lib/jdk/test/lib/util/Triple.java diff --git a/jdk/test/lib/sun/hotspot/WhiteBox.java b/test/lib/sun/hotspot/WhiteBox.java similarity index 100% rename from jdk/test/lib/sun/hotspot/WhiteBox.java rename to test/lib/sun/hotspot/WhiteBox.java diff --git a/jdk/test/lib/sun/hotspot/code/BlobType.java b/test/lib/sun/hotspot/code/BlobType.java similarity index 100% rename from jdk/test/lib/sun/hotspot/code/BlobType.java rename to test/lib/sun/hotspot/code/BlobType.java diff --git a/jdk/test/lib/sun/hotspot/code/CodeBlob.java b/test/lib/sun/hotspot/code/CodeBlob.java similarity index 100% rename from jdk/test/lib/sun/hotspot/code/CodeBlob.java rename to test/lib/sun/hotspot/code/CodeBlob.java diff --git a/jdk/test/lib/sun/hotspot/code/Compiler.java b/test/lib/sun/hotspot/code/Compiler.java similarity index 100% rename from jdk/test/lib/sun/hotspot/code/Compiler.java rename to test/lib/sun/hotspot/code/Compiler.java diff --git a/jdk/test/lib/sun/hotspot/code/NMethod.java b/test/lib/sun/hotspot/code/NMethod.java similarity index 100% rename from jdk/test/lib/sun/hotspot/code/NMethod.java rename to test/lib/sun/hotspot/code/NMethod.java diff --git a/jdk/test/lib/sun/hotspot/cpuinfo/CPUInfo.java b/test/lib/sun/hotspot/cpuinfo/CPUInfo.java similarity index 100% rename from jdk/test/lib/sun/hotspot/cpuinfo/CPUInfo.java rename to test/lib/sun/hotspot/cpuinfo/CPUInfo.java diff --git a/jdk/test/lib/sun/hotspot/gc/GC.java b/test/lib/sun/hotspot/gc/GC.java similarity index 100% rename from jdk/test/lib/sun/hotspot/gc/GC.java rename to test/lib/sun/hotspot/gc/GC.java diff --git a/jdk/test/lib/sun/hotspot/parser/DiagnosticCommand.java b/test/lib/sun/hotspot/parser/DiagnosticCommand.java similarity index 100% rename from jdk/test/lib/sun/hotspot/parser/DiagnosticCommand.java rename to test/lib/sun/hotspot/parser/DiagnosticCommand.java