8042888: Remove extcheck tool

Reviewed-by: alanb, chegar
This commit is contained in:
Pavel Rappo 2014-10-22 10:41:07 +01:00
parent c603f42b91
commit 023d824a43
15 changed files with 0 additions and 1160 deletions
jdk
make
src
bsd/doc/man
jdk.dev/share/classes/com/sun/tools/extcheck
linux/doc/man
solaris/doc/sun/man/man1
test

@ -477,7 +477,6 @@ TOOLS_JAR_INCLUDES := \
com/sun/tools/doclint \
com/sun/tools/example/debug/expr \
com/sun/tools/example/debug/tty \
com/sun/tools/extcheck \
com/sun/tools/hat \
com/sun/tools/internal/jxc \
com/sun/tools/internal/jxc/ap \

@ -94,7 +94,6 @@ endef
ifeq ($(PROFILE), )
NOT_JRE_BIN_FILES := \
appletviewer$(EXE_SUFFIX) \
extcheck$(EXE_SUFFIX) \
idlj$(EXE_SUFFIX) \
jar$(EXE_SUFFIX) \
jarsigner$(EXE_SUFFIX) \
@ -326,7 +325,6 @@ ifneq ($(OPENJDK_TARGET_OS), windows)
JDK_MAN_PAGES = \
$(JRE_MAN_PAGES) \
appletviewer.1 \
extcheck.1 \
idlj.1 \
jar.1 \
jarsigner.1 \

@ -25,9 +25,6 @@
include LauncherCommon.gmk
$(eval $(call SetupLauncher,extcheck, \
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.extcheck.Main"$(COMMA) }'))
$(eval $(call SetupLauncher,jar, \
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jar.Main"$(COMMA) }'))

@ -1,91 +0,0 @@
'\" t
.\" Copyright (c) 1998, 2013, 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.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Basic Tools
.\" Title: extcheck.1
.\"
.if n .pl 99999
.TH extcheck 1 "21 November 2013" "JDK 8" "Basic Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
extcheck \- Detects version conflicts between a target Java Archive (JAR) file and currently installed extension JAR files\&.
.SH SYNOPSIS
.sp
.nf
\fBextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
.fi
.sp
.TP
\fIoptions\fR
The command-line options\&. See Options\&.
.TP
\fItargetfile\&.jar\fR
The target JAR file against which the currently installed extension JAR files are compared to detect version conflicts\&.
.SH DESCRIPTION
The \f3extcheck\fR command checks a specified JAR file for title and version conflicts with any extensions installed in the Java SE SDK\&. Before installing an extension, you can use this utility to see whether the same or a more recent version of the extension is already installed\&.
.PP
The \f3extcheck\fR command compares the Specification-title and Specification-version headers in the manifest of the \f3targetfile\&.jar\fR file against the corresponding headers in all JAR files currently installed in the extension directory\&. By default, the extension directory is \f3jre/lib/ext\fR on Oracle Solaris and \f3\ejre\elib\eext\fR on Windows\&. The \f3extcheck\fR command compares version numbers in the same way as the \f3java\&.lang\&.Package\&.isCompatibleWith\fR method\&.
.PP
If no conflict is detected, then the return code is 0\&.
.PP
If the manifest of any JAR file in the extensions directory has the same \f3Specification-title\fR and the same or a newer \f3Specification-version\fR number, then a non-zero error code is returned\&. A non-zero error code is also returned when \f3targetfile\&.jar\fR does not have the \f3Specification-title\fR or \f3Specification-version\fR attributes in its manifest file\&.
.SH OPTIONS
.TP
-verbose
.br
Lists JAR files in the extension directory as they are checked\&. Additionally, manifest attributes of the target JAR file and any conflicting JAR files are also reported\&.
.TP
-J\fIoption\fR
.br
Passes \fIoption\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
jar(1)
.RE
.br
'pl 8.5i
'bp

@ -1,24 +0,0 @@
." Copyright (c) 1998, 2012, 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.
."
.TH extcheck 1 "07 May 2011"
.LP

@ -1,410 +0,0 @@
/*
* Copyright (c) 1998, 2008, 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.
*/
package com.sun.tools.extcheck;
import java.util.*;
import java.net.MalformedURLException;
import java.util.Vector;
import java.io.*;
import java.util.StringTokenizer;
import java.net.URL;
import java.util.jar.JarFile;
import java.util.jar.JarEntry;
import java.util.jar.Manifest;
import java.util.jar.Attributes;
import java.util.jar.Attributes.Name;
import java.net.URLConnection;
import java.security.Permission;
import java.util.jar.*;
import java.net.JarURLConnection;
import sun.net.www.ParseUtil;
/**
* ExtCheck reports on clashes between a specified (target)
* jar file and jar files already installed in the extensions
* directory.
*
* @author Benedict Gomes
* @since 1.2
*/
public class ExtCheck {
private static final boolean DEBUG = false;
// The following strings hold the values of the version variables
// for the target jar file
private String targetSpecTitle;
private String targetSpecVersion;
private String targetSpecVendor;
private String targetImplTitle;
private String targetImplVersion;
private String targetImplVendor;
private String targetsealed;
/* Flag to indicate whether extra information should be dumped to stdout */
private boolean verboseFlag;
/*
* Create a new instance of the jar reporting tool for a particular
* targetFile.
* @param targetFile is the file to compare against.
* @param verbose indicates whether to dump filenames and manifest
* information (on conflict) to the standard output.
*/
static ExtCheck create(File targetFile, boolean verbose) {
return new ExtCheck(targetFile, verbose);
}
private ExtCheck(File targetFile, boolean verbose) {
verboseFlag = verbose;
investigateTarget(targetFile);
}
private void investigateTarget(File targetFile) {
verboseMessage("Target file:" + targetFile);
Manifest targetManifest = null;
try {
File canon = new File(targetFile.getCanonicalPath());
URL url = ParseUtil.fileToEncodedURL(canon);
if (url != null){
JarLoader loader = new JarLoader(url);
JarFile jarFile = loader.getJarFile();
targetManifest = jarFile.getManifest();
}
} catch (MalformedURLException e){
error("Malformed URL ");
} catch (IOException e) {
error("IO Exception ");
}
if (targetManifest == null)
error("No manifest available in "+targetFile);
Attributes attr = targetManifest.getMainAttributes();
if (attr != null) {
targetSpecTitle = attr.getValue(Name.SPECIFICATION_TITLE);
targetSpecVersion = attr.getValue(Name.SPECIFICATION_VERSION);
targetSpecVendor = attr.getValue(Name.SPECIFICATION_VENDOR);
targetImplTitle = attr.getValue(Name.IMPLEMENTATION_TITLE);
targetImplVersion = attr.getValue(Name.IMPLEMENTATION_VERSION);
targetImplVendor = attr.getValue(Name.IMPLEMENTATION_VENDOR);
targetsealed = attr.getValue(Name.SEALED);
} else {
error("No attributes available in the manifest");
}
if (targetSpecTitle == null)
error("The target file does not have a specification title");
if (targetSpecVersion == null)
error("The target file does not have a specification version");
verboseMessage("Specification title:" + targetSpecTitle);
verboseMessage("Specification version:" + targetSpecVersion);
if (targetSpecVendor != null)
verboseMessage("Specification vendor:" + targetSpecVendor);
if (targetImplVersion != null)
verboseMessage("Implementation version:" + targetImplVersion);
if (targetImplVendor != null)
verboseMessage("Implementation vendor:" + targetImplVendor);
verboseMessage("");
}
/**
* Verify that none of the jar files in the install directory
* has the same specification-title and the same or a newer
* specification-version.
*
* @return Return true if the target jar file is newer
* than any installed jar file with the same specification-title,
* otherwise return false
*/
boolean checkInstalledAgainstTarget(){
String s = System.getProperty("java.ext.dirs");
File [] dirs;
if (s != null) {
StringTokenizer st =
new StringTokenizer(s, File.pathSeparator);
int count = st.countTokens();
dirs = new File[count];
for (int i = 0; i < count; i++) {
dirs[i] = new File(st.nextToken());
}
} else {
dirs = new File[0];
}
boolean result = true;
for (int i = 0; i < dirs.length; i++) {
String[] files = dirs[i].list();
if (files != null) {
for (int j = 0; j < files.length; j++) {
try {
File f = new File(dirs[i],files[j]);
File canon = new File(f.getCanonicalPath());
URL url = ParseUtil.fileToEncodedURL(canon);
if (url != null){
result = result && checkURLRecursively(1,url);
}
} catch (MalformedURLException e){
error("Malformed URL");
} catch (IOException e) {
error("IO Exception");
}
}
}
}
if (result) {
generalMessage("No conflicting installed jar found.");
} else {
generalMessage("Conflicting installed jar found. "
+ " Use -verbose for more information.");
}
return result;
}
/**
* Recursively verify that a jar file, and any urls mentioned
* in its class path, do not conflict with the target jar file.
*
* @param indent is the current nesting level
* @param url is the path to the jar file being checked.
* @return true if there is no newer URL, otherwise false
*/
private boolean checkURLRecursively(int indent, URL url)
throws IOException
{
verboseMessage("Comparing with " + url);
JarLoader jarloader = new JarLoader(url);
JarFile j = jarloader.getJarFile();
Manifest man = j.getManifest();
if (man != null) {
Attributes attr = man.getMainAttributes();
if (attr != null){
String title = attr.getValue(Name.SPECIFICATION_TITLE);
String version = attr.getValue(Name.SPECIFICATION_VERSION);
String vendor = attr.getValue(Name.SPECIFICATION_VENDOR);
String implTitle = attr.getValue(Name.IMPLEMENTATION_TITLE);
String implVersion
= attr.getValue(Name.IMPLEMENTATION_VERSION);
String implVendor = attr.getValue(Name.IMPLEMENTATION_VENDOR);
String sealed = attr.getValue(Name.SEALED);
if (title != null){
if (title.equals(targetSpecTitle)){
if (version != null){
if (version.equals(targetSpecVersion) ||
isNotOlderThan(version,targetSpecVersion)){
verboseMessage("");
verboseMessage("CONFLICT DETECTED ");
verboseMessage("Conflicting file:"+ url);
verboseMessage("Installed Version:" +
version);
if (implTitle != null)
verboseMessage("Implementation Title:"+
implTitle);
if (implVersion != null)
verboseMessage("Implementation Version:"+
implVersion);
if (implVendor != null)
verboseMessage("Implementation Vendor:"+
implVendor);
return false;
}
}
}
}
}
}
boolean result = true;
URL[] loaderList = jarloader.getClassPath();
if (loaderList != null) {
for(int i=0; i < loaderList.length; i++){
if (url != null){
boolean res = checkURLRecursively(indent+1,loaderList[i]);
result = res && result;
}
}
}
return result;
}
/**
* See comment in method java.lang.Package.isCompatibleWith.
* Return true if already is not older than target. i.e. the
* target file may be superseded by a file already installed
*/
private boolean isNotOlderThan(String already,String target)
throws NumberFormatException
{
if (already == null || already.length() < 1) {
throw new NumberFormatException("Empty version string");
}
// Until it matches scan and compare numbers
StringTokenizer dtok = new StringTokenizer(target, ".", true);
StringTokenizer stok = new StringTokenizer(already, ".", true);
while (dtok.hasMoreTokens() || stok.hasMoreTokens()) {
int dver;
int sver;
if (dtok.hasMoreTokens()) {
dver = Integer.parseInt(dtok.nextToken());
} else
dver = 0;
if (stok.hasMoreTokens()) {
sver = Integer.parseInt(stok.nextToken());
} else
sver = 0;
if (sver < dver)
return false; // Known to be incompatible
if (sver > dver)
return true; // Known to be compatible
// Check for and absorb separators
if (dtok.hasMoreTokens())
dtok.nextToken();
if (stok.hasMoreTokens())
stok.nextToken();
// Compare next component
}
// All components numerically equal
return true;
}
/**
* Prints out message if the verboseFlag is set
*/
void verboseMessage(String message){
if (verboseFlag) {
System.err.println(message);
}
}
void generalMessage(String message){
System.err.println(message);
}
/**
* Throws a RuntimeException with a message describing the error.
*/
static void error(String message) throws RuntimeException {
throw new RuntimeException(message);
}
/**
* Inner class used to represent a loader of resources and classes
* from a base URL. Somewhat modified version of code in
* sun.misc.URLClassPath.JarLoader
*/
private static class JarLoader {
private final URL base;
private JarFile jar;
private URL csu;
/*
* Creates a new Loader for the specified URL.
*/
JarLoader(URL url) {
String urlName = url + "!/";
URL tmpBaseURL = null;
try {
tmpBaseURL = new URL("jar","",urlName);
jar = findJarFile(url);
csu = url;
} catch (MalformedURLException e) {
ExtCheck.error("Malformed url "+urlName);
} catch (IOException e) {
ExtCheck.error("IO Exception occurred");
}
base = tmpBaseURL;
}
/*
* Returns the base URL for this Loader.
*/
URL getBaseURL() {
return base;
}
JarFile getJarFile() {
return jar;
}
private JarFile findJarFile(URL url) throws IOException {
// Optimize case where url refers to a local jar file
if ("file".equals(url.getProtocol())) {
String path = url.getFile().replace('/', File.separatorChar);
File file = new File(path);
if (!file.exists()) {
throw new FileNotFoundException(path);
}
return new JarFile(path);
}
URLConnection uc = getBaseURL().openConnection();
//uc.setRequestProperty(USER_AGENT_JAVA_VERSION, JAVA_VERSION);
return ((JarURLConnection)uc).getJarFile();
}
/*
* Returns the JAR file local class path, or null if none.
*/
URL[] getClassPath() throws IOException {
Manifest man = jar.getManifest();
if (man != null) {
Attributes attr = man.getMainAttributes();
if (attr != null) {
String value = attr.getValue(Name.CLASS_PATH);
if (value != null) {
return parseClassPath(csu, value);
}
}
}
return null;
}
/*
* Parses value of the Class-Path manifest attribute and returns
* an array of URLs relative to the specified base URL.
*/
private URL[] parseClassPath(URL base, String value)
throws MalformedURLException
{
StringTokenizer st = new StringTokenizer(value);
URL[] urls = new URL[st.countTokens()];
int i = 0;
while (st.hasMoreTokens()) {
String path = st.nextToken();
urls[i] = new URL(base, path);
i++;
}
return urls;
}
}
}

@ -1,90 +0,0 @@
/*
* Copyright (c) 1998, 2008, 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.
*/
package com.sun.tools.extcheck;
import java.io.*;
/**
* Main program of extcheck
*/
public final class Main {
public static final String INSUFFICIENT = "Insufficient number of arguments";
public static final String MISSING = "Missing <jar file> argument";
public static final String DOES_NOT_EXIST = "Jarfile does not exist: ";
public static final String EXTRA = "Extra command line argument: ";
/**
* Terminates with one of the following codes
* 1 A newer (or same version) jar file is already installed
* 0 No newer jar file was found
* -1 An internal error occurred
*/
public static void main(String args[]) {
try {
realMain(args);
} catch (Exception ex) {
System.err.println(ex.getMessage());
System.exit(-1);
}
}
public static void realMain(String[] args) throws Exception {
if (args.length < 1) {
usage(INSUFFICIENT);
}
int argIndex = 0;
boolean verboseFlag = false;
if (args[argIndex].equals("-verbose")) {
verboseFlag = true;
argIndex++;
if (argIndex >= args.length) {
usage(MISSING);
}
}
String jarName = args[argIndex];
argIndex++;
File jarFile = new File(jarName);
if (!jarFile.exists()){
usage(DOES_NOT_EXIST + jarName);
}
if (argIndex < args.length) {
usage(EXTRA + args[argIndex]);
}
ExtCheck jt = ExtCheck.create(jarFile,verboseFlag);
boolean result = jt.checkInstalledAgainstTarget();
if (result) {
System.exit(0);
} else {
System.exit(1);
}
}
private static void usage(String msg) throws Exception {
throw new Exception(msg + "\nUsage: extcheck [-verbose] <jar file>");
}
}

@ -1,91 +0,0 @@
'\" t
.\" Copyright (c) 1998, 2013, 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.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Basic Tools
.\" Title: extcheck.1
.\"
.if n .pl 99999
.TH extcheck 1 "21 November 2013" "JDK 8" "Basic Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
extcheck \- Detects version conflicts between a target Java Archive (JAR) file and currently installed extension JAR files\&.
.SH SYNOPSIS
.sp
.nf
\fBextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
.fi
.sp
.TP
\fIoptions\fR
The command-line options\&. See Options\&.
.TP
\fItargetfile\&.jar\fR
The target JAR file against which the currently installed extension JAR files are compared to detect version conflicts\&.
.SH DESCRIPTION
The \f3extcheck\fR command checks a specified JAR file for title and version conflicts with any extensions installed in the Java SE SDK\&. Before installing an extension, you can use this utility to see whether the same or a more recent version of the extension is already installed\&.
.PP
The \f3extcheck\fR command compares the Specification-title and Specification-version headers in the manifest of the \f3targetfile\&.jar\fR file against the corresponding headers in all JAR files currently installed in the extension directory\&. By default, the extension directory is \f3jre/lib/ext\fR on Oracle Solaris and \f3\ejre\elib\eext\fR on Windows\&. The \f3extcheck\fR command compares version numbers in the same way as the \f3java\&.lang\&.Package\&.isCompatibleWith\fR method\&.
.PP
If no conflict is detected, then the return code is 0\&.
.PP
If the manifest of any JAR file in the extensions directory has the same \f3Specification-title\fR and the same or a newer \f3Specification-version\fR number, then a non-zero error code is returned\&. A non-zero error code is also returned when \f3targetfile\&.jar\fR does not have the \f3Specification-title\fR or \f3Specification-version\fR attributes in its manifest file\&.
.SH OPTIONS
.TP
-verbose
.br
Lists JAR files in the extension directory as they are checked\&. Additionally, manifest attributes of the target JAR file and any conflicting JAR files are also reported\&.
.TP
-J\fIoption\fR
.br
Passes \fIoption\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
jar(1)
.RE
.br
'pl 8.5i
'bp

@ -1,108 +0,0 @@
'\" t
.\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Title: extcheck
.\" Language: English
.\" Date: 2013年11月21日
.\" SectDesc: 基本ツール
.\" Software: JDK 8
.\" Arch: 汎用
.\"
.\" 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.
.\"
.pl 99999
.TH "extcheck" "1" "2013年11月21日" "JDK 8" "基本ツール"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
extcheck \- ターゲットのJavaアーカイブ(JAR)ファイルと現在インストールされている拡張機能のJARファイル間のバージョンの競合を検出します。
.SH "概要"
.sp
.if n \{\
.RS 4
.\}
.nf
\fIextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
.fi
.if n \{\
.RE
.\}
.PP
\fIoptions\fR
.RS 4
コマンドライン・オプション。オプションを参照してください。
.RE
.PP
\fItargetfile\&.jar\fR
.RS 4
バージョンの競合を検出するために、現在インストールされている拡張機能JARファイルと比較するターゲットJARファイル。
.RE
.SH "説明"
.PP
\fIextcheck\fRコマンドは、指定されたJARファイルのタイトルおよびバージョンがJava SE SDKにインストールされている拡張機能と競合していないかをチェックします。拡張機能をインストールする前に、このユーティリティを使用して、同じバージョンまたはより新しいバージョンの拡張機能がすでにインストールされていないかどうかを調べることができます。
.PP
\fIextcheck\fRコマンドは、\fItargetfile\&.jar\fRファイルのマニフェスト内のヘッダーSpecification\-titleおよびSpecification\-versionを、拡張機能ディレクトリ内に現在インストールされているすべてのJARファイル内の対応するヘッダーと比較します。デフォルトでは、拡張機能ディレクトリは、Oracle Solarisの場合は\fIjre/lib/ext\fR、Windowsの場合は\fI\ejre\elib\eext\fRです。\fIextcheck\fRコマンドは、\fIjava\&.lang\&.Package\&.isCompatibleWith\fRメソッドと同様の方法でバージョン番号を比較します。
.PP
競合が検出されない場合、リターン・コードは0です。
.PP
拡張機能ディレクトリ内のいずれかのJARファイルのマニフェストに、同一の\fISpecification\-title\fR、および同一またはより新しい\fISpecification\-version\fR番号がある場合は、ゼロでないエラー・コードが返されます。\fItargetfile\&.jar\fRのマニフェスト・ファイルに\fISpecification\-title\fRまたは\fISpecification\-version\fR属性がない場合も、ゼロでないエラー・コードが返されます。
.SH "オプション"
.PP
\-verbose
.RS 4
拡張機能ディレクトリ内のJARファイルを、チェック時に一覧表示します。また、ターゲットJARファイルのマニフェストの属性、および競合するJARファイルについても報告します。
.RE
.PP
\-J\fIoption\fR
.RS 4
Java仮想マシン(JVM)に\fIoption\fRを渡します。optionには、Java起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。
.RE
.SH "関連項目"
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
jar(1)
.RE
.br
'pl 8.5i
'bp

@ -1,91 +0,0 @@
'\" t
.\" Copyright (c) 1998, 2013, 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.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Basic Tools
.\" Title: extcheck.1
.\"
.if n .pl 99999
.TH extcheck 1 "21 November 2013" "JDK 8" "Basic Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
extcheck \- Detects version conflicts between a target Java Archive (JAR) file and currently installed extension JAR files\&.
.SH SYNOPSIS
.sp
.nf
\fBextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
.fi
.sp
.TP
\fIoptions\fR
The command-line options\&. See Options\&.
.TP
\fItargetfile\&.jar\fR
The target JAR file against which the currently installed extension JAR files are compared to detect version conflicts\&.
.SH DESCRIPTION
The \f3extcheck\fR command checks a specified JAR file for title and version conflicts with any extensions installed in the Java SE SDK\&. Before installing an extension, you can use this utility to see whether the same or a more recent version of the extension is already installed\&.
.PP
The \f3extcheck\fR command compares the Specification-title and Specification-version headers in the manifest of the \f3targetfile\&.jar\fR file against the corresponding headers in all JAR files currently installed in the extension directory\&. By default, the extension directory is \f3jre/lib/ext\fR on Oracle Solaris and \f3\ejre\elib\eext\fR on Windows\&. The \f3extcheck\fR command compares version numbers in the same way as the \f3java\&.lang\&.Package\&.isCompatibleWith\fR method\&.
.PP
If no conflict is detected, then the return code is 0\&.
.PP
If the manifest of any JAR file in the extensions directory has the same \f3Specification-title\fR and the same or a newer \f3Specification-version\fR number, then a non-zero error code is returned\&. A non-zero error code is also returned when \f3targetfile\&.jar\fR does not have the \f3Specification-title\fR or \f3Specification-version\fR attributes in its manifest file\&.
.SH OPTIONS
.TP
-verbose
.br
Lists JAR files in the extension directory as they are checked\&. Additionally, manifest attributes of the target JAR file and any conflicting JAR files are also reported\&.
.TP
-J\fIoption\fR
.br
Passes \fIoption\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
jar(1)
.RE
.br
'pl 8.5i
'bp

@ -1,108 +0,0 @@
'\" t
.\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Title: extcheck
.\" Language: English
.\" Date: 2013年11月21日
.\" SectDesc: 基本ツール
.\" Software: JDK 8
.\" Arch: 汎用
.\"
.\" 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.
.\"
.pl 99999
.TH "extcheck" "1" "2013年11月21日" "JDK 8" "基本ツール"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
extcheck \- ターゲットのJavaアーカイブ(JAR)ファイルと現在インストールされている拡張機能のJARファイル間のバージョンの競合を検出します。
.SH "概要"
.sp
.if n \{\
.RS 4
.\}
.nf
\fIextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
.fi
.if n \{\
.RE
.\}
.PP
\fIoptions\fR
.RS 4
コマンドライン・オプション。オプションを参照してください。
.RE
.PP
\fItargetfile\&.jar\fR
.RS 4
バージョンの競合を検出するために、現在インストールされている拡張機能JARファイルと比較するターゲットJARファイル。
.RE
.SH "説明"
.PP
\fIextcheck\fRコマンドは、指定されたJARファイルのタイトルおよびバージョンがJava SE SDKにインストールされている拡張機能と競合していないかをチェックします。拡張機能をインストールする前に、このユーティリティを使用して、同じバージョンまたはより新しいバージョンの拡張機能がすでにインストールされていないかどうかを調べることができます。
.PP
\fIextcheck\fRコマンドは、\fItargetfile\&.jar\fRファイルのマニフェスト内のヘッダーSpecification\-titleおよびSpecification\-versionを、拡張機能ディレクトリ内に現在インストールされているすべてのJARファイル内の対応するヘッダーと比較します。デフォルトでは、拡張機能ディレクトリは、Oracle Solarisの場合は\fIjre/lib/ext\fR、Windowsの場合は\fI\ejre\elib\eext\fRです。\fIextcheck\fRコマンドは、\fIjava\&.lang\&.Package\&.isCompatibleWith\fRメソッドと同様の方法でバージョン番号を比較します。
.PP
競合が検出されない場合、リターン・コードは0です。
.PP
拡張機能ディレクトリ内のいずれかのJARファイルのマニフェストに、同一の\fISpecification\-title\fR、および同一またはより新しい\fISpecification\-version\fR番号がある場合は、ゼロでないエラー・コードが返されます。\fItargetfile\&.jar\fRのマニフェスト・ファイルに\fISpecification\-title\fRまたは\fISpecification\-version\fR属性がない場合も、ゼロでないエラー・コードが返されます。
.SH "オプション"
.PP
\-verbose
.RS 4
拡張機能ディレクトリ内のJARファイルを、チェック時に一覧表示します。また、ターゲットJARファイルのマニフェストの属性、および競合するJARファイルについても報告します。
.RE
.PP
\-J\fIoption\fR
.RS 4
Java仮想マシン(JVM)に\fIoption\fRを渡します。optionには、Java起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。
.RE
.SH "関連項目"
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
jar(1)
.RE
.br
'pl 8.5i
'bp

@ -182,7 +182,6 @@ jdk_launcher = \
#
core_tools = \
tools \
com/sun/tools/extcheck \
sun/tools/java \
sun/tools/native2ascii \
sun/tools/jrunscript

@ -1,92 +0,0 @@
/*
* Copyright (c) 2008, 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 6356642
* @summary Verify that extcheck exits appropriately when invalid args are given.
* @run shell TestExtcheckArgs.sh
* @author Dave Bristor
*/
import java.io.File;
import com.sun.tools.extcheck.Main;
/*
* Test extcheck by using Runtime.exec instead of invoking
* com.sun.tools.extcheck.Main.main, since the latter does its own
* System.exit under the conditions checked here.
*/
public class TestExtcheckArgs {
public static void realMain(String[] args) throws Throwable {
String testJar = System.getenv("TESTJAVA") + File.separator
+ "lib" + File.separator + "jconsole.jar";
verify(new String[] {
}, Main.INSUFFICIENT);
verify(new String[] {
"-verbose"
}, Main.MISSING);
verify(new String[] {
"-verbose",
"foo"
}, Main.DOES_NOT_EXIST);
verify(new String[] {
testJar,
"bar"
}, Main.EXTRA);
verify(new String[] {
"-verbose",
testJar,
"bar"
}, Main.EXTRA);
}
static void verify(String[] args, String expected) throws Throwable {
try {
Main.realMain(args);
fail();
} catch (Exception ex) {
if (ex.getMessage().startsWith(expected)) {
pass();
} else {
fail("Unexpected message: " + ex.getMessage());
}
}
}
//--------------------- Infrastructure ---------------------------
static volatile int passed = 0, failed = 0;
static boolean pass() {passed++; return true;}
static boolean fail() {failed++; Thread.dumpStack(); return false;}
static boolean fail(String msg) {System.out.println(msg); return fail();}
static void unexpected(Throwable t) {failed++; t.printStackTrace();}
static boolean check(boolean cond) {if (cond) pass(); else fail(); return cond;}
static boolean equal(Object x, Object y) {
if (x == null ? y == null : x.equals(y)) return pass();
else return fail(x + " not equal to " + y);}
public static void main(String[] args) throws Throwable {
try {realMain(args);} catch (Throwable t) {unexpected(t);}
System.out.println("\nPassed = " + passed + " failed = " + failed);
if (failed > 0) throw new AssertionError("Some tests failed");}
}

@ -1,47 +0,0 @@
#! /bin/sh
#
# Copyright (c) 2008, 2012, 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.
#
if [ "x$TESTJAVA" = x ]; then
TESTJAVA=$1; shift
TESTCLASSES=.
TESTSRC=.
fi
export TESTJAVA
case "`uname`" in Windows*|CYGWIN* ) PS=';';; *) PS=':';; esac
${TESTJAVA}/bin/javac -d ${TESTCLASSES} -classpath ${TESTJAVA}/lib/tools.jar${PS}${TESTCLASSES} ${TESTSRC}/TestExtcheckArgs.java
rc=$?
if [ $rc != 0 ]; then
echo Compilation failure with exit status $rc
exit $rc
fi
${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTJAVA}/lib/tools.jar${PS}${TESTCLASSES} TestExtcheckArgs
rc=$?
if [ $rc != 0 ]; then
echo Execution failure with exit status $rc
exit $rc
fi

@ -61,7 +61,6 @@ public class VersionCheck extends TestHelper {
static final String[] BLACKLIST_VERSION = {
"appletviewer",
"controlpanel",
"extcheck",
"jar",
"jarsigner",
"java-rmi",