GWT + ProcessBuilder

廉价感情. 提交于 2020-01-22 02:41:06

问题


Is it possible to use ProcessBuilder with GWT? When I declare an instance of a new ProcessBuilder, I get:

java.lang.ProcessBuilder is not supported by Google App Engine's Java runtime environment

回答1:


Your question is about GWT supporting ProcessBuilder, but the error you get is from Google App Engine and not GWT related.

If you are using ProcessBuilder from a GWT RPC method you shouldn't have any problems. However, you are using Google App Engine as your application server. Google App Engine doesn't support ProcessBuilder, and a bunch of other things are not supported by GAE.

Check out the Will it play in Google App Engine? as a reference to know if your particular feature is supported in GAE.

It's important to note that ProcessBuilder is not supported by Google App Engine. GWT uses regular Java in its RPCs so ProcessBuilder can be used there.




回答2:


If you are not building your project for deployment on Google App Engine, turn off GAE in the Google plugin for eclipse.

The google eclipse plugin is for GWT and GAE. At project properties -> Google, you could click on/off to enable/disable use of GAE or GWT.

If you are building only for GWT only and not for deployment on Google's web hosting service, turn off the GAE feature.




回答3:


The error message is pretty clear that Google App Engine doesn't support this.

Trying to find a workaround for using ProcessBuilder is a bad idea, why do you want to actively circumvent your host's policies? Sounds like a way for the host to not want to host you anymore.

It's possible that there are better or other ideas on how to accomplish whatever you need ProcessBuilder for, you could probably post about them here to get some suggestions.



来源:https://stackoverflow.com/questions/2413722/gwt-processbuilder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!