Community
Participate
Working Groups
Using HEAD, the batch compiler doesn't report very nicely that the output directory is a file. It needs to be a directory.
Created attachment 38704 [details] Proposed fix
With the fix: The output directory is a file : d:\tests_sources\X.java [compiled 2 lines in 781 ms: 2.5 lines/s] [1 .class file generated] No .class file created for file X.class in d:\tests_sources\X.java because of an IOException. The outDir is a file : d:\tests_sources\X.java [compiled 2 lines in 772 ms: 2.5 lines/s] [1 .class file generated] java.io.IOException: The outDir is a file not a directory. at org.eclipse.jdt.internal.compiler.ClassFile.buildAllDirectoriesInto(ClassFile.java:123) at org.eclipse.jdt.internal.compiler.ClassFile.writeToDisk(ClassFile.java:290) at org.eclipse.jdt.internal.compiler.batch.Main.outputClassFiles(Main.java:2779) at org.eclipse.jdt.internal.compiler.batch.Main$1.acceptResult(Main.java:2656) at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:405) at org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:2825) at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1303) at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1109) at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1101) at org.eclipse.jdt.core.tools.compiler.Compile.main(Compile.java:19) No .class file created for file named d:\tests_sources\X.javaX.class because of an IOException.
The second part is the actual behavior without the patch.
+1 for 3.2RC2
Fixed and released in HEAD. Now the batch compiler reports: The output directory is a file : d:\tests_sources\X.java [compiled 2 lines in 781 ms: 2.5 lines/s] No .class file created for file X.class in d:\tests_sources\X.java because of an IOException.
Current code simply returns: No .class file created for file X.class in d:\tests_sources\X.java because of an IOException: The output directory is a file : d:\tests_sources\X.java I removed the usage of System.out.println(...) since this is polluting the console.
Verified with I20060427-1600 for 3.2RC2