Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 519340 - org.eclipse.nebula.widgets.richtext.example doesn't launch on Cocoa due to java 1.7
Summary: org.eclipse.nebula.widgets.richtext.example doesn't launch on Cocoa due to ja...
Status: CLOSED NOT_ECLIPSE
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Nebula (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Dirk Fauth CLA
QA Contact: Leo Ufimtsev CLA
URL:
Whiteboard:
Keywords:
Depends on: 519777
Blocks:
  Show dependency tree
 
Reported: 2017-07-06 16:37 EDT by Leo Ufimtsev CLA
Modified: 2021-07-05 11:40 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leo Ufimtsev CLA 2017-07-06 16:37:02 EDT
RichTextExample.java doesn't run on Cocoa with error:
"org/eclipse/swt/widgets/Layout : Unsupported major.minor version 52"

After investigation, it appears .classpath specifies java 1.7. 
With java 1.8, the issue is solved.

It seems the .classpath needs to be updated.

I don't have nebula setup for patch submissions, if someone could submit/merge, it'd be great.
Comment 1 Dirk Fauth CLA 2017-07-06 23:41:48 EDT
Just one question. How do you execute the example? Might be that the issue is because of SWT and not because of the example. I am not aware of any usage of 1.8 features in the code.
Comment 2 Leo Ufimtsev CLA 2017-07-07 11:13:53 EDT
(In reply to Dirk Fauth from comment #1)
> Just one question. How do you execute the example? 

Right click on RichTextExample.java -> run
It has a main method, so it should work on it's own.

> Might be that the issue
> is because of SWT and not because of the example. I am not aware of any
> usage of 1.8 features in the code.

Hmm. Not sure. 
This is specific to Cocoa. This snippet runs on Win32/Linux in Java 1.7.
We did upgrade SWT to Java 1.8 a year ago or so.

I'm full time SWT/Linux dev, I don't know much about cocoa's Java mechanism. Maybe on Cocoa 1.7 doesn't mix well with 1.8? idk?
It's only the example has has to be updated to 1.8, the richtexteditor.java itself can stay at 1.7 for this to continue to work. 

Hmm. Kinda confusing. idk. Thoughts?
Comment 3 Jonah Graham CLA 2017-07-11 04:51:26 EDT
This is a JDT/PDE bug/issue not a RichText/Nebula issue.

The issue here is JDT is choosing the wrong version of the JVM to run with. JDT is choosing to run with the version of Java declared in the project (.classpath) but some of the dependencies require newer versions of Java. Just because some versions of some dependencies require newer javas, does not mean RichText/Nebula should depend on latest Java too.

Therefore it would only be correct to change the .classpath if RichText was dropping support for previous versions of SWT. And if it did that, it should raise the min required version of SWT too (the current dependency is Luna)
Comment 4 Dirk Fauth CLA 2017-07-11 05:07:31 EDT
If Nebula RichText should be blamed than only for the missing target definition. I will think about where to add it.
Comment 5 Leo Ufimtsev CLA 2017-07-17 13:25:30 EDT
(In reply to Jonah Graham from comment #3)
> This is a JDT/PDE bug/issue not a RichText/Nebula issue.
> 
> The issue here is JDT is choosing the wrong version of the JVM to run with.
> JDT is choosing to run with the version of Java declared in the project
> (.classpath) but some of the dependencies require newer versions of Java.
> Just because some versions of some dependencies require newer javas, does
> not mean RichText/Nebula should depend on latest Java too.
> 
> Therefore it would only be correct to change the .classpath if RichText was
> dropping support for previous versions of SWT. And if it did that, it should
> raise the min required version of SWT too (the current dependency is Luna)

I see. That's a good point, thank you for comment. 

I've experimented a bit with generic non-nebula projects. The issue only occurs on Cocoa, not on Linux/Windows, so it might be a java or Eclipse JDT bug.

I've filed a report:
Bug 519777 – Java 1.7 projects fail to load if a dependent library specifies 1.8 

Closing as this isn't Nebula related by the looks of things.