Eclipse 3.1 SWT problem [message #461411] |
Thu, 22 September 2005 06:28  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_00BC_01C5BF71.33556010
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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 =3D 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:=20
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!
------=_NextPart_000_00BC_01C5BF71.33556010
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2668" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>
<P><FONT face=3DArial size=3D2>Hello,</FONT></P>
<P><FONT face=3DArial size=3D2>I have a problem creating a SWT =
application using=20
Eclipse 3.1.<BR>Under Eclipse 3.0 one could add the SWT Library to =
the=20
project using:<BR><BR>Project->Properties->Java build path->Tab =
Libraries->Add Library->Standard Widget Toolkit (SWT)<BR><BR>Under =
3.1 the=20
SWT Library one cannot choose anymore!?!<BR></FONT><FONT face=3DArial=20
size=3D2><BR>My simple SWT example looks like this:</P></FONT>
<P><FONT face=3DArial size=3D2>import org.eclipse.swt.SWT;<BR>import=20
org.eclipse.swt.widgets.*;</FONT></P>
<P><FONT face=3DArial size=3D2>public class TEST<BR></FONT><FONT =
face=3DArial=20
size=3D2>{<BR></FONT><FONT face=3DArial size=3D2> public static =
void=20
main(String[] args)<BR> </FONT><FONT face=3DArial=20
size=3D2>{<BR> </FONT><FONT face=3DArial =
size=3D2>Shell shell =3D new=20
Shell();<BR></FONT><FONT face=3DArial size=3D2> =20
shell.setText("TEST");<BR> </FONT><FONT face=3DArial=20
size=3D2>}<BR>}</FONT></P>
<P><FONT face=3DArial size=3D2>After 'Run As' 'Java application' and/or =
on 'Run As'=20
'SWT Application' I get following error:<BR><BR></FONT><FONT =
face=3DArial=20
size=3D2>Exception in thread "main" java.lang.Error: Unresolved =
compilation=20
problems: <BR></FONT><FONT face=3DArial size=3D2>Shell cannot be =
resolved to a=20
type</FONT></P>
<P><FONT face=3DArial size=3D2>If I move the cursor to the yellow light =
bulp with=20
the white X on a red square (in line import =
org.eclipse.swt.SWT;)<BR>Eclipse=20
tells me:<BR><BR></FONT><FONT face=3DArial size=3D2>'The import =
org.eclipse cannot=20
be resolved'<BR><BR>Whats wrong?<BR><BR>Any help is =
appreciated!</FONT></P>
<P><FONT face=3DArial size=3D2></FONT> </P></DIV></BODY></HTML>
------=_NextPart_000_00BC_01C5BF71.33556010--
|
|
|
|
|
|
|
|
|
Re: Eclipse 3.1 SWT problem [message #461422 is a reply to message #461418] |
Thu, 22 September 2005 08:11   |
Eclipse User |
|
|
|
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: Eclipse 3.1 SWT problem [message #461434 is a reply to message #461414] |
Thu, 22 September 2005 12: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.10096 seconds