使用Java文件中的代码编译Java文件 [英] Compiling Java file with code from within a Java file

查看:140
本文介绍了使用Java文件中的代码编译Java文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在创建一个个人(也许是公共的)java终端。我想创建一个命令,将创建+编译一个Java文件执行,但我不太确定如何实际这样做。是否可以?

I'm currently creating a personal (maybe public) java terminal. I want to create a command that will create + compile a Java file on execution, except I'm not too sure on how to actually do this. Is it possible? Or am I just dreaming?

推荐答案


编译Java文件

compile a Java file

请参阅 STBC 。它使用 JavaCompiler 以编译文本区域中的代码。

See the STBC. It uses the JavaCompiler to compile the code in the text area.

这篇关于使用Java文件中的代码编译Java文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆