在服务器上设置Java编译器? [英] Set up Java compiler on server?

查看:493
本文介绍了在服务器上设置Java编译器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在服务器上设置Java编译器来编译上传的脚本?我的用例是用户可以为程序上传自定义java脚本/插件。然后服务器将编译这些脚本,并将.jar放在一个文件夹中。然后应用程序(用户正在开发的应用程序)将查询服务器以查找可用的脚本/插件以进行下载和使用。这可能吗?如果是,如何?



*编辑:
我无法在我的服务器上安装JDK,因为它是一个共享服务器。有没有任何方式来编译java没有安装任何东西(一个愚蠢的问题,我知道,但不伤害要问..)?我有php ....不是那将帮助任何。

解决方案



Java上的动态代码执行< a>



简而言之,Java Compiler API允许您从包含源代码的Java字符串创建编译的Java类文件。


Is there a way to set up the Java compiler on a server to compile uploaded scripts? My use case is where users can upload custom java scripts/plugins for a program. Then the server would compile those scripts, and place the .jar in a folder. Then the application (the one users are developing for) would query the server for available scripts/plugins to download and use. Is this possible? If so, how?

*EDIT: I cannot install the JDK on my server, since it is a shared server. Is there any way to compile java without installing anything (a stupid question i know, but doesn't hurt to ask..)? I have php....not that that would help any.

解决方案

I answered a similar question here:

Dynamic code execution on Java

In short, the Java Compiler API allows you to create compiled Java class files from Java Strings that contain source code.

这篇关于在服务器上设置Java编译器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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