You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Vicamau

Beginner

  • "Vicamau" started this thread

Posts: 10

Date of registration: Jul 28th 2010

  • Send private message

1

Tuesday, October 25th 2011, 6:05pm

Console application

Hello everyone!
i've a problem whith a console application. I've selected "console application" and developed my application. I've compiled the application like JAR and testet on a XP machine in the console windows and all it's ok. I've copied the JAR file on a linux machine and i recive this messasge:

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:159)
at java.awt.Window.<init>(Window.java:432)
at java.awt.Frame.<init>(Frame.java:403)
at java.awt.Frame.<init>(Frame.java:368)
at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1727)
at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1804)
at javax.swing.JDialog.<init>(JDialog.java:253)
at VBA.ExceptionDialog.<init>(ExceptionDialog.java:34)
at VBA.Interaction.MsgBox(Interaction.java:367)
at Module1.main(Module1.jsrc:140)

It appens on the line in which i do a executeQuery. Maybe for some reason there is some problem on the Select statement, but what sound really strange to me and afraid me it's that the application try to open a Dialog/Message box even if the application it's a console application. Teorically it shuold not do any graphical call.
In my code there aren't MSGBOX call, only java#lang#system.out.println().
I don't want to know why the executeQuery goes in troubles, but i want to know why a console application do a graphical call and how to avoid this.

Please give some help, i need it ASAP.

Thanks a lot

Mauro

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

2

Wednesday, October 26th 2011, 5:00pm

RE: Console application

I don't want to know why the executeQuery goes in troubles, but i want to know why a console application do a graphical call [...]
If you compile your code to a *.jar file the compiler generates a link to a window for exceptions.
For example: If your application gives out an FileNotFoundException, then in the IDE it will be printed out in the textbox at the bottom of the IDE. But if you have compiled it, for the error-outpuit there will be created a Window, where yo can see the error message in it.

Quoted

[...] and how to avoid this.
Don't compile to a jar file. Do it youself. Running your program in the IDE on the fly. Then go over the menu to the temp-path, where the Jaabaco *.class-files are generated and ctreate with this files your jar.
For this you need additional a Jabaco Framework which was only on the fly compiled.
Here are binaries of it:
[ FrameworkTest-rev84-OnTheFly.zip ]

Greatings
theuserbl

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

3

Wednesday, October 26th 2011, 6:21pm

RE: RE: Console application

Ok, before you ask, what I mean with

Then go over the menu to the temp-path, where the Jaabaco *.class-files are generated and ctreate with this files your jar.

I mean: Going over the menu "Project" -> "Open Working Directory".
If you start Jabaco, the directory is at first empty. But if you start your program in the IDE (with [F5] or "Project" -> "Start"), then there are all neded files are generated.

Greatings
theuserbl

This post has been edited 2 times, last edit by "theuserbl" (Oct 26th 2011, 6:51pm)


Vicamau

Beginner

  • "Vicamau" started this thread

Posts: 10

Date of registration: Jul 28th 2010

  • Send private message

4

Friday, October 28th 2011, 9:49am

Thank you so much theuserbl for your sharp hint!!!

Greetings

Vicamau

Rate this thread
WoltLab Burning Board