Running a Graphical Application without photon


I have a problem when I run a graphical application in QNX. My application runs with java virtual machine j9 and uses SWT. I can launch the program in a Photon console and the application works fine.

I uses the commands:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/qde/eclipse/plugins/org.eclipse.swt.photon_2.0.2/os/qnx/x86
export CLASSPATH=$CLASSPATH:/usr/qde/eclipse/plugins/org.eclipse.swt.photon_2.0.2/ws/photon/swt.jar:./
export PATH=$PATH:/usr/qde/eclipse/jre/bin/j9
export CLASSPATH=$CLASSPATH:/myProgram/bin/vt.jar:/myProgram/bin/swt.jar
j9 -Djava.library.path=/myProgram/lib MyProgram

But when I want to run it without Photon (in text mode) the program crashes. Java virtual machine shows this trace.

Thread main (priority 5) (LOCATION OF ERROR)
0000 org/eclipse/swt/internal/photon/os.PgSetDrawBufferSize(I)I
0008 org/eclipse/swt/widgets/Display.createDisplay(Lorg/eclipse/swt/graphics/DeviceData;)V
0011 org/eclipse/swt/widgets/Display.create(Lorg/eclipse/swt/graphics/DeviceData;)V
0028 org/eclipse/swt/widgets/Device.(Lorg/eclipse/swt/graphics/DeviceData;)V
0002 org/eclipse/swt/widgets/Display.(Lorg/eclipse/swt/graphics/DeviceData;)V

How can I run a graphical application whithout photon?


If the program makes calls to Photon, and it looks like it does, you’re going to need to run Photon, I don’t think there is any way around that. It looks like SWT is trying to open the display but failing, for obvious reasons, you could try changing your app to not use SWT at all, a widget toolkit is not much use without a display after all…

SWT uses Photon, you can’t just SWT without Photon.

If it is necesary run Photon, what is the minimal configuration of Photon that we need to use? What things can will be deleted?

There are docs in the 6.3.0 help for embedding Photon. You can also look at the eQip project for some pointers.