0

I need to set the classloader of javac of my task ant which compiles my code.. i ve read this stackoverflow post but this

javac -J-Djava.system.class.loader=org.awesome.classloader sourcefile.java

didnt worked for me, always returning class not found exception.. and, yes, i set the classpath for the source code and the compiled classloader .class

Community
  • 1
  • 1
thiagoh
  • 7,098
  • 8
  • 51
  • 77

1 Answers1

0

After some study of this task I found a way. I initialized a custom classloader and then I used it through the new Compiler API from Java 6

http://docs.oracle.com/javase/6/docs/api/javax/tools/package-summary.html

thiagoh
  • 7,098
  • 8
  • 51
  • 77