Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » windows to linux - swt failure...
windows to linux - swt failure... [message #63898] Sun, 03 October 2004 06:02 Go to next message
Eclipse UserFriend
Originally posted by: spam.scientifik.com

I created a Java project while on a windows box, using the Visual Editor
to create a front-end to my classes. All of this was contained in a
single eclipse JDT project.

I wanted to see how feasable it'd be to take a project from one platform
to another (i.e. windows to linux)...and I'm coming up w/ problems.

My impression was; I could simply change the paths to any external jars
I'm using and pass the correct linux/gtk VM arguement, for example,
"C:\etc\etc" to "/etc/etc/etc", and it would run just as it had on Windows.

So far - no luck, here's eclipse console output I'm getting:

(<unknown>:6516): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to
allocate widget with width 8 and height -1

(<unknown>:6516): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to
allocate widget with width 52 and height -1
Exception in thread "main" java.lang.NullPointerException
at snap.SnapMain.createGroup1(SnapMain.java:61)
at snap.SnapMain.createSShell(SnapMain.java:125)
at snap.SnapMain.main(SnapMain.java:109)

First of all, on the warnings, I'm not using -1 as a parameter for any of
the widgets...I've been over the code and I'm positive of that.

Here's the code where it's apparently failing:

private void createGroup1() {
group1.setLocation(new org.eclipse.swt.graphics.Point(302,40));
group1 = new Group(sShell, SWT.NONE);
group1.setText("Trials");
group1.setSize(new org.eclipse.swt.graphics.Point(200,216));
}

However, everything seems to be in place...no warnings or errors,
everything compiles fine.

I can run other SWT apps on linux but those were built on linux (not that
there should be any difference!)

Also, like I said, this runs on Windows flawlessly.

My classpath is fine, other projects are working in this directory.

Just in case, here is the string I'm passing to the VM in the eclipse
"Run" dialog:

-Djava.library.path=/opt/eclipse-3.1M2/plugins/org.eclipse.s wt.gtk_3.1.0/os/linux/x86

I'm sure this is correct - it is working for the aforementioned
linux-built SWT projects and I've verified more than once that this is the
correct path...

Any ideas?

Thanks!
Re: windows to linux - swt failure... [message #63972 is a reply to message #63898] Sun, 03 October 2004 13:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: myersj.nospam.gmail.com

zambizzi wrote:
> I created a Java project while on a windows box, using the Visual Editor
> to create a front-end to my classes. All of this was contained in a
> single eclipse JDT project.
>
> I wanted to see how feasable it'd be to take a project from one platform
> to another (i.e. windows to linux)...and I'm coming up w/ problems.
>
> My impression was; I could simply change the paths to any external jars
> I'm using and pass the correct linux/gtk VM arguement, for example,
> "C:\etc\etc" to "/etc/etc/etc", and it would run just as it had on Windows.
>
> So far - no luck, here's eclipse console output I'm getting:
>
> (<unknown>:6516): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to
> allocate widget with width 8 and height -1
>
> (<unknown>:6516): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to
> allocate widget with width 52 and height -1
> Exception in thread "main" java.lang.NullPointerException
> at snap.SnapMain.createGroup1(SnapMain.java:61)
> at snap.SnapMain.createSShell(SnapMain.java:125)
> at snap.SnapMain.main(SnapMain.java:109)
>
> First of all, on the warnings, I'm not using -1 as a parameter for any of
> the widgets...I've been over the code and I'm positive of that.
>
> Here's the code where it's apparently failing:
>
> private void createGroup1() {
> group1.setLocation(new org.eclipse.swt.graphics.Point(302,40));
> group1 = new Group(sShell, SWT.NONE);
> group1.setText("Trials");
> group1.setSize(new org.eclipse.swt.graphics.Point(200,216));
> }
>
> However, everything seems to be in place...no warnings or errors,
> everything compiles fine.
>
> I can run other SWT apps on linux but those were built on linux (not that
> there should be any difference!)
>
> Also, like I said, this runs on Windows flawlessly.
>
> My classpath is fine, other projects are working in this directory.
>
> Just in case, here is the string I'm passing to the VM in the eclipse
> "Run" dialog:
>
> -Djava.library.path=/opt/eclipse-3.1M2/plugins/org.eclipse.s wt.gtk_3.1.0/os/linux/x86
>
> I'm sure this is correct - it is working for the aforementioned
> linux-built SWT projects and I've verified more than once that this is the
> correct path...
>
> Any ideas?
>
> Thanks!
>

No clue how this could have been generated but in your code:
private void createGroup1() {
group1.setLocation(new org.eclipse.swt.graphics.Point(302,40));
group1 = new Group(sShell, SWT.NONE);
group1.setText("Trials");
group1.setSize(new org.eclipse.swt.graphics.Point(200,216));
}

The setLocation call (first line) is being made before the Group is
instantiated (second line). This is what's causing the NPE, as group1
is equal to null when setLocation is called on it. Also very strange
that this code runs OK on Windows. Move the first line below the second
and it should work.

- Jeff
Re: windows to linux - swt failure... [message #64044 is a reply to message #63972] Mon, 04 October 2004 07:09 Go to previous message
Eclipse UserFriend
Originally posted by: spam.scientifik.com

Jeff Myers wrote:

> zambizzi wrote:
> > I created a Java project while on a windows box, using the Visual Editor
> > to create a front-end to my classes. All of this was contained in a
> > single eclipse JDT project.
> >
> > I wanted to see how feasable it'd be to take a project from one platform
> > to another (i.e. windows to linux)...and I'm coming up w/ problems.
> >
> > My impression was; I could simply change the paths to any external jars
> > I'm using and pass the correct linux/gtk VM arguement, for example,
> > "C:etcetc" to "/etc/etc/etc", and it would run just as it had on Windows.
> >
> > So far - no luck, here's eclipse console output I'm getting:
> >
> > (<unknown>:6516): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to
> > allocate widget with width 8 and height -1
> >
> > (<unknown>:6516): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to
> > allocate widget with width 52 and height -1
> > Exception in thread "main" java.lang.NullPointerException
> > at snap.SnapMain.createGroup1(SnapMain.java:61)
> > at snap.SnapMain.createSShell(SnapMain.java:125)
> > at snap.SnapMain.main(SnapMain.java:109)
> >
> > First of all, on the warnings, I'm not using -1 as a parameter for any of
> > the widgets...I've been over the code and I'm positive of that.
> >
> > Here's the code where it's apparently failing:
> >
> > private void createGroup1() {
> > group1.setLocation(new org.eclipse.swt.graphics.Point(302,40));
> > group1 = new Group(sShell, SWT.NONE);
> > group1.setText("Trials");
> > group1.setSize(new org.eclipse.swt.graphics.Point(200,216));
> > }
> >
> > However, everything seems to be in place...no warnings or errors,
> > everything compiles fine.
> >
> > I can run other SWT apps on linux but those were built on linux (not that
> > there should be any difference!)
> >
> > Also, like I said, this runs on Windows flawlessly.
> >
> > My classpath is fine, other projects are working in this directory.
> >
> > Just in case, here is the string I'm passing to the VM in the eclipse
> > "Run" dialog:
> >
> >
-Djava.library.path=/opt/eclipse-3.1M2/plugins/org.eclipse.s wt.gtk_3.1.0/os/linux/x86
> >
> > I'm sure this is correct - it is working for the aforementioned
> > linux-built SWT projects and I've verified more than once that this is the
> > correct path...
> >
> > Any ideas?
> >
> > Thanks!
> >

> No clue how this could have been generated but in your code:
> private void createGroup1() {
> group1.setLocation(new org.eclipse.swt.graphics.Point(302,40));
> group1 = new Group(sShell, SWT.NONE);
> group1.setText("Trials");
> group1.setSize(new org.eclipse.swt.graphics.Point(200,216));
> }

> The setLocation call (first line) is being made before the Group is
> instantiated (second line). This is what's causing the NPE, as group1
> is equal to null when setLocation is called on it. Also very strange
> that this code runs OK on Windows. Move the first line below the second
> and it should work.

> - Jeff

I don't know *how* I missed that...

Very strange, I'm looking at it right now, it does in fact run on windows
like that!

VE created it that way, maybe a bug?

Thanks!
Re: windows to linux - swt failure... [message #600479 is a reply to message #63898] Sun, 03 October 2004 13:13 Go to previous message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 396
Registered: July 2009
Senior Member
zambizzi wrote:
> I created a Java project while on a windows box, using the Visual Editor
> to create a front-end to my classes. All of this was contained in a
> single eclipse JDT project.
>
> I wanted to see how feasable it'd be to take a project from one platform
> to another (i.e. windows to linux)...and I'm coming up w/ problems.
>
> My impression was; I could simply change the paths to any external jars
> I'm using and pass the correct linux/gtk VM arguement, for example,
> "C:\etc\etc" to "/etc/etc/etc", and it would run just as it had on Windows.
>
> So far - no luck, here's eclipse console output I'm getting:
>
> (<unknown>:6516): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to
> allocate widget with width 8 and height -1
>
> (<unknown>:6516): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to
> allocate widget with width 52 and height -1
> Exception in thread "main" java.lang.NullPointerException
> at snap.SnapMain.createGroup1(SnapMain.java:61)
> at snap.SnapMain.createSShell(SnapMain.java:125)
> at snap.SnapMain.main(SnapMain.java:109)
>
> First of all, on the warnings, I'm not using -1 as a parameter for any of
> the widgets...I've been over the code and I'm positive of that.
>
> Here's the code where it's apparently failing:
>
> private void createGroup1() {
> group1.setLocation(new org.eclipse.swt.graphics.Point(302,40));
> group1 = new Group(sShell, SWT.NONE);
> group1.setText("Trials");
> group1.setSize(new org.eclipse.swt.graphics.Point(200,216));
> }
>
> However, everything seems to be in place...no warnings or errors,
> everything compiles fine.
>
> I can run other SWT apps on linux but those were built on linux (not that
> there should be any difference!)
>
> Also, like I said, this runs on Windows flawlessly.
>
> My classpath is fine, other projects are working in this directory.
>
> Just in case, here is the string I'm passing to the VM in the eclipse
> "Run" dialog:
>
> -Djava.library.path=/opt/eclipse-3.1M2/plugins/org.eclipse.s wt.gtk_3.1.0/os/linux/x86
>
> I'm sure this is correct - it is working for the aforementioned
> linux-built SWT projects and I've verified more than once that this is the
> correct path...
>
> Any ideas?
>
> Thanks!
>

No clue how this could have been generated but in your code:
private void createGroup1() {
group1.setLocation(new org.eclipse.swt.graphics.Point(302,40));
group1 = new Group(sShell, SWT.NONE);
group1.setText("Trials");
group1.setSize(new org.eclipse.swt.graphics.Point(200,216));
}

The setLocation call (first line) is being made before the Group is
instantiated (second line). This is what's causing the NPE, as group1
is equal to null when setLocation is called on it. Also very strange
that this code runs OK on Windows. Move the first line below the second
and it should work.

- Jeff
Re: windows to linux - swt failure... [message #600517 is a reply to message #63972] Mon, 04 October 2004 07:09 Go to previous message
Eclipse UserFriend
Originally posted by: spam.scientifik.com

Jeff Myers wrote:

> zambizzi wrote:
> > I created a Java project while on a windows box, using the Visual Editor
> > to create a front-end to my classes. All of this was contained in a
> > single eclipse JDT project.
> >
> > I wanted to see how feasable it'd be to take a project from one platform
> > to another (i.e. windows to linux)...and I'm coming up w/ problems.
> >
> > My impression was; I could simply change the paths to any external jars
> > I'm using and pass the correct linux/gtk VM arguement, for example,
> > "C:etcetc" to "/etc/etc/etc", and it would run just as it had on Windows.
> >
> > So far - no luck, here's eclipse console output I'm getting:
> >
> > (<unknown>:6516): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to
> > allocate widget with width 8 and height -1
> >
> > (<unknown>:6516): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to
> > allocate widget with width 52 and height -1
> > Exception in thread "main" java.lang.NullPointerException
> > at snap.SnapMain.createGroup1(SnapMain.java:61)
> > at snap.SnapMain.createSShell(SnapMain.java:125)
> > at snap.SnapMain.main(SnapMain.java:109)
> >
> > First of all, on the warnings, I'm not using -1 as a parameter for any of
> > the widgets...I've been over the code and I'm positive of that.
> >
> > Here's the code where it's apparently failing:
> >
> > private void createGroup1() {
> > group1.setLocation(new org.eclipse.swt.graphics.Point(302,40));
> > group1 = new Group(sShell, SWT.NONE);
> > group1.setText("Trials");
> > group1.setSize(new org.eclipse.swt.graphics.Point(200,216));
> > }
> >
> > However, everything seems to be in place...no warnings or errors,
> > everything compiles fine.
> >
> > I can run other SWT apps on linux but those were built on linux (not that
> > there should be any difference!)
> >
> > Also, like I said, this runs on Windows flawlessly.
> >
> > My classpath is fine, other projects are working in this directory.
> >
> > Just in case, here is the string I'm passing to the VM in the eclipse
> > "Run" dialog:
> >
> >
-Djava.library.path=/opt/eclipse-3.1M2/plugins/org.eclipse.s wt.gtk_3.1.0/os/linux/x86
> >
> > I'm sure this is correct - it is working for the aforementioned
> > linux-built SWT projects and I've verified more than once that this is the
> > correct path...
> >
> > Any ideas?
> >
> > Thanks!
> >

> No clue how this could have been generated but in your code:
> private void createGroup1() {
> group1.setLocation(new org.eclipse.swt.graphics.Point(302,40));
> group1 = new Group(sShell, SWT.NONE);
> group1.setText("Trials");
> group1.setSize(new org.eclipse.swt.graphics.Point(200,216));
> }

> The setLocation call (first line) is being made before the Group is
> instantiated (second line). This is what's causing the NPE, as group1
> is equal to null when setLocation is called on it. Also very strange
> that this code runs OK on Windows. Move the first line below the second
> and it should work.

> - Jeff

I don't know *how* I missed that...

Very strange, I'm looking at it right now, it does in fact run on windows
like that!

VE created it that way, maybe a bug?

Thanks!
Previous Topic:Strange Errors with Swing on VE 1.0.1
Next Topic:convert Class to Visual Class
Goto Forum:
  


Current Time: Sat Dec 21 14:00:00 GMT 2024

Powered by FUDForum. Page generated in 0.07096 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top