Community
Participate
Working Groups
Build Identifier: 20110916-0149 If a Java project name contains a colon (":"), the project is successfully built ie. .class files are generated under the output folder (bin/ for example), but any attempt to execute some run configuration ('Run as Java Application' or 'Run as JUnit Test' for example) crash with java.lang.NoClassDefFoundError. Work-around is to not use project names with colon, but some project types are named to include a colon by convention. Reproducible: Always Steps to Reproduce: 1. Create a new Java project and name it as 'problematic-test:project' 2. Create a new JUnit Test Case 3. Run the Test: you should get java.lang.NoClassDefFoundError with a stacktrace into the console 4. Rename the project to 'test-project' 5. Run the Test again: it should now run ok.
How did you create a java project with a colon in the name? Eclipse doesn't allow it and gives ": is an invalid character in resource name 'problem-test:project'" error.
(In reply to comment #1) > How did you create a java project with a colon in the name? Eclipse doesn't > allow it and gives ": is an invalid character in resource name > 'problem-test:project'" error. On Mac OS X (I'm running 10.6.8) colon is allowed as a name for at least general Project and Java Project.
(In reply to comment #2) > On Mac OS X (I'm running 10.6.8) colon is allowed as a name for at least > general Project and Java Project. Sorry I wasnt aware of this. :) Reproduced on Mac. Moving to jdt/debug
*** Bug 413078 has been marked as a duplicate of this bug. ***
I reproduced using Mac 10.8.6 and a 1.6 / 1.7 /1.8 VM. This is a VM limitation / configuration issue because I cannot launch a program from the command line that has a colon in it either. For example: mrennie-mini:~ mrennie$ /vms/jdk1.8.0/bin/java -classpath /Users/mrennie/Documents/runtime-Eclipse4.3/foo:bar/bin Main Error: Could not find or load main class Main is the command line output, which matches what happens in Eclipse. This is expected because the colon is a command line delimiter for classpath entries on Mac / *nix, so in effect you wind up with two entries on the classpath: /Users/mrennie/Documents/runtime-Eclipse4.3/foo and bar/bin; neither of which has the Main class in it. I'm not sure there is anything we can do to fix this, on the commandline I tried the usual escaping tricks, but none worked. I'll dig around a bit more, but we should probably also add some checks to the JavaLaunchDelegate to fail and alert the user to the problem rather than print a cryptic message to the console.
And to top the confusion, the Finder shows a ':' in a file/folder name as a '/'. (except in the Get Info dialog when rendering a folder path in the "Where:" field).
*** Bug 287867 has been marked as a duplicate of this bug. ***
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.