欢迎来到天天文库
浏览记录
ID:16033605
大小:39.00 KB
页数:8页
时间:2018-08-07
《平台截屏x11问题的解决》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、平台截屏x11问题的解决在catalina.sh文件里增加:-Djava.awt.headless=true具体位置:利用jsp,tomcat和jasperReport工具,开发一个报表管理web系统,在windows下测试正常,但在linux下部署却遇到了x11的问题,大概就是如下的错误代码:java.lang.InternalError:Can'tconnecttoX11windowserverusing':0.0'asthevalueoftheDISPLAYvariable.经过多方查找资料,最终发现了网友们提供的几个解
2、决办法,1.对于Java1.4以上,启动java时加上-Djava.awt.headless=true的参数。对于Java1.4以前,下载 xvfb或者其他的虚拟x-window软件,再在Java运行环境里的DISPLAY作相应改变。2.对于Resin,具体的修改办法是,修改httpd.sh文件,把其中的args=行修改为args=- Djava.awt.headless=true。3.对于tomcat,在catalina.sh中插入-Djava.awt.headless=true 具体位置如下所示,#!/bin/sh#----
3、-------------------------------------------------------------------------#Start/StopScriptfortheCATALINAServer##EnvironmentVariablePrequisites## CATALINA_HOME MaypointatyourCatalina"build"directory.## CATALINA_BASE (Optional)Basedirectoryforresolvingdynamicportio
4、ns# ofaCatalinainstallation. Ifnotpresent,resolvesto# thesamedirectorythatCATALINA_HOMEpointsto.## CATALINA_OPTS (Optional)Javaruntimeoptionsusedwhenthe"start",# "stop",or"run"commandisexecuted.## CATALINA_TMPDIR(
5、Optional)Directorypathlocationoftemporarydirectory# theJVMshoulduse(java.io.tmpdir). Defaultsto# $CATALINA_BASE/temp.## JAVA_HOME MustpointatyourJavaDevelopmentKitinstallation.## JAVA_OPTS (Optional)Javaruntimeoptionsused
6、whenthe"start",# "stop",or"run"commandisexecuted.## JPDA_TRANSPORT (Optional)JPDAtransportusedwhenthe"jpdastart"# commandisexecuted.Thedefaultis"dt_socket".## JPDA_ADDRESS (Optional)Javaruntimeoptionsusedwhenthe"jpdastart"#
7、 commandisexecuted.Thedefaultis8000.## JSSE_HOME (Optional)MaypointatyourJavaSecureSocketsExtension# (JSSE)installation,whoseJARfileswillbeaddedtothe# systemclasspathusedtostartTomcat.## CATALINA_PID (Optional)Pat
8、hofthefilewhichshouldcontainsthepid# ofcatalinastartupjavaprocess,whenstart(fork)isused##$Id:catalina.sh,v1.13.2.1
此文档下载收益归作者所有