windows 下编译的程序在unix下运行出错

[复制链接]
查看11 | 回复3 | 2005-4-12 14:04:39 | 显示全部楼层 |阅读模式
我在windows下编译的程序在windows的jdk1.4中运行完全正确(画图程序),但是拿到sun的solaris环境下运行(jdk1.4.2),出现如下错误,请高手指点:
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window
server using ':0.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:1
34)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvi
ronment.java:62)
at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1041)
at java.awt.image.BufferedImage.getGraphics(BufferedImage.java:1031)
at com.egi.graphics.chart.ChartUtils.getBufferedChartImage(ChartUtils.ja
va:115)
at com.egi.graphics.chart.AutoChart.graphics(AutoChart.java:44)
at com.egi.graphics.chart.executeChart.main(executeChart.java:199)
回复

使用道具 举报

千问 | 2005-4-12 14:04:39 | 显示全部楼层
会不会是风格的问题?
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvi
ronment.java:62)
回复

使用道具 举报

千问 | 2005-4-12 14:04:39 | 显示全部楼层
有两种可能的原因:
1、权限不够,你需要以root权限启动
2、没有正确设置DISPLAY
csh下:
setenv DISPLAY 127.0.0.1:0.0
bsh下:
export DISPLAY=127.0.0.1:0.0
回复

使用道具 举报

千问 | 2005-4-12 14:04:39 | 显示全部楼层
最初由 robbin 发布
[B]有两种可能的原因:
1、权限不够,你需要以root权限启动
2、没有正确设置DISPLAY
csh下:
setenv DISPLAY 127.0.0.1:0.0
bsh下:
export DISPLAY=127.0.0.1:0.0 [/B]

默认的display是什么,必须设置吗?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行