JRockit 8.1 SP1 - Error when calling java.io.File.getCanonicalPath() in JRockit with a UNC path - CR125688 (Doc ID 774098.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle JRockit / JRockit / 8,1
Information in this document applies to any platform

Goal

When the API java.io.File.getCanonicalPath() in JRockit is called using a UNC path as in the following example:

public class ChkDir {

	public static void main(String[] args) throws java.io.IOException {
		java.io.File f = new java.io.File(args[0]);
		System.out.println(f.getCanonicalPath());
		System.out.println(f.exists());
	}
}

the following error occurs:

C:\bea\jrockit81sp1_141_03\bin\java ChkDir "\\theano\Downloads\Distributions\My Documents\Nelson
egypt\banner.jpg"

java.io.IOException: \\theano\Downloads\Distributions\My Documents\Nelson egypt\banner.jpg: The file name, directory
name, or volume label syntax is incorrect
        at java.io.Win32FileSystem.canonicalize(Ljava.lang.String;)Ljava.lang.String;(Native Method)
        at java.io.File.getCanonicalPath()Ljava.lang.String;(Unknown Source)
        at ChkDir.main([Ljava.lang.String;)V(ChkDir.java:5)

Running the same program using the Sun JVM gives the following expected behavior:

C:\bea1\jdk131_08\bin\java ChkDir "\\theano\Downloads\Distributions\My Documents\Nelson egypt\banner.jpg"

\\theano\Downloads\Distributions\My Documents\Nelson egypt\banner.jpg
true

CONFIGURATION:
Windows 2000
JRockit 8.1 SP1

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms