"Jean-S�bastien Goupil" <jsgoupil@gmail.com> wrote
>> I'm currently using Java6 and I'm compiling my class with the
>> JavaCompiler.
[quoted text clipped - 3 lines]
>> When I compile my class without specifiying a folder (with the
>> following code)
which you really, really should lay out for readability on Usenet.
>> boolean compilation = _compiler.getTask(
>> null, _fileManager, _diagnostic,
>> options, null, compilationUnits ).call();
According to
<http://java.sun.com/javase/6/docs/api/javax/tools/JavaCompiler.html#getTask(java
.io.Writer,%20javax.tools.JavaFileManager,%20javax.tools.DiagnosticListener,%20j
ava.lang.Iterable,%20java.lang.Iterable,%20java.lang.Iterable)>
it looks like your "options" are the key.
>> ...
>> The output .class is copied in the folder where the program is
[quoted text clipped - 4 lines]
>> don't know if I should simply move the file ? Is there any option i
>> can set in the compiler to output the .class file somewhere?
> yes, did you consider googling this? the very first hit for "javac options"
> http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html
He might've done, except that he's using Java 6, not the obsolescent Java 1.4.
That said, given the information in the JavaCompiler Javadocs, it looks like
the standard compiler options at
<http://java.sun.com/javase/6/docs/technotes/tools/solaris/javac.html>
<http://java.sun.com/javase/6/docs/technotes/tools/solaris/javac.html#options>
apply, specifically "-d directory".

Signature
Lew
Jean-Sébastien Goupil - 19 Oct 2007 21:41 GMT
> "Jean-S?bastien Goupil" <jsgou...@gmail.com> wrote
>
[quoted text clipped - 38 lines]
> --
> Lew
I tried that and it seems it's not working...,
I tried with
-d C:\
-d file://C:/
-d .
"-d ."
-d "."
-dC:\
...
And I receive this : "java.lang.IllegalArgumentException: invalid
flag: -d ."
Richard Reynolds - 19 Oct 2007 22:04 GMT
>> "Jean-S?bastien Goupil" <jsgou...@gmail.com> wrote
>>
[quoted text clipped - 55 lines]
> And I receive this : "java.lang.IllegalArgumentException: invalid
> flag: -d ."
Please show us the whole command you're using.
Jean-Sébastien Goupil - 19 Oct 2007 22:36 GMT
On Oct 19, 5:04 pm, "Richard Reynolds" <richiereyno...@ntlworld.com>
wrote:
> "Jean-S?bastien Goupil" <jsgou...@gmail.com> wrote in message
>
[quoted text clipped - 61 lines]
>
> Please show us the whole command you're using.
there is the code I am using
Remove the -d . to make it works, But i would like to move the .class
file somewhere else...
http://pastebin.com/f1e39ed76
Lew - 19 Oct 2007 22:58 GMT
>>> I tried that and it seems it's not working...,
>>> I tried with
[quoted text clipped - 4 lines]
>>> -d "."
>>> -dC:\
That's probably because "-d" and the target directory are two different
arguments, not one.
How about:
final Iterable<String> options =
Arrays.asList( new String[] { "-verbose", "-Xlint", "-d", "."} );
Then, of course, there is the very dicey issue of where "." is.

Signature
Lew
Jean-Sébastien Goupil - 19 Oct 2007 23:26 GMT
> Jean-S?bastien Goupil wrote:
> >>> I tried that and it seems it's not working...,
[quoted text clipped - 18 lines]
> --
> Lew
This is perfectly working
of course i don't use ".", it was just to test here
thank you very much