问题
I would really like to be able to run our test suite on Xvfb so that swing windows don't keep popping up in the way of my work. Unfortunately I cannot seem to find a way to get the java runtime to use the display specified in the DISPLAY environment variable. I suppose this is because the Mac JDK is hardwired to use the (non-X-based) Mac display.
I can't find any switches for the java command that say to use X either.
Thanks in advance for any help you can give! Matt
回答1:
I don't know if there is a way to get Apple's JDK to use X11, but there is the alternative of using SoyLatte, which is a Mac Java implementation that only works with X11.
回答2:
Try to start your application from within the X11 terminal. This worked for http://mcis.polymtl.ca/makao.html for me on MacOS 10.14.5
来源:https://stackoverflow.com/questions/897054/how-to-display-java-swing-on-x11-when-running-on-mac