I want to set the path in which the .class
file generated when using javax.tools.JavaCompiler
, how can I do that?
Asked
Active
Viewed 536 times
1

AmgadMHM
- 146
- 8
-
possible duplicate of [How to set classpath when I use javax.tools.JavaCompiler compile the source?](http://stackoverflow.com/questions/1563909/how-to-set-classpath-when-i-use-javax-tools-javacompiler-compile-the-source) – Jul 04 '15 at 22:33
-
No I want to set the output location of `.class` file not classPath, already i configured ClassPath option – AmgadMHM Jul 04 '15 at 22:45
1 Answers
1
The Solution is
StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null);
fileManager.setLocation(StandardLocation.CLASS_OUTPUT, Arrays.asList(new File("build/classes")));

AmgadMHM
- 146
- 8