Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Execute swt program success inside Eclipse, but failure execute it as a standalone jar file

This looks like a bad thing to be doing:

Font f = new Font(getShell().getDisplay(), font_data);
lblName.setFont(f);
f.dispose();

Why are you disposing a font just after you set it? That’s bound to cause problems.

I suggest that you try and find the smallest possible thing that causes the problem and reply back to the list, but I’d suggest that you actively disposing content as it’s being used is going to cause problems.

Alex

On 28 Sep 2014, at 15:48, Gulfstrean Wang <gulfstream.wang@xxxxxxxxx> wrote:

> Dear friends,
> 
> After I upgrade my Eclipse to LUNA, I got a strange error. I could execute a SWT program success inside the Eclipse, but I could not do it as a standalone jar file.
> 
> The attachment file is a simple java example file (CTestSWT.java). It can be run success inside the Eclipse, and a window can be display as attachment file (window.png), and the text output as blow.
> 
> Point {75, 14}   200
> Point {82, 16}   200
> Point {86, 17}   200
> Point {95, 20}   200
> Point {104, 21}   200
> Point {110, 23}   200
> Point {129, 25}   200
> Point {135, 26}   200
> Point {139, 28}   200
> Point {154, 30}   200
> Point {160, 31}   200
> Point {168, 33}   200
> Point {179, 35}   200
> Point {189, 36}   200
> Point {195, 38}   200
> Point {208, 40}   200
> 
> 
> After I export a jar file from the Eclipse, I got a jar file (CTestSWT.jar). I try to execute it standalone. the command line I used is
> "java -classpath testswt.jar:swt.jar:org.eclipse.core.commands.jar:org.eclipse.core.runtime.jar:org.eclipse.equinox.common.jar:org.eclipse.jface.jar: testswt/CTestSWT"
> 
> Although this java code execute success inside Eclipse, but it failure now. The window could be display, and I got an endless loop according to the text output. Besides it, two error messages were print out. The text output is showed as blew.
> 
> wgl@athena:~/home/SoftDev/dev/CurveSpirit/project/bin$ java -classpath testswt.jar:swt.jar:org.eclipse.core.commands.jar:org.eclipse.core.runtime.jar:org.eclipse.equinox.common.jar:org.eclipse.jface.jar: testswt/CTestSWT
> 
> (Test SWT:20502): Gtk-CRITICAL **: gtk_hsv_to_rgb: assertion 's >= 0.0 && s <= 1.0' failed
> 
> (Test SWT:20502): Gtk-CRITICAL **: gtk_hsv_to_rgb: assertion 's >= 0.0 && s <= 1.0' failed
> Point {75, 14}   200
> Point {75, 16}   200
> Point {75, 17}   200
> Point {75, 20}   200
> Point {75, 21}   200
> Point {75, 23}   200
> Point {75, 25}   200
> Point {75, 26}   200
> Point {75, 28}   200
> Point {75, 30}   200
> Point {75, 31}   200
> Point {75, 33}   200
> Point {75, 35}   200
> Point {75, 36}   200
> Point {75, 38}   200
> Point {75, 40}   200
> Point {75, 41}   200
> Point {75, 43}   200
> Point {75, 46}   200
> Point {75, 48}   200
> Point {75, 49}   200
> Point {75, 51}   200
> Point {75, 53}   200
> Point {75, 54}   200
> Point {75, 56}   200
> Point {75, 58}   200
> Point {75, 59}   200
> Point {75, 61}   200
> Point {75, 63}   200
> Point {75, 64}   200
> Point {75, 67}   200
> Point {75, 68}   200
> Point {75, 69}   200
> Point {75, 72}   200
> Point {75, 73}   200
> Point {75, 74}   200
> Point {75, 78}   200
> Point {75, 79}   200
> Point {75, 80}   200
> ..........
> ..........
> 
> 
> My operate system is Debian testing, the jdk is OpenJDK 7u65-2.5.2-4 which is install from Debian, and the Eclipse is LUNA. The phenomenon is very strange, and it was not occur in older version of Eclipse.
> 
> What is wrong? Would you please help me? Thank you very much!
> 
> 
> With best regards
> 
> Gufstream
> 
> 
> <CTestSWT.java><window.png>_______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top