Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Advanced-java] On the fly compile


  • From: kkonaka@xxxxxxx (kkonaka@xxxxxxx)
  • Subject: [Advanced-java] On the fly compile
  • Date: Fri, 22 Feb 2002 10:16:24 -0500

> need is a means to compile a class starting from a String value containing
> the source code rather than from a .java file.

I'd probably start with:
    http://bcel.sourceforge.net/ ByteCode Engineering Library
or  http://www.beanshell.org/ BeanShell
or  http://www.gnu.org/software/kawa/ kawa - gnu.bytecode
and more...

in case if true "compilation"(=.class file geneation) is _not really_
needed, things like below may do nearly the same:

 | import bsh.Interpreter; // BeanShell
 | public class A {
 |   public static void main(String[] args) throws Exception {
 |     new Interpreter().eval("System.out.println(\"hello world.\")");
 |   }
 | }

kenji :)