jcrodriguez-dis / vpl-jail-system

Execution/jail server for VPL
GNU General Public License v3.0
21 stars 21 forks source link

Error using java-GUI "no X11 DISPLAY set" #76

Open OZimmermann opened 3 months ago

OZimmermann commented 3 months ago

Hi, thank you very much for the great work. The installation under Ubuntu 64-bit went smoothly. The plugin in Moodle also works with Java program. However, when I try to start a program with a graphical user interface, I get the following error:

java.awt.HeadlessException: No X11 DISPLAY variable was set, or no headful library support was found ...

What can I do? Best regards Oliver

jcrodriguez-dis commented 3 months ago

Hello @OZimmermann,

Thank you for the feedback and for reporting this issue. In the Virtual Programming Lab (VPL), the script that determines whether to use a text terminal or a graphical user interface (GUI) checks for specific Java classes in your code. Currently, it automatically switches to GUI mode if it detects any of the following classes in the Java files:

If your Java program uses a different class for the GUI, please let me know so we can address this issue appropriately. As a workaround, you could temporarily add one of the recognized classes in a dummy manner, or modify your program to use one of the supported classes if feasible.

We are planning to introduce manual selection options for GUI mode in the near future to avoid such detection issues.

Best regards, Juan Carlos.

OZimmermann commented 2 months ago

Hi Juan Carlos, thanks for your quick reply. I am now using VPL regularly via Moodle and my students like VPL :-)

I am using a collection of classes imported as a jar, which I have attached for reference. It's mainly the „viualisiere()" method in the "Graph_gewichtet" class in the "graphen" project. The following libraries are used import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.SwingUtilities; import java.awt.; import java.awt.event.;

I attached a screencast and the downloaded zip of VPL.

Kind regards Oliver

https://github.com/jcrodriguez-dis/vpl-jail-system/assets/82403411/25df04a2-c9fb-4e77-8647-7d7d36334753

VPL-Prim.zip