主办applet或在谷歌的AppEngine Java编译器? [英] Hosting the Java compiler in an applet or in Google AppEngine?

查看:128
本文介绍了主办applet或在谷歌的AppEngine Java编译器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

搜索网上我发现了javac编译器是用Java编写的,我还偷看在Sun的网站源。源是相当大的,我不能作出任何进展。此外Eclipse项目已经编译器里面嵌入,但谁可以触摸它的源$ C ​​$ C; - )

所以,我想我会扔几个问题的方式:


  1. 能Java编译器在一个Applet被托管?

  2. 能Java编译器提出,要在GAE上工作,从数据存储所产生的类文件动态加载?


解决方案

是,编译器本身其实只是一个普通的Java应用程序(除了它往往会带来自己的本机发射器,但是这不是必需的)。

所以,你可以很容易地applet中或内部GAE运行它。

然而的,不会真正帮助太多,因为如果你想实际运行产生的类,那么你需要使用的ClassLoader 这是不是在(签名)小程序允许并可能在GAE不允许的。实例

Searching the web I've found that the Javac compiler is written in Java, and I also peeked at the source on Sun's site. The source is quite big and I couldn't make any headway on it. Also the Eclipse project has a compiler embedded inside, but who could touch its source code ;-).

So I thought I'd throw a couple of questions your way:

  1. Could the Java compiler be hosted in an Applet?
  2. Could the Java compiler be made to work on GAE, with dynamic loading of the resulting class files from the datastore?

解决方案

Yes, the compiler as such is really just a normal Java application (except that it usually brings its own native launcher, but that's not required).

So you can easily run it within an Applet or inside GAE.

However that won't really help too much, because if you want to actually run the produced classes, then you'd need to play with ClassLoader instances which is not allowed in (unsigned) Applets and probably not allowed in GAE.

这篇关于主办applet或在谷歌的AppEngine Java编译器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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