当前位置: 技术问答>java相关
求助:linux下,通过servlet画图,非得在xwindow下打开tomcat吗?内容:请教各位是怎么做的?
来源: 互联网 发布时间:2015-08-23
本文导语: 我的servlet画图,出不来, 后经过分析,tomcat必须存在于xwindow的shell下面,还不能退出xwindow(否则,tomcat关闭), 大家有什么高招吗? 我想最好是在文本状态下打开tomcat,还有能出来自己画的图。 ...
我的servlet画图,出不来,
后经过分析,tomcat必须存在于xwindow的shell下面,还不能退出xwindow(否则,tomcat关闭),
大家有什么高招吗?
我想最好是在文本状态下打开tomcat,还有能出来自己画的图。
|
it's interesting. gz!
in my point of view, maybe java for linux uses the X gui engine.
but it seems impossible!
you'd better have a test as following:
copy your code into one windows computer, then run it.
in my point of view, maybe java for linux uses the X gui engine.
but it seems impossible!
you'd better have a test as following:
copy your code into one windows computer, then run it.
|
Yes. Java need XWindows environment for Graphics feature.
You can avoid run tomcat in XWindow by one of the following approch:
1. Access the X window on another machine. The DISPLAY variable can point to another make with XWindow running if one if available.
2. Install and run xvfb (X virtual frame buffer). This basically simulate a XWindow without actually running one.
3. Install and config PJA (Pure Java AWT) package. This is a free software and allows Java to add AWT without a XWindow.
4. Use jdk 1.4 which supports headless AWT.
You can avoid run tomcat in XWindow by one of the following approch:
1. Access the X window on another machine. The DISPLAY variable can point to another make with XWindow running if one if available.
2. Install and run xvfb (X virtual frame buffer). This basically simulate a XWindow without actually running one.
3. Install and config PJA (Pure Java AWT) package. This is a free software and allows Java to add AWT without a XWindow.
4. Use jdk 1.4 which supports headless AWT.
|
Yes, you can use Linux.
Actually, xvfb is a util program you can used for similate an X window.
PJA is another one written in Java, you can download it freely.
JDK 1.4 support headless AWT means you can operate graphics without XWindow in JDK1.4.
You have these three options to solve your problem if you really do NOT want run tomcat under XWindows.
Actually, xvfb is a util program you can used for similate an X window.
PJA is another one written in Java, you can download it freely.
JDK 1.4 support headless AWT means you can operate graphics without XWindow in JDK1.4.
You have these three options to solve your problem if you really do NOT want run tomcat under XWindows.