在运行时生成,编译和使用Java代码? [英] Generating, compiling and using Java code at run time?

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

问题描述

我有一个场景,当我的应用程序运行时,我必须生成Java代码。

I have a scenario where I have to generate Java code when my application is running.

可以从我的应用程序(作为单独的应用程序)编译和运行代码。

Can compile and run than code from my application( as a separate application).

可以编译,然后从同一个应用程序使用它。不想任何可能性

Is it possible to compile and then use it from the same application. Cant think of any possibility

推荐答案

查看使用javax.tools 创建动态应用程序。 第二次我今天提到这个问题 - 我发誓我不为他们工作。

Check out Create dynamic applications with javax.tools. Second time I've referenced this today--I swear I don't work for them.

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

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