"/>
  简体   繁体   中英

jshell : Exception in thread “main” java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable

I run this /edit command in jshell java-11,When throw the exception.

Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.

I'm using Debian 9.0 operating System.

Exception image

jshell> /编辑

Most likely, the following things come together:

  • you are running jshell in a way that prevents it from starting/raising your preferred editor
  • that preference is determined from looking at some environment variables (see here for names/order)

Thus, a simple solution could be: set the JSHELLEDITOR environment variable to something that doesn't require a X window, like vi for example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM