Reputation: 4026
currently i compile my java sourcefiles with:
ArrayList<String> optionList = new ArrayList<String>();
String testpath = System.getProperty("java.class.path") + convertJarFilesToClassPath(getJarFiles());
optionList.addAll(Arrays.asList("-classpath", testpath));
optionList.addAll(Arrays.asList("-d", this.outputDir+"\\bin"));
ArrayList<File> files1 = getSourceFiles();
Iterable<? extends JavaFileObject> compilationUnits1 = fileManager.getJavaFileObjectsFromFiles(files1);
JavaCompiler.CompilationTask task = compiler.getTask(null ,fileManager ,null , optionList, null, compilationUnits );
boolean compiled = task.call();
Then i get my .class files correctly compiled, but i would like to have also a jar file generated. I am not familiar with the JavaCompiler, i use jdk 7.
What do i have to do, to tell the javax.tools.JavaCompiler to generate a jar file?
Upvotes: 0
Views: 773