Java: Compile String -> byte[] -> Class

Fabian Wickborn <wickborn@mail.CS.Uni-Magdeburg.De>
17 Jan 2003 23:02:15 -0500

          From comp.compilers

Related articles
Java: Compile String -> byte[] -> Class wickborn@mail.CS.Uni-Magdeburg.De (Fabian Wickborn) (2003-01-17)
Re: Java: Compile String -> byte[] -> Class joachim_d@gmx.de (Joachim Durchholz) (2003-01-20)
| List of all articles for this month |
From: Fabian Wickborn <wickborn@mail.CS.Uni-Magdeburg.De>
Newsgroups: comp.compilers
Date: 17 Jan 2003 23:02:15 -0500
Organization: University of Magdeburg, Germany
Keywords: Java, question
Posted-Date: 17 Jan 2003 23:02:15 EST

Hi,


In my application I would like to have the possibility to write,
compile, link and execute functions at runtime.


This is now done by entering the functions which are then written to
disk (.java-files containing classes with "public static"-methods).
These files are compile at runtime with the Kopi Java Compiler and the
class is loaded so the methods can be accessed.


I would like to drop out the necessity for using the harddisk to
temporary save the .java and .class files.


I looked at Beanshell to write the functions in there but I didn't like
it.


Is there a possibility to modify KJC in a way that it can compile a
Class-Object (or at least a byte[]) out of a String directly? How much
effort would that be?


I'm asking for any suggestions or opinions to approach.


Thanks in advance,
Fabian
--
Fabian Wickborn --- wickborn@cs.uni-magdeburg.de
Magdeburger Linux User Group - http://www.mdlug.de
[Personally, I'd configure my system with a ramdisk and put the files there.
-John]



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.