Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Can't launch simple SWT app...
Can't launch simple SWT app... [message #63690] Fri, 01 October 2004 08:38 Go to next message
Eclipse UserFriend
Originally posted by: spam.scientifik.com

I just installed VE, I'm using WinXP. I'm simply trying to launch a very
basic SWT app and I get this error:

*******************************************
java.lang.NoClassDefFoundError:
Files\eclipse-3/1M2\plugins\org/eclipse/swt/win32_3/1/0\os\w in32\x86
Exception in thread "main"
*******************************************

...here is string arguement I'm passing to the VM:

*******************************************
-Djava.library.path=C:\Program
Files\eclipse-3.1M2\plugins\org.eclipse.swt.win32_3.1.0\os\w in32\x86
*******************************************

...this path is absolutely correct, I copied it right out of Win Explorer
rather than typing it in manually.

Here's the code (generated by VE)

********************************************
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Combo;
/*
* Created on Oct 1, 2004
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/

/**
* @author vjenks
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class SWTMain {

private org.eclipse.swt.widgets.Shell sShell = null; //
@jve:decl-index=0:visual-constraint="128,49"

private Combo combo = null;

/**
* This method initializes combo
*
*/
private void createCombo() {
combo = new Combo(sShell, SWT.NONE);
combo.setBounds(new org.eclipse.swt.graphics.Rectangle(155,43,232,21));
}
public static void main(String[] args) {
/* Before this is run, be sure to set up the following in the launch
configuration
* (Arguments->VM Arguments) for the correct SWT library path.
* The following is a windows example:
*
-Djava.library.path=" installation_directory\plugins\org.eclipse.swt.win32_3.0.0\o s\win32\x86 "
*/
org.eclipse.swt.widgets.Display display =
org.eclipse.swt.widgets.Display.getDefault();
SWTMain thisClass = new SWTMain();
thisClass.createSShell() ;
thisClass.sShell.open();

while (!thisClass.sShell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep ();
}
display.dispose();
}

/**
* This method initializes sShell
*/
private void createSShell() {
sShell = new org.eclipse.swt.widgets.Shell();
createCombo();
sShell.setSize(new org.eclipse.swt.graphics.Point(398,267));
sShell.setText("SWT is wicked cool!");
}
}
********************************************

Can anyone help? I can run SWT apps built in VE all day long on linux/gtk
but I can't get it to work in windows regardless of what version of
eclipse I use (have tried 3.0.1 and now 3.1M2)...

Thanks!
Re: Can't launch simple SWT app... [message #63715 is a reply to message #63690] Fri, 01 October 2004 08:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: spam.scientifik.com

Allow me to answer that 5 minutes later - it was the space in "Program
Files" that was breaking it.

I moved my eclipse IDE directory to the C:\ drive and ran it there (no
spaces in VM arguements) and it ran fine.

Seems like a silly limitation? Is there a way around this (ability to
have spaces in diretory structure?)

Thanks!

V. Jenks wrote:

> I just installed VE, I'm using WinXP. I'm simply trying to launch a very
> basic SWT app and I get this error:

> *******************************************
> java.lang.NoClassDefFoundError:
> Fileseclipse-3/1M2pluginsorg/eclipse/swt/win32_3/1/0oswin32x 86
> Exception in thread "main"
> *******************************************

> ...here is string arguement I'm passing to the VM:

> *******************************************
> -Djava.library.path=C:Program
> Fileseclipse-3.1M2pluginsorg.eclipse.swt.win32_3.1.0oswin32x 86
> *******************************************

> ...this path is absolutely correct, I copied it right out of Win Explorer
> rather than typing it in manually.

> Here's the code (generated by VE)

> ********************************************
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.widgets.Combo;
> /*
> * Created on Oct 1, 2004
> *
> * TODO To change the template for this generated file go to
> * Window - Preferences - Java - Code Style - Code Templates
> */

> /**
> * @author vjenks
> *
> * TODO To change the template for this generated type comment go to
> * Window - Preferences - Java - Code Style - Code Templates
> */
> public class SWTMain {

> private org.eclipse.swt.widgets.Shell sShell = null; //
> @jve:decl-index=0:visual-constraint="128,49"

> private Combo combo = null;

> /**
> * This method initializes combo
> *
> */
> private void createCombo() {
> combo = new Combo(sShell, SWT.NONE);
> combo.setBounds(new org.eclipse.swt.graphics.Rectangle(155,43,232,21));
> }
> public static void main(String[] args) {
> /* Before this is run, be sure to set up the following in the launch
> configuration
> * (Arguments->VM Arguments) for the correct SWT library path.
> * The following is a windows example:
> *
>
-Djava.library.path=" installation_directorypluginsorg.eclipse.swt.win32_3.0.0oswi n32x86 "
> */
> org.eclipse.swt.widgets.Display display =
> org.eclipse.swt.widgets.Display.getDefault();
> SWTMain thisClass = new SWTMain();
> thisClass.createSShell() ;
> thisClass.sShell.open();

> while (!thisClass.sShell.isDisposed()) {
> if (!display.readAndDispatch()) display.sleep ();
> }
> display.dispose();
> }

> /**
> * This method initializes sShell
> */
> private void createSShell() {
> sShell = new org.eclipse.swt.widgets.Shell();
> createCombo();
> sShell.setSize(new org.eclipse.swt.graphics.Point(398,267));
> sShell.setText("SWT is wicked cool!");
> }
> }
> ********************************************

> Can anyone help? I can run SWT apps built in VE all day long on linux/gtk
> but I can't get it to work in windows regardless of what version of
> eclipse I use (have tried 3.0.1 and now 3.1M2)...

> Thanks!
Re: Can't launch simple SWT app... [message #63760 is a reply to message #63715] Fri, 01 October 2004 11:34 Go to previous message
Eclipse UserFriend
Originally posted by: myersj.nospam.gmail.com

V. Jenks wrote:
> Allow me to answer that 5 minutes later - it was the space in "Program
> Files" that was breaking it.
>
> I moved my eclipse IDE directory to the C:\ drive and ran it there (no
> spaces in VM arguements) and it ran fine.
>
> Seems like a silly limitation? Is there a way around this (ability to
> have spaces in diretory structure?)
>
> Thanks!
>
> V. Jenks wrote:
Try putting double quotes around the path if it has spaces. ie:
-Djava.library.path="C:\Program Files\eclipse\..."

- Jeff
Re: Can't launch simple SWT app... [message #600360 is a reply to message #63690] Fri, 01 October 2004 08:48 Go to previous message
Eclipse UserFriend
Originally posted by: spam.scientifik.com

Allow me to answer that 5 minutes later - it was the space in "Program
Files" that was breaking it.

I moved my eclipse IDE directory to the C:\ drive and ran it there (no
spaces in VM arguements) and it ran fine.

Seems like a silly limitation? Is there a way around this (ability to
have spaces in diretory structure?)

Thanks!

V. Jenks wrote:

> I just installed VE, I'm using WinXP. I'm simply trying to launch a very
> basic SWT app and I get this error:

> *******************************************
> java.lang.NoClassDefFoundError:
> Fileseclipse-3/1M2pluginsorg/eclipse/swt/win32_3/1/0oswin32x 86
> Exception in thread "main"
> *******************************************

> ...here is string arguement I'm passing to the VM:

> *******************************************
> -Djava.library.path=C:Program
> Fileseclipse-3.1M2pluginsorg.eclipse.swt.win32_3.1.0oswin32x 86
> *******************************************

> ...this path is absolutely correct, I copied it right out of Win Explorer
> rather than typing it in manually.

> Here's the code (generated by VE)

> ********************************************
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.widgets.Combo;
> /*
> * Created on Oct 1, 2004
> *
> * TODO To change the template for this generated file go to
> * Window - Preferences - Java - Code Style - Code Templates
> */

> /**
> * @author vjenks
> *
> * TODO To change the template for this generated type comment go to
> * Window - Preferences - Java - Code Style - Code Templates
> */
> public class SWTMain {

> private org.eclipse.swt.widgets.Shell sShell = null; //
> @jve:decl-index=0:visual-constraint="128,49"

> private Combo combo = null;

> /**
> * This method initializes combo
> *
> */
> private void createCombo() {
> combo = new Combo(sShell, SWT.NONE);
> combo.setBounds(new org.eclipse.swt.graphics.Rectangle(155,43,232,21));
> }
> public static void main(String[] args) {
> /* Before this is run, be sure to set up the following in the launch
> configuration
> * (Arguments->VM Arguments) for the correct SWT library path.
> * The following is a windows example:
> *
>
-Djava.library.path=" installation_directorypluginsorg.eclipse.swt.win32_3.0.0oswi n32x86 "
> */
> org.eclipse.swt.widgets.Display display =
> org.eclipse.swt.widgets.Display.getDefault();
> SWTMain thisClass = new SWTMain();
> thisClass.createSShell() ;
> thisClass.sShell.open();

> while (!thisClass.sShell.isDisposed()) {
> if (!display.readAndDispatch()) display.sleep ();
> }
> display.dispose();
> }

> /**
> * This method initializes sShell
> */
> private void createSShell() {
> sShell = new org.eclipse.swt.widgets.Shell();
> createCombo();
> sShell.setSize(new org.eclipse.swt.graphics.Point(398,267));
> sShell.setText("SWT is wicked cool!");
> }
> }
> ********************************************

> Can anyone help? I can run SWT apps built in VE all day long on linux/gtk
> but I can't get it to work in windows regardless of what version of
> eclipse I use (have tried 3.0.1 and now 3.1M2)...

> Thanks!
Re: Can't launch simple SWT app... [message #600379 is a reply to message #63715] Fri, 01 October 2004 11:34 Go to previous message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 396
Registered: July 2009
Senior Member
V. Jenks wrote:
> Allow me to answer that 5 minutes later - it was the space in "Program
> Files" that was breaking it.
>
> I moved my eclipse IDE directory to the C:\ drive and ran it there (no
> spaces in VM arguements) and it ran fine.
>
> Seems like a silly limitation? Is there a way around this (ability to
> have spaces in diretory structure?)
>
> Thanks!
>
> V. Jenks wrote:
Try putting double quotes around the path if it has spaces. ie:
-Djava.library.path="C:\Program Files\eclipse\..."

- Jeff
Previous Topic:VE and third party components
Next Topic:inserting swt container results in error?
Goto Forum:
  


Current Time: Thu Dec 26 10:38:53 GMT 2024

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

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

Back to the top