JDK-4359123 : NoClassDefFoundError if '#' anywhere in path
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.4.0
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_8
  • CPU: sparc
  • Submitted: 2000-08-03
  • Updated: 2001-11-09
  • Resolved: 2000-09-16
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.
Other
1.4.0 betaFixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
If a "#" exists in any element of the classpath (as an absolute path)
then those classpath elements are unreachable, leading to NoClassDefFoundError.

Create a directory /tmp/a#b.

Create a trivial java program:

	public class Hello {
	    public static void main(String[] args) {
		System.out.println("Hello");
	    }
	}

# cd /tmp/a#b
# javac Hello.java
# jar cf Hello.jar Hello.class

Case 1:

# java Hello
Exception in thread "main" java.lang.NoClassDefFoundError: Hello

Case 2:

# java -classpath Hello.jar Hello
Exception in thread "main" java.lang.NoClassDefFoundError: Hello


This problem occurs with Merlin build b25.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic merlin-beta FIXED IN: merlin-beta INTEGRATED IN: merlin-beta VERIFIED IN: merlin-beta merlin-beta3
14-06-2004

WORK AROUND Don't use the '#' character in URL's. No other workaround available at this time.
11-06-2004

EVALUATION The suggested fixes have been put in for merlin. The Launcher uses File.toURL() to encode the path. michael.mccloskey@eng 2000-08-04 This change prevented the build from completing so it has been temporarily removed. michael.mccloskey@eng 2000-08-18 The change has been restored in Merlin. michael.mccloskey@sfbay 2000-09-15
18-08-2000