Exception in thread "main" java.awt.HeadlessException while running GenomeAnalysisTk-4_1.jar

saniyaalekar94saniyaalekar94 NYMember
edited June 2017 in Ask the GATK team

Running the following command using the latest GATK4 jar file (GenomeAnalysisTk-4_1.jar):
java -jar GenomeAnalysisTk-4_1.jar PrintReads -I /home/exampleBAM.bam -O outputBAM.bam

At first I had this error:
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
at java.awt.Window.(Window.java:536)
at java.awt.Frame.(Frame.java:420)
at java.awt.Frame.(Frame.java:385)
at javax.swing.JFrame.(JFrame.java:189)
at org.broadinstitute.hellbender.Main.displaySnpy(Main.java:413)
at org.broadinstitute.hellbender.Main.mainEntry(Main.java:146)
at org.broadinstitute.hellbender.Main.main(Main.java:207)

After trying to set the DISPLAY variable to various values like:
MyIPAddress:0.0 OR
localhost:0.0 OR
:0 OR
:0.0
I get the following error for each value:

Exception in thread "main" java.awt.AWTError: 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.access$200(X11GraphicsEnvironment.java:65)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
at sun.awt.X11.XToolkit.(XToolkit.java:126)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.Toolkit$2.run(Toolkit.java:860)
at java.awt.Toolkit$2.run(Toolkit.java:855)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
at java.awt.Component.getToolkitImpl(Component.java:1226)
at java.awt.Component.getToolkit(Component.java:1214)
at java.awt.Component.checkImage(Component.java:3749)
at java.awt.ImageMediaEntry.getStatus(MediaTracker.java:951)
at java.awt.MediaTracker.statusID(MediaTracker.java:715)
at java.awt.MediaTracker.waitForID(MediaTracker.java:663)
at javax.swing.ImageIcon.loadImage(ImageIcon.java:314)
at javax.swing.ImageIcon.(ImageIcon.java:244)
at org.broadinstitute.hellbender.Main.displaySnpy(Main.java:412)
at org.broadinstitute.hellbender.Main.mainEntry(Main.java:146)
at org.broadinstitute.hellbender.Main.main(Main.java:207)

After including -Djava.awt.headless=true in the command, I get the following error:
Exception in thread "main" java.awt.HeadlessException
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
at java.awt.Window.(Window.java:536)
at java.awt.Frame.(Frame.java:420)
at java.awt.Frame.(Frame.java:385)
at javax.swing.JFrame.(JFrame.java:189)
at org.broadinstitute.hellbender.Main.displaySnpy(Main.java:413)
at org.broadinstitute.hellbender.Main.mainEntry(Main.java:146)
at org.broadinstitute.hellbender.Main.main(Main.java:207)

My java version is:
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

Tagged:

Best Answer

Answers

Sign In or Register to comment.