Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT 3.7.2-2 is not working with OpenJDK 6b24-1.11.1-4ubuntu3(SWT 3.7.2-2 is not working with OpenJDK 6b24-1.11.1-4ubuntu3)
SWT 3.7.2-2 is not working with OpenJDK 6b24-1.11.1-4ubuntu3 [message #874969] Mon, 21 May 2012 21:57 Go to next message
JIA Pei is currently offline JIA PeiFriend
Messages: 49
Registered: September 2009
Member

Hi, all:

I was just trying a simple SWT Slider example at http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SliderExample.htm .


My Environment:
Ubuntu: 12.04
Eclipse: Version: Indigo Service Release 2
Build id: 20120216-1857
OpenJDK: 6b24-1.11.1-4ubuntu3
SWT: 3.7.2-2


I've been expecting exactly the same results (a dialog with 2 sliders ) as shown http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SliderExample.htm . But what I got now is just http://www.visionopen.com/questions/SliderExample.png, there is no slider at all.....


So, does SWT work with OpenJDK 6b24-1.11.1-4ubuntu3 ?

Cheers
Pei









Welcome to Vision Open
http://www.visionopen.com

[Updated on: Mon, 21 May 2012 21:59]

Report message to a moderator

Re: SWT 3.7.2-2 is not working with OpenJDK 6b24-1.11.1-4ubuntu3 [message #875403 is a reply to message #874969] Tue, 22 May 2012 17:13 Go to previous messageGo to next message
JIA Pei is currently offline JIA PeiFriend
Messages: 49
Registered: September 2009
Member


The same code works fine under Windows7.


The Environment:
Windows 7
Eclipse: Version: Indigo Service Release 2
Build id: 20120216-1857
Oracle Sun Java: Java SE 6 Update 31
SWT: 3.7.2-2


Still, it doesn't work under Ubuntu 12.04 + OpenJDK.
Can anybody help to explain why it is so, and how to modify to make it work?


Cheers
Pei



Welcome to Vision Open
http://www.visionopen.com
Re: SWT 3.7.2-2 is not working with OpenJDK 6b24-1.11.1-4ubuntu3 [message #875417 is a reply to message #875403] Tue, 22 May 2012 18:03 Go to previous messageGo to next message
JIA Pei is currently offline JIA PeiFriend
Messages: 49
Registered: September 2009
Member


Now, I tried the following environment, still doesn't work:

Ubuntu: 12.04
Eclipse: Version: Indigo Service Release 2
Build id: 20120216-1857
SunJDK: jdk1.6.0_32
SWT: 3.7.2-2


Now, I would ask, is SWT (Slider) able to work properly under Ubuntu 12.04?


Cheers
Pei



Welcome to Vision Open
http://www.visionopen.com
Re: SWT 3.7.2-2 is not working with OpenJDK 6b24-1.11.1-4ubuntu3 [message #875850 is a reply to message #875403] Wed, 23 May 2012 12:55 Go to previous messageGo to next message
Eclipse UserFriend
Am 22.05.2012 19:13, schrieb JIA Pei:
>
> The same code works fine under Windows7.
>
>
> The Environment:
> Windows 7
> Eclipse: Version: Indigo Service Release 2
> Build id: 20120216-1857
> Oracle Sun Java: Java SE 6 Update 31
> SWT: 3.7.2-2
>
>
> Still, it doesn't work under Ubuntu 12.04 + OpenJDK.
> Can anybody help to explain why it is so, and how to modify to make it
> work?
>

I am also using Ubuntu 12 LTS

You may want to test it with Oracle Java:

1.
Download the
jdk-7u4-linux-<architecture>.tar.gz file and extract it to e.g.
/usr/lib/jvm/

2.
Make a symbolic link, that you can change it to a another version easily
ln -s /usr/lib/jvm/jdk1.7.0_04 /usr/lib/jvm/oracle-jdk

3. update-alternative just to the symbolic link (auto-modus)

update-alternatives --install "/usr/bin/java" "java"
"/usr/lib/jvm/oracle-jdk/bin/java" 1

update-alternatives --install "/usr/bin/javac" "javac"
"/usr/lib/jvm/oracle-jdk/bin/javac" 1

update-alternatives --install "/usr/bin/javaws" "javaws"
"/usr/lib/jvm/oracle-jdk/bin/javaws" 1

update-alternatives --install "/usr/bin/jar" "jar"
"/usr/lib/jvm/oracle-jdk/bin/jar" 1

update-alternatives --install
"/usr/lib/mozilla/plugins/mozilla-javaplugin.so" "mozilla-javaplugin.so"
"/usr/lib/jvm/oracle-jdk/jre/lib/<architecture>/libnpjp2.so" 1


Thomas B
Re: SWT 3.7.2-2 is not working with OpenJDK 6b24-1.11.1-4ubuntu3 [message #877192 is a reply to message #875850] Sat, 26 May 2012 03:36 Go to previous messageGo to next message
JIA Pei is currently offline JIA PeiFriend
Messages: 49
Registered: September 2009
Member


Hi, Thomas:

Thanks for your reply.
I tested jdk1.7.0_04 as well. SWT Slider also fails to display.

I didn't do the following yet. But, my question is: is the following step (your 3rd step) a must for Eclipse to run the real Java? You know, I've already added
Windows->Preference->Installed JREs.



Quote:
3. update-alternative just to the symbolic link (auto-modus)

update-alternatives --install "/usr/bin/java" "java"
"/usr/lib/jvm/oracle-jdk/bin/java" 1

update-alternatives --install "/usr/bin/javac" "javac"
"/usr/lib/jvm/oracle-jdk/bin/javac" 1

update-alternatives --install "/usr/bin/javaws" "javaws"
"/usr/lib/jvm/oracle-jdk/bin/javaws" 1

update-alternatives --install "/usr/bin/jar" "jar"
"/usr/lib/jvm/oracle-jdk/bin/jar" 1

update-alternatives --install
"/usr/lib/mozilla/plugins/mozilla-javaplugin.so" "mozilla-javaplugin.so"
"/usr/lib/jvm/oracle-jdk/jre/lib/<architecture>/libnpjp2.so" 1



Thanks again Thomas, thank you..

Best Regards
Pei


Welcome to Vision Open
http://www.visionopen.com
Re: SWT 3.7.2-2 is not working with OpenJDK 6b24-1.11.1-4ubuntu3 [message #878513 is a reply to message #877192] Tue, 29 May 2012 13:12 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
the third step is necessary to get your "alternatives" installed on
Ubuntu, and you can change it with "update-alternatives --config java".
You dont need to remove your OpenJDK. But if you want to start Eclipse
or your other Java programs with Oracle Java, then you need to activate
this alternative. Of course you can change your JRE within Eclipse, if
you just want to start/test your programs within Eclipse.

Thomas B

Am 26.05.2012 05:36, schrieb JIA Pei:
>
> Hi, Thomas:
>
> Thanks for your reply.
> I tested jdk1.7.0_04 as well. SWT Slider also fails to display.
> I didn't do the following yet. But, my question is: is the following
> step (your 3rd step) a must for Eclipse to run the real Java? You know,
> I've already added Windows->Preference->Installed JREs.
>
>
>
> Quote:
>> 3. update-alternative just to the symbolic link (auto-modus)
>>
>> update-alternatives --install "/usr/bin/java" "java"
>> "/usr/lib/jvm/oracle-jdk/bin/java" 1
>>
>> update-alternatives --install "/usr/bin/javac" "javac"
>> "/usr/lib/jvm/oracle-jdk/bin/javac" 1
>>
>> update-alternatives --install "/usr/bin/javaws" "javaws"
>> "/usr/lib/jvm/oracle-jdk/bin/javaws" 1
>>
>> update-alternatives --install "/usr/bin/jar" "jar"
>> "/usr/lib/jvm/oracle-jdk/bin/jar" 1
>>
>> update-alternatives --install
>> "/usr/lib/mozilla/plugins/mozilla-javaplugin.so"
>> "mozilla-javaplugin.so"
>> "/usr/lib/jvm/oracle-jdk/jre/lib/<architecture>/libnpjp2.so" 1
>
>
>
> Thanks again Thomas, thank you..
>
> Best Regards
> Pei
Re: SWT 3.7.2-2 is not working with OpenJDK 6b24-1.11.1-4ubuntu3 [message #878705 is a reply to message #877192] Tue, 29 May 2012 19:17 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
You're actually running the snippet fine, I see the same problem on
Ubuntu 12.

The strange behaviour is caused by Ubuntu 12's new custom overlay
scrollbars. They are overriding the default GTK scrollbar, which is the
native widget that swt uses for Slider controls. The overlay scrollbars
are not used when Eclipse is run because Ubuntu has "eclipse" in a list
of apps whose scrollbars are not to be overridden with the overlay ones.
However when you run a stand-alone swt example you're not running
"eclipse", so Ubuntu goes and replaces the conventional scrollbars with
the overlay-style ones, which do not appear when not contained in a
scrollable parent control. I'll likely log a report with Ubuntu about
this to see how to deal with this going forward.

In the meantime, they provide a workaround for manually turning the
overlay scrollbars off. Set Linux environment variable
LIBOVERLAY_SCROLLBAR to 0 and your snippet will run fine.

Grant


On 5/25/2012 11:36 PM, JIA Pei wrote:
>
> Hi, Thomas:
>
> Thanks for your reply.
> I tested jdk1.7.0_04 as well. SWT Slider also fails to display.
> I didn't do the following yet. But, my question is: is the following
> step (your 3rd step) a must for Eclipse to run the real Java? You know,
> I've already added Windows->Preference->Installed JREs.
>
>
>
> Quote:
>> 3. update-alternative just to the symbolic link (auto-modus)
>>
>> update-alternatives --install "/usr/bin/java" "java"
>> "/usr/lib/jvm/oracle-jdk/bin/java" 1
>>
>> update-alternatives --install "/usr/bin/javac" "javac"
>> "/usr/lib/jvm/oracle-jdk/bin/javac" 1
>>
>> update-alternatives --install "/usr/bin/javaws" "javaws"
>> "/usr/lib/jvm/oracle-jdk/bin/javaws" 1
>>
>> update-alternatives --install "/usr/bin/jar" "jar"
>> "/usr/lib/jvm/oracle-jdk/bin/jar" 1
>>
>> update-alternatives --install
>> "/usr/lib/mozilla/plugins/mozilla-javaplugin.so"
>> "mozilla-javaplugin.so"
>> "/usr/lib/jvm/oracle-jdk/jre/lib/<architecture>/libnpjp2.so" 1
>
>
>
> Thanks again Thomas, thank you..
>
> Best Regards
> Pei
Re: SWT 3.7.2-2 is not working with OpenJDK 6b24-1.11.1-4ubuntu3 [message #883367 is a reply to message #878705] Fri, 08 June 2012 11:39 Go to previous message
JIA Pei is currently offline JIA PeiFriend
Messages: 49
Registered: September 2009
Member

Thank you so much Grant Gayed. By just removing the following 3 packages related to overlay:
Quote:
overlay-scrollbar
liboverlay-scrollbar3-0.2-0
liboverlay-scrollbar0.2-0

Now, SWT comes back to life ^_^

Thanks again...


Cheers
Pei


Welcome to Vision Open
http://www.visionopen.com

[Updated on: Fri, 08 June 2012 11:40]

Report message to a moderator

Previous Topic:Drawing an image on a double buffered canvas
Next Topic:SWT Print to file - any way to get the output type?
Goto Forum:
  


Current Time: Fri Nov 21 16:53:16 GMT 2014

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

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