JDK-8013821 : Wildcard bugfix consequence
  • Type: Bug
  • Component: docs
  • Sub-Component: release_notes
  • Affected Version: 7u10,8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-03-20
  • Updated: 2014-11-17
  • Resolved: 2013-05-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7u10Fixed
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
jdk 1.7u10

ADDITIONAL OS VERSION INFORMATION :
windows 7 64-bit

A DESCRIPTION OF THE PROBLEM :
The wildcard character  " * "  doesn't work as it should. For example passing a parameter in batch file:

java -Xmx256M -Xss1M -jar dev_*.jar run

does not run the dev_build_01.jar file found in the same directory.

In a program, for example, using ProcessBuilder and passing a jar's that includes a wildcard, Java seems to take this literally and says  " Unable to find jarfile. " 

REGRESSION.  Last worked in version 7

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Make batch file and use a wildcard, or use a wildcard within any string that's to be used as a parameter. Java will evaluate this literally.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
wildcards work like normal. java will use the first found result that matches a string and wildcard, e.g. example*.jar
ACTUAL -
 " Unable to access jarfile dev*.jar " 

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
None. I had to use a hard coded string to get things to work.
Comments
JDK 7u10 Release Notes page has been updated as advised: http://www.oracle.com/technetwork/java/javase/7u10-relnotes-1880995.html
11-05-2013

This is specific to Windows, (NOTE: wildcard expansion is done by the shell not by java on *nix), and on Windows is working as expected, ie. wildcard expansion is allowed only for -cp|-classpath and application arguments. It is somewhat strange that the use case is with -jar option, so what happens if there are two jars that match ? See this https://jbs.oracle.com/bugs/browse/JDK-7146424 for all the gory details. The accompanying ccc explains that the wildcard parsing is supported only for -cp|-classpath option and for application arguments such as javac *.java. We may need to update the release notes to clarify the supported options. The release notes here: http://www.oracle.com/technetwork/java/javase/7u10-relnotes-1880995.html Says this: The Java command and Setting the classpath documents describe how the wildcard character (*) can be used in a classpath element to expand into a list of the .jar files in the associated directory, separated by the classpath separator (;). This wildcard expansion does not work in a Windows command shell for a single element classpath due to the Microsoft bug described in Wildcard Handling is Broken. <add> On Windows, wildcard expansion will be supported only for -cp, -classpath option and application arguments. </add> See 7146424. For a list of other bug fixes included in this release, see JDK 7u10 Bug Fixes page.
07-05-2013

We also need the same release notes for jdk8 as well.
07-05-2013

Assigning to docs team for release note clarification.
06-05-2013

Wildcard handling on windows is handled by the launcher not the VM. This issue may have already been fixed by changes to the wildcard handling.
06-05-2013

Works on sparc but not on Win, looks like a genuine issue.
02-05-2013