Jump to content











Photo
- - - - -

WinBuilder Error (Linux): "No X11 DISPLAY variable was set, but this program performed an operation which requires it."

winbuilder error linux java x11 winbuilder 2013

  • Please log in to reply
8 replies to this topic

#1 MacGyverBass

MacGyverBass
  • Members
  • 3 posts
  •  
    United States

Posted 11 December 2013 - 08:08 AM

First let me say that I love WinBuilder and I've used several of the older versions and I appreciate everything the community has done to put this project together. ... And I've had issues, but either on my own or searching the forums, I was able to resolve every issues I've had... until today.  (Assuming it *can* be fixed.)

 

Now that WinBuilder 2013 is java-based and can run on Linux, I decided to switch my development platform over to my Linux server.  Problem is, I cannot get past 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:207)
        at java.awt.Window.<init>(Window.java:535)
        at java.awt.Frame.<init>(Frame.java:420)
        at java.awt.Frame.<init>(Frame.java:385)
        at javax.swing.JFrame.<init>(JFrame.java:180)
        at build.GUI.<init>(GUI.java:50)
        at build.Core.main(Core.java:91)
 
Now, I know enough about Linux and such that this error is likely due to this being a headless system that isn't running X and has no Desktop/GUI.... thus the error.  But from the screenshots/images of the new WinBuilder 2013, I thought I would be able to run this without X.
 
My system is a KVM Virtual Machine running Tiny Core Linux 4.7.3 and I compiled/installed Java JRE 7 update 45 (latest at the time of creating this post).  The system has 1GB of RAM and WinBuilder has a dedicated 4GB filesystem (and is barely using any space at all right now).  I can give more specifications as required, but I doubt even this is necessary.
 
Am I to assume that WinBuilder 2013 requires X to display or can it be forced to run completely in a terminal?
Because I am aiming to accomplish several things with this new version: First, I want to run it on my Linux server without installing X. Also, I want to be able to automate the creation of an ISO using WinBuilder 2013 via a bash script or such. And I want to run it on my server, because it has RAID'd hard-drives, a very fast CPU, and tons of potential RAM (I only allocated 1GB for now).  But basically, I'm trying to off-load a lot of CPU/RAM/Time intensive programs off my laptop and onto my server, thus freeing up my laptop for personal stuff.
 
Also, I believe this is the first time I've posted here, because I've normally been able to find the information I've needed, but this time I couldn't find any posts referring to X or X11 errors with the new version.  (And please bear with me if I've posted into the wrong wrong area of the Forum, I wasn't sure exactly where to put this.)
 
Thanks in advance,
Steven


#2 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 11 December 2013 - 09:30 AM

Hi Steven,

 

Wow, tough question. :)

 

I'm running Linux on full time as well. The error you mention is not surprising, this release of WinBuilder was done with desktop machines in mind (regardless of OSX, Windows or Linux). There was an assumption that an X server (or some sort of window management) is available by default on Linux desktop.

 

The good news is that we can certainly allow wb to run on the conditions you mention, the only matter is testing on a system like you describe.

 

There is a test that can be done right now.

 

Run winbuilder from your normal Linux machine to create a boot disk. Then, copy the whole winbuilder folder over to the headless linux on your server. From the server, try running:

java -jar winbuilder.exe build

Command line support is not complete, but if you copy a folder with a winbuilder install that was already working then you might be able to get away just by calling the "build" command.

 

Before I forget, I'd recommend testing this with the same folder paths on both machines, such as /home/steven/winbuilder to prevent the need of manually change the source and project paths. If you do need to edit them, look inside winbuilder.xml and change them as needed.

 

Good luck! :)



#3 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 11 December 2013 - 09:54 AM

Also the CONFIG command will not work, because it also leads to a display of a HTML formular.

 

Here you can also manually edit the according *.xml files.

Factory settings are in the project folder, inside the component folders and inside the plugin folders.

 

Actually used are copies of these *.xml files which reside in the downloads/cache directory.

WinBuilder uses the copies in order not to loose individual settings when the user downloads anything new.

 

Peter



#4 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 11 December 2013 - 10:00 AM

Also the CONFIG command will not work, because it also leads to a display of a HTML formular.

 

 

No support for changing the configuration from the command line interface, but it is possible to use the web browser interface for remotely configuring wb using something like

java -jar winbuilder.exe web start

I've tested. Right now it just starts the web server and exits. Perhaps something to keep in mind over the next iteration.

 

:cheers:



#5 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 11 December 2013 - 10:02 AM


java -jar winbuilder.exe build

Command line support is not complete, but if you copy a folder with a winbuilder install that was already working then you might be able to get away just by calling the "build" command.

 

Are you sure?

 

In a test on my XP system the WinBuilder GUI appears when I type the above command in a console window.

 

I think that some changes have to be made ...

 

Peter :cheers:



#6 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 11 December 2013 - 10:09 AM

I think that some changes have to be made ...

 

Yes, you're right and might not work. Originally this should work without calling the GUI. Looking at the code I note that this was part of the code that was re-arranged at the time when trying to solve the question of locked files after extracting the ISO. 

 

Things to place on the todo list. :)



#7 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 11 December 2013 - 11:29 AM

Looking at the code I note that this was part of the code that was re-arranged at the time when trying to solve the question of locked files after extracting the ISO. 

 

Oops! :worship:

 

The glitch was introduced with fixing the UPGRADE command.

 

On my development copy I already fixed!

 

Now it works as intended! :clap:

 

Peter



#8 MacGyverBass

MacGyverBass
  • Members
  • 3 posts
  •  
    United States

Posted 12 December 2013 - 08:00 AM

Wow, I hadn't expected a reply, much less several replies so fast...


I tried the suggestions above and ran into the same issue... to verify it wasn't an issue with my OS, I also ran this on a Debian server (also not running X) and had this similar 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:207)
        at java.awt.Window.<init>(Window.java:535)
        at java.awt.Frame.<init>(Frame.java:420)
        at java.awt.Frame.<init>(Frame.java:385)
        at javax.swing.JFrame.<init>(JFrame.java:174)
        at build.GUI.<init>(GUI.java:50)
        at build.Core.main(Core.java:91)

I tried several different idea in addition to the ones suggested:

java -jar winbuilder.exe

java -jar winbuilder.exe build

java -jar winbuilder.exe nogui  (i got the idea from my Minecraft server)

java -jar winbuilder.exe auto
java -jar winbuilder.exe web
java -jar winbuilder.exe web start
java -jar winbuilder.jar    (after renaming, of course)
 
Every time, it seems to fail immediately, without hesitation.
 
I also got interesting results when I tried to lie to it about X running by defining the DISPLAY variable manually:
DISPLAY=:0.0 java -jar winbuilder.exe
Exception in thread "main" java.lang.InternalError: 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:110)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:190)
        at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:102)
        at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:81)
        at java.awt.Window.initGC(Window.java:467)
        at java.awt.Window.init(Window.java:487)
        at java.awt.Window.<init>(Window.java:536)
        at java.awt.Frame.<init>(Frame.java:420)
        at java.awt.Frame.<init>(Frame.java:385)
        at javax.swing.JFrame.<init>(JFrame.java:174)
        at build.GUI.<init>(GUI.java:50)
        at build.Core.main(Core.java:91)

With those results, I'm just going to guess that the current version requires X somewhere in the code and I'll have to wait for a future release to run this headless.  Especially since I was reading up on the web feature (I hadn't even noticed that when I first downloaded it), running headless on a powerful server would be great.

 

 
Thanks for the quick replies though... I'll keep checking back for updates.


#9 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 12 December 2013 - 02:43 PM

Thanks for the feedback. This confirms that only on a next release we can have this sorted.

 

Before releasing, I will contact you by email to see if we can make it run under your conditions. Not so easy to replicate on our side and with your feedback there is a bigger motivation (real user-case) to get things fixed.

 

:)







Also tagged with one or more of these keywords: winbuilder, error, linux, java, x11, winbuilder 2013

2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users