wood burning stoves 2.0*
The moose likes BEA/Weblogic and the fly likes Unable to compile default package class used in other classes JavaCompiler API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Unable to compile default package class used in other classes JavaCompiler API" Watch "Unable to compile default package class used in other classes JavaCompiler API" New topic
Author

Unable to compile default package class used in other classes JavaCompiler API

thinkpavan pavan
Greenhorn

Joined: Apr 06, 2011
Posts: 6
I have a situvation where i need to compile classes dynamically.

Following is the structure in which my java classes have been organized.


where A is a class with default package, and B is a class with package name test. B has A as a attribute.

Files are saved in their respective folders( as per package )

I fail to compile this with JAVA Compiler API.

Any help !!
Syed Muhammad Nayyar Mustafa
Greenhorn

Joined: May 02, 2012
Posts: 11

if you mean through javax.tools.JavaCompiler, then use getTask method to set classpath option


Syed Muhammad Nayyar Mustafa
Greenhorn

Joined: May 02, 2012
Posts: 11

http://docs.oracle.com/javase/6/docs/api/javax/tools/JavaCompiler.html#getTask%28java.io.Writer,%20javax.tools.JavaFileManager,%20javax.tools.DiagnosticListener,%20java.lang.Iterable,%20java.lang.Iterable,%20java.lang.Iterable%29
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to compile default package class used in other classes JavaCompiler API