-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
beta
-
sparc
-
solaris_7
-
Verified
I don't know how widespread this problem is but inspection of code in
share/native/sun/awt/image/BufImgSurfaceData.c shows that when HEADLESS is
defined for a build that a lot of functions/code for drawing to offscreen
images is incorrectly stubbed out. Its hard to see how any image operations
or apis which depend on it - such as printing - could possibly work.
The following basic test fails :-
import java.awt.*;
import java.awt.image.*;
public class ImgDraw {
public static void main(String[] args) {
BufferedImage bim =
new BufferedImage(200, 200, BufferedImage.TYPE_INT_RGB);
Graphics ig = bim.getGraphics();
ig.setColor(Color.black);
ig.drawLine(0,0,200,200);
}
}
% /usr/local/java/jdk1.4/solsparc/bin/java -version
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b48)
Java HotSpot(TM) Client VM (build 1.4beta-B48, mixed mode)
% /usr/local/java/jdk1.4/solsparc/bin/java -Djava.awt.headless=true ImgDraw
Exception in thread "main" java.lang.NullPointerException: SurfaceData is NULL or native ops missing
at sun.java2d.loops.DrawLine.DrawLine(Native Method)
at sun.java2d.pipe.LoopPipe.drawLine(LoopPipe.java:44)
at sun.java2d.pipe.ValidatePipe.drawLine(ValidatePipe.java:30)
at sun.java2d.SunGraphics2D.drawLine(SunGraphics2D.java:1847)
at ImgDraw.main(ImgDraw.java:12)
share/native/sun/awt/image/BufImgSurfaceData.c shows that when HEADLESS is
defined for a build that a lot of functions/code for drawing to offscreen
images is incorrectly stubbed out. Its hard to see how any image operations
or apis which depend on it - such as printing - could possibly work.
The following basic test fails :-
import java.awt.*;
import java.awt.image.*;
public class ImgDraw {
public static void main(String[] args) {
BufferedImage bim =
new BufferedImage(200, 200, BufferedImage.TYPE_INT_RGB);
Graphics ig = bim.getGraphics();
ig.setColor(Color.black);
ig.drawLine(0,0,200,200);
}
}
% /usr/local/java/jdk1.4/solsparc/bin/java -version
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b48)
Java HotSpot(TM) Client VM (build 1.4beta-B48, mixed mode)
% /usr/local/java/jdk1.4/solsparc/bin/java -Djava.awt.headless=true ImgDraw
Exception in thread "main" java.lang.NullPointerException: SurfaceData is NULL or native ops missing
at sun.java2d.loops.DrawLine.DrawLine(Native Method)
at sun.java2d.pipe.LoopPipe.drawLine(LoopPipe.java:44)
at sun.java2d.pipe.ValidatePipe.drawLine(ValidatePipe.java:30)
at sun.java2d.SunGraphics2D.drawLine(SunGraphics2D.java:1847)
at ImgDraw.main(ImgDraw.java:12)
- duplicates
-
JDK-4415115 JComponent.setUI throws NPE in headless mode
-
- Closed
-
- relates to
-
JDK-4365371 Remove Motif dependency for headless Java
-
- Closed
-