Hi,
The extension .java is the one by default recognized by Sun's Compiler and many others. But is it possible to force compiling files using another extension ?
With Sun's JDK 1.4.2_07, if we try
> javac TestJav.jav
We got :
javac: invalid flag: TestJav.jav
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
....
Same result if calling tools.jar/com.sun.tools.javac.Main.compile from a java source
Idem with the eclipse internal compiler :
# from a command line
>java -jar org.eclipse.jdt.core_3.2.0.v_671.jar TestJava.java
=> ok, .class created, but with :
>java -jar org.eclipse.jdt.core_3.2.0.v_671.jar TestJav.jav
directory does not exist: TestJav.jav
# programmatically from a Java file :
org.eclipse.jdt.internal.compiler.batch.Main.main(
new String[] {"TestJav.jav"});
// or :
org.eclipse.jdt.internal.compiler.batch.Main.compile("TestJav.jav");
=> exception apparently during Main.configure("TestJav.jav") :
org.eclipse.jdt.core.compiler.InvalidInputException: directory
does not exist: TestJav.jav
Is there a way to solve this ? Using javax.tools.JavaCompiler from JSDK1.6, but using a previous compiler like JDK1.4.2 ?
Thanks for any help !
Yann