Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Compile and call the class during the runtime(seek for help)
Compile and call the class during the runtime [message #518953] Fri, 05 March 2010 09:48
Eclipse UserFriend
Hi guys,

I am struggling with a project, which allow user to modify the behavior of the program.

To do this, my Java code must be able to compile the Java code (*.java) and call the class from the code during the runtime.

Here are my code:
	
com.sun.tools.javac.Main javac = new com.sun.tools.javac.Main();
String[] options = new String[] {"d:\\javaExternal\\RunTimeCompilation.java"};
System.out.println(Main.compile(options));

This allows me to compile the .java file into .class file. However, I can't find the way to access/use the .class file.

Do you guys have solution for this?
Thanks a lot.
Previous Topic:.classpath is read-only
Next Topic:ASTParser.setFocalPosition(int) question
Goto Forum:
  


Current Time: Thu Mar 27 16:10:17 EDT 2025

Powered by FUDForum. Page generated in 0.27260 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top