Konloch / Konloch/bytecode-viewer
Running headless
- Dominant language
- Java
- Stars
- 15.6k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
I've been trying to run bytecode viewer on linux alpine but ran into some issues, as it seems to require a graphic environment. Tried both version 2.9.20 and 2.9.22.
My first attempt, direct execution:
`# java -jar bcv.jar -help`
output:
`https://the.bytecode.club - Created by @Konloch - Bytecode Viewer 2.9.20, Fat-Jar: true
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:188)
at the.bytecode.club.bytecodeviewer.api.ExceptionUI.(ExceptionUI.java:47)
at the.bytecode.club.bytecodeviewer.BytecodeViewer.main(BytecodeViewer.java:558)`
Second attempt, using the headless flag:
`# java -jar -Djava.awt.headless=true bcv.jar -help`
output:
`https://the.bytecode.club - Created by @Konloch - Bytecode Viewer 2.9.20, Fat-Jar: true
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:188)
at the.bytecode.club.bytecodeviewer.api.ExceptionUI.(ExceptionUI.java:47)
at the.bytecode.club.bytecodeviewer.BytecodeViewer.main(BytecodeViewer.java:558)`
Any ideas on how to workaround this?
Thanks
Contributor guide
Research direction
Start with BytecodeViewer.main and the ExceptionUI constructor shown in the stack trace, then reproduce `java -jar bcv.jar -help` on Alpine with and without the headless flag. Determine whether headless command-line operation is supported; done should be a documented workaround or a verified behavior that no longer fails unexpectedly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100