
Signature
Jo Vermeulen
Student Computer Science at the tUL
email: jo@lumumba.luc.ac.be
www: http://lumumba.luc.ac.be/jo
> Hello,
>
[quoted text clipped - 4 lines]
> real programming languages (such as C#, VB.NET, ...). This is done using
> the System.CodeDom.Compiler namespace, if I recall correctly.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fSystemCodeDomCompiler.asp
> Is such a feature available for any version of Java (perhaps JDK 1.5 beta
> 1)? Ofcourse it would then only be able to compile Java code.
>
> Thanks in advance!
If you want scriptable applications, you don't need to compile code perse.
You can use one of the available scripting languages for the JVM, like
Beanshell: http://beanshell.org/
Or you could use the BSF (Bean Scripting Framework), which allows you to
plugin the scripting language of your choice.
http://jakarta.apache.org/bsf/
If you really need to compile a regular class, use the regular java
compiler:
Place tools.jar on your classpath and invoke
public int com.sun.tools.javac.Main.compile(String[] args);
or
public int com.sun.tools.javac.Main.compile(String[] args,
PrintWriter out);

Signature
Kind regards,
Christophe Vanfleteren
Jo Vermeulen - 25 May 2004 10:10 GMT
Op Tue, 25 May 2004 08:47:16 +0000, schreef Christophe Vanfleteren:
<snip />
> If you want scriptable applications, you don't need to compile code perse.
It isn't about the compiling per se, but I wanted to script using a full
grown language, which is probably easier for programmers than to learn a
new scripting language.
> You can use one of the available scripting languages for the JVM, like
> Beanshell: http://beanshell.org/
Looks good, and seems to do what I want it to.
> Or you could use the BSF (Bean Scripting Framework), which allows you to
> plugin the scripting language of your choice.
[quoted text clipped - 9 lines]
> public int com.sun.tools.javac.Main.compile(String[] args,
> PrintWriter out);
Didn't know that. Is tools.jar included in the standard JDK?
Thanks for your quick reply!
Kind regards,

Signature
Jo Vermeulen
Student Computer Science at the tUL
email: jo@lumumba.luc.ac.be
www: http://lumumba.luc.ac.be/jo
Thomas Schodt - 25 May 2004 10:47 GMT
> Didn't know that. Is tools.jar included in the standard JDK?
Erm, don't you have a standard J2SDK installed?
Check what files exist under lib...
Jo Vermeulen - 25 May 2004 12:02 GMT
Op Tue, 25 May 2004 10:47:14 +0100, schreef Thomas Schodt:
>> Didn't know that. Is tools.jar included in the standard JDK?
>
> Erm, don't you have a standard J2SDK installed?
>
> Check what files exist under lib...
Wasn't at my PC this morning :-)
Checked it now, and indeed, it's there:
/opt/sun-jdk-1.5.0_beta1/lib/tools.jar
Kind regards,

Signature
Jo Vermeulen
Student Computer Science at the tUL
email: jo@lumumba.luc.ac.be
www: http://lumumba.luc.ac.be/jo