|
|
|
|
|
|
|
Re: Eclipse 3.1 SWT problem [message #461422 is a reply to message #461418] |
Thu, 22 September 2005 12:11 |
mr. burns Messages: 402 Registered: July 2009 |
Senior Member |
|
|
Hello Stefan,
I added now the two JARs as you mentioned, the compiler errors dissappear
now but I got another problem.
If I run the project I get the error message:
Could not find the main class. Program will exit.
Under the 'Run configuration' of the project the 'Main class' TEST is
availalable!?!
Do I have to add VM arguments also? Its empty!
Under Eclipse 3.0 I had
'-Djava.library.path=C:\wampp2\eclipse\plugins\org.eclipse.s wt.win32_3.0.2\os\win32\x86'
But under 3.1 the native libraries (the SWTxxx.dll) should be within the
JARs I added already, or am I wrong?
Thanks for further support!
"Stefan Langer" <eclipse@bettsockentraeger.de> schrieb im Newsbeitrag
news:dgu5o4$p5a$1@news.eclipse.org...
>I just realized that It might be that the entry I am referring to is added
>by the visual editor plugin. Don't have a clean installation of eclipse
>around to check this.
> In that case you would have to add a jar and find the plugins:
> org.eclipse.swt.win32.win32.x86_3.1.0.jar (This is for Windows! The last
> three entries are the os (win32) the windowsmanager(win32) and the
> arch(x86). Just choose the jar that is appropriate for your os)
> and org.eclipse.swt_3.1.0.jar to your project in order to have the swt
> packages.
>
> If you are doing a plugin project you can also use add plugin dependencies
> to add the above two jars to your project.
>
> Hope that helps and sorry for the confusion
>
> Stefan
>
> Mr. Burns wrote:
>> Hello Stafan,
>>
>> thanks for your reply, but I cannot really follow what you wrote, I am a
>> newbee in 3.1!
>>
>> So where I can find:
>>
>> buildpath properties (right click on resource) <-- Which resource I
>> should click?
>>
>> If I use menu Project->Properties->Java Build Path->Tab Libraries->Add
>> library, I get only following entries to choose:
>>
>> JRE System Library
>> Plug-in Dependencies
>> User Library
>>
>> No SWT!?! (As I wrote in my previous message)
>>
>> So, please can you show me more detailed where I can find what you wrote?
>>
>> Thanks again!
>>
>>
>>
>> "Stefan Langer" <eclipse@bettsockentraeger.de> schrieb im Newsbeitrag
>> news:dgu1u3$jq7$1@news.eclipse.org...
>>
>>>Using 3.1 it's under the buildpath properties (right click on resource)
>>>buildpath->configure build path...->Libraries Tab->Add Library...->SWT
>>>now you just have to choose the location you want the swt to be located
>>>at and voila everything should work.
>>>
>>>Regards
>>>Stefan
>>>
>>>Mr. Burns wrote:
>>>
>>>>Hello,
>>>>
>>>>I have a problem creating a SWT application using Eclipse 3.1.
>>>>Under Eclipse 3.0 one could add the SWT Library to the project using:
>>>>
>>>>Project->Properties->Java build path->Tab Libraries->Add
>>>>Library->Standard Widget Toolkit (SWT)
>>>>
>>>>Under 3.1 the SWT Library one cannot choose anymore!?!
>>>>
>>>>My simple SWT example looks like this:
>>>>
>>>>import org.eclipse.swt.SWT;
>>>>import org.eclipse.swt.widgets.*;
>>>>
>>>>public class TEST
>>>>{
>>>> public static void main(String[] args)
>>>> {
>>>> Shell shell = new Shell();
>>>> shell.setText("TEST");
>>>> }
>>>>}
>>>>
>>>>After 'Run As' 'Java application' and/or on 'Run As' 'SWT Application' I
>>>>get following error:
>>>>
>>>>Exception in thread "main" java.lang.Error: Unresolved compilation
>>>>problems: Shell cannot be resolved to a type
>>>>
>>>>If I move the cursor to the yellow light bulp with the white X on a red
>>>>square (in line import org.eclipse.swt.SWT;)
>>>>Eclipse tells me:
>>>>
>>>>'The import org.eclipse cannot be resolved'
>>>>
>>>>Whats wrong?
>>>>
>>>>Any help is appreciated!
>>>>
>>>>
>>
|
|
|
|
Re: Sorry wrong error message posted! [message #461427 is a reply to message #461423] |
Thu, 22 September 2005 13:30 |
|
To get an SWT app to run in 3.1 you can follow the help path from SWT
Example Launcher, but there is a quick way to get started.
1. create you java project.
2. Configure the build path, go to Libraries, and add a variable
3. Click on ECLIPSE_HOME and hit the extend button
4. go into plugins until you find the 2 SWT jars you need
5. now you can create you class in your project, for example:
package com.test;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class SwtExample {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("TEST");
shell.open();
while (!shell.isDisposed()) {
if (display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
6. Create an SWT Application launcher for the class, and Run
It worked fine in 3.1
Later,
PW
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
|
Re: Eclipse 3.1 SWT problem [message #461434 is a reply to message #461414] |
Thu, 22 September 2005 16:08 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You need to install the VE project to get the SWT library. It is made
available through VE. You can get VE through the update manager (VE is
the Visual Editor), make sure you select "Add Required...". The update
manager will get you version 1.1.0, but there is a 1.1.0.1 that fixes
many bugs in 1.1.0. You can get that by doing a scan for updates after
installing 1.1.0
--
Thanks,
Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.04237 seconds