gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
304 stars 99 forks source link

Compatibility with macOS Big Sur #3050

Closed csr closed 3 years ago

csr commented 3 years ago

Hello,

It looks like GAMA doesn't run on macOS Big Sur. This is probably due to the JDK which isn't supported by the OS? I've tried uninstalling GAMA 1.8.1 with SDK and installing it back again (with SDK) and this is what I'm getting:

Screen Shot 2020-11-13 at 3 38 16 PM

!SESSION 2020-11-13 15:38:05.366 -----------------------------------------------
eclipse.buildId=${build.id}
java.version=1.8.0_161
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -data @noDefault

!ENTRY org.eclipse.osgi 4 0 2020-11-13 15:38:10.069
!MESSAGE Application error
!STACK 1
java.lang.NullPointerException
    at org.eclipse.swt.widgets.Control.internal_new_GC(Control.java:2179)
    at org.eclipse.swt.graphics.GC.<init>(GC.java:262)
    at org.eclipse.swt.graphics.GC.<init>(GC.java:223)
    at org.eclipse.jface.dialogs.Dialog.initializeDialogUnits(Dialog.java:937)
    at org.eclipse.jface.dialogs.IconAndMessageDialog.createContents(IconAndMessageDialog.java:199)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1099)
    at org.eclipse.jface.window.Window.open(Window.java:788)
    at org.eclipse.jface.dialogs.MessageDialog.open(MessageDialog.java:394)
    at org.eclipse.jface.dialogs.MessageDialog.openQuestion(MessageDialog.java:504)
    at msi.gama.application.workspace.WorkspacePreferences.testWorkspaceSanity(WorkspacePreferences.java:352)
    at msi.gama.application.workspace.WorkspacePreferences.checkWorkspaceDirectory(WorkspacePreferences.java:275)
    at msi.gama.application.Application.checkWorkspace(Application.java:190)
    at msi.gama.application.Application.start(Application.java:113)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:661)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1476)

Thank you, Cesare

jferdelyi commented 3 years ago

Hello, my MacBook Pro is not on Big Sur but I've had the same kind of issue.

In my case, I use OpenJDK (Homebrew)

brew cask install adoptopenjdk8
java -version
openjdk version "1.8.0_272"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_272-b10)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.272-b10, mixed mode)

And Eclipse 2019-12

Version: 2019-12 (4.14.0)
Build id: 20191212-1212

It's working but I have some little graphics glitch but It's usable.

csr commented 3 years ago

Update: whoops, turns out I first need to brew tap AdoptOpenJDK/openjdk.


Thank you. adoptopenjdk8 doesn't seem to be on brew, so I brew cask install adoptopenjdk which changed the error message. Perhaps what I've installed is too new for GAMA 1.8.1, so I need to find version 8 elsewhere.

!SESSION 2020-11-13 15:38:05.366 -----------------------------------------------
eclipse.buildId=${build.id}
java.version=1.8.0_161
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -data @noDefault

!ENTRY org.eclipse.osgi 4 0 2020-11-13 15:38:10.069
!MESSAGE Application error
!STACK 1
java.lang.NullPointerException
    at org.eclipse.swt.widgets.Control.internal_new_GC(Control.java:2179)
    at org.eclipse.swt.graphics.GC.<init>(GC.java:262)
    at org.eclipse.swt.graphics.GC.<init>(GC.java:223)
    at org.eclipse.jface.dialogs.Dialog.initializeDialogUnits(Dialog.java:937)
    at org.eclipse.jface.dialogs.IconAndMessageDialog.createContents(IconAndMessageDialog.java:199)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1099)
    at org.eclipse.jface.window.Window.open(Window.java:788)
    at org.eclipse.jface.dialogs.MessageDialog.open(MessageDialog.java:394)
    at org.eclipse.jface.dialogs.MessageDialog.openQuestion(MessageDialog.java:504)
    at msi.gama.application.workspace.WorkspacePreferences.testWorkspaceSanity(WorkspacePreferences.java:352)
    at msi.gama.application.workspace.WorkspacePreferences.checkWorkspaceDirectory(WorkspacePreferences.java:275)
    at msi.gama.application.Application.checkWorkspace(Application.java:190)
    at msi.gama.application.Application.start(Application.java:113)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:661)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1476)
jferdelyi commented 3 years ago

You must activate the AdoptOpenJDK tap with brew tap brew tap AdoptOpenJDK/openjdk The command brew cask install adoptopenjdk install the last version of OpenJDK. I use the git version so I'm not sure if it's working for you.

csr commented 3 years ago

Thank you for guiding me in the right direction. After using openjdk v8 I get a different error message. After Googling a bit, I tried tweaking some variables inside the Eclipse/Gama.ini file (such as RAM allocation), with no success. I'll use a new machine for the moment, but I'll update here if I find something new.

Screen Shot 2020-11-13 at 8 46 28 PM
AlexisDrogoul commented 3 years ago

There seems to be some issues with Eclipse as well. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=565913

hqnghi88 commented 3 years ago

Dear, I have no idea about mac, but i have sometime the same message "java.lang.NullPointerException at org.eclipse.swt.widgets.Control.internal_new_GC(Control.java:2179)" on my win 10. The cause is the driver of dedicated gpu and integrated intel are not well switched (the default mode in windows - windows managing for graphical, will let windows decide when GPU need to run or just integrated Intel graphic). When i set GAMA to use always the GPU, it will work fluently. Is there some kind of setting on Mac to let application use always the GPU?

AlexisDrogoul commented 3 years ago

Maybe related as well: https://stackoverflow.com/questions/62647625/not-able-to-run-eclipse-on-macos-big-sur

csr commented 3 years ago

Thank you. That post seems to be referring to the Eclipse app, so I'm not sure how the info.plist change users suggest there can be applied here, if it should be made inside GAMA or the JDK.

albertoxamin commented 3 years ago

Other issues here, GAMA starts without issues, but when I open a file the window becomes blank image

sisundin commented 3 years ago

I have the same problem. Anyone that has figured out a temporary workaround? Is currently thinking about installing Linux on a usb drive and running it from there. Anyone who has tried that? Would this result in performance issues? I’m a student with close deadlines and is desperately trying to get going again...

csr commented 3 years ago

@sisundin:

@albertoxamin suggested using Wineskin Winery on Big Sur and it works great. Simply download the Windows version of GAMA with JDK and create a wrapper around that with Wineskin Winery.

sisundin commented 3 years ago

@csr Thank you! After a bit of confusion I got it running! Works fine a little interface problems but it works. Thank you for your help!

albertoxamin commented 3 years ago

There seems to be some issues with Eclipse as well. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=565913

On the eclipse issue tracker, it is marked as VERIFIED FIXED, maybe updating the eclipse dependency of gama could fix the bug?

sisundin commented 3 years ago

@albertoxamin Could this be done independently or does the gama team need to do that? Or is it reasonable that one does so independently?

albertoxamin commented 3 years ago

@sisundin I don't know, I can't find references on how to build it. I was asking @AlexisDrogoul

RoiArthurB commented 3 years ago

Hello,

@albertoxamin @sisundin Here's the documentation for building your own release of GAMA : https://gama-platform.github.io/wiki/CreatingAReleaseOfGama

The issue is marked as fixed for the latest version of Eclipse (as what I quickly saw), but GAMA is build on a previous version of Eclipse (2019-03). So, this work may be a bit long before releasing a bug-free GAMA on Big Sur.

We'll be thankful for any help on porting GAMA on the latest version of Eclipse (which should definitely fix this issue for this version of macOS)

AlexisDrogoul commented 3 years ago

Hi,

Just an information: I have been able to compile and run a version of GAMA 2.0 using the latest version of Eclipse (2020-09) that unfortunately requires JDK 11.09. Not everything is working (OpenGL is still missing for instance) and probably a lot of functionalities are broken under the hood (graph library, etc.), but at least it is a good indication that we can have it up and running in a not so distant future. Now, we have two choices: either we continue in that direction and accelerate the release of GAMA 2.0 or we adapt the current 1.8.1 to JDK 11 modules (which is the main reason for not leaving JDK 8 and not adopting a newer version of Eclipse ... ).

hqnghi88 commented 3 years ago

I prefer 2.0 👍

AlexisDrogoul commented 3 years ago

@hqnghi88 I prefer it too, but it means we can't run GAMA on macOS for a long time, as 2.0 is far from ready... Maybe moving on to an 1.8.2 running under JDK11 would be fastest (unless some libraries can't be kept as is...) ?

benoitgaudou commented 3 years ago

Hi, By the way, for both GAMA 2.0 (i.e Gamaweb right ?) and the next desktop GAMA, we could need to be able to follow (or to not be too far behind) Eclipse evolution no ? So I have the feeling that doing the step to java 11 starts also to be necessary for both versions...

Cheers

Benoit

Le mar. 17 nov. 2020 à 11:14, Alexis Drogoul notifications@github.com a écrit :

@hqnghi88 https://github.com/hqnghi88 I prefer it too, but it means we can't run GAMA on macOS for a long time, as 2.0 is far from ready... Maybe moving on to an 1.8.2 running under JDK11 would be fastest (unless some libraries can't be kept as is...) ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gama-platform/gama/issues/3050#issuecomment-728829891, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAL3WSTREXA5RHHTTCYCFBLSQJEHZANCNFSM4TUU4PRQ .

AlexisDrogoul commented 3 years ago

GAMA 2.0 refers to this branch: https://github.com/gama-platform/gama/tree/GAMA_2.0

It's supposed to be the next evolution of the desktop version.

hqnghi88 commented 3 years ago

@benoitgaudou no, the 2.0 in the branch 2.0 is for desktop. @AlexisDrogoul the blocking stone is the organization of modules of 2.0 as we can try and test for other related problems (plugin version, compatibilities...), i think i had already maven for 1.8.2 and 2.0 for current git base.

AlexisDrogoul commented 3 years ago

I have installed macOS Big Sur in a virtual machine. As mentioned by @albertoxamin, the version with the JDK included starts without problems, but no views can be displayed (except the preferences), which means the problem clearly comes from SWT. My next move will be to try building a version of GAMA with a more recent version of SWT (one that corrects the bugs but still works with JDK 8 -- if such a beast exists !). @hqnghi88 if you have other ideas... ?

hqnghi88 commented 3 years ago

I rebuilt the 2.0 branch with eclipse 2020-12 and jdk 11, but it is not compromise, gama can launch, basic GUI is ok , but launching model have problem (opengl crash, java2d wrong displayed), may be because i am on a AMD cpu. @AlexisDrogoul which version of swt with jdk8? i am struggling with maven for branch 2.0, the ecipse 2020-03 work but many wrong version of artifacts with 2020-09...

AlexisDrogoul commented 3 years ago

OK. I have spent some hours installing from scratch another MacBookPro with macOS Big Sur, 3 versions of Eclipse, a few JDKs and the two branches. I have at least the correct environment now to try different combinations. Btw, @hqnghi88 , are the included travis scripts up to date for both 1.8 and 2.0 (i.e., can I build GAMA w/o problems with them -- I havent tried yet) ? I might also address the issue with the signing of the platform while I'm at it (see #3004 ).

hqnghi88 commented 3 years ago

Not ready, the maven for 2.0 can run on jdk 11, produce gama binaries but cannot launch (crash immediately), im trying to make it at least can launch with binaries.

AlexisDrogoul commented 3 years ago

Just to share some progress. I have a (more or less) running version of GAMA 1.8.1 on JDK 15 / macOS Big Sur / Eclipse 2020-09.

image

Some things are however still broken in it (probably because of the module system introduced in JDK 11), and especially GeoTools, which generates a lot of exceptions. There are also some visual glitches, strange slowdowns when a simulation is running (impossible to move the mouse), etc. Lots of fun ! But most of the platform is functional, which is a good news.

hqnghi88 commented 3 years ago

Very good news, but can you push to a branch, as i want to work simultaneously for maven build . Cheers.

AlexisDrogoul commented 3 years ago

Done. It's here: https://github.com/gama-platform/gama/tree/JDK11_Compatibility Text of the first commit:

Main goals are:

Can only be run on JDK11+ and Eclipse 2020-09

AlexisDrogoul commented 3 years ago

Additional steps: GeoTools 21.x, the first JDK11 compatible version of GeoTools is depending on JTS 1.16 from location tech... (see http://docs.geotools.org/latest/userguide/welcome/upgrade.html). Meaning we need to upgrade GAMA as well (I was hoping not).

AlexisDrogoul commented 3 years ago

I have a version with GeoTools 21.4 and JTS 1.17 running on macOS Big Sur... with the exception of models using GIS data. And there are some visual glitches everywhere. But so far so good. It's progressing !

Capture d’écran, le 2020-11-28 à 20 41 57
AlexisDrogoul commented 3 years ago

I have now, since the latest commit (https://github.com/gama-platform/gama/commit/84a8e87e6e5c9c87832e20802fc21401e4835ef0) GAMA 1.8.1 running on JDK 15, Eclipse 2020-09 and macOS Big Sur. Given the changes, I propose to move to another branch (GAMA 1.8.2 ?) and a release for all environments (with the compatibility with JDK 11+ principally).

AlexisDrogoul commented 3 years ago

An alpha release of a compatible version has been released here : https://github.com/gama-platform/gama/releases/tag/1.8.2. Please test and report all the issues you can find !

AlexisDrogoul commented 3 years ago

I have conducted tests which seems to show that this version is running quite well on macOS Big Sur.

arturgalenom commented 3 years ago

Hi! I just downloaded 1.8.2 version, and got this error: Screen Shot 2021-02-04 at 14 07 22

I am running macOS Big Sur 11.2 on MacBook Pro 13-inch, 2020.

Java version:

openjdk version "11.0.9.1" 2020-11-04 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.9.1+1) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.9.1+1, mixed mode)

hqnghi88 commented 3 years ago

Dear, It seems to have problem with the packages. I verify and let you know later. Thanks.

hqnghi88 commented 3 years ago

Dear, can you retry https://github.com/gama-platform/gama/releases/download/1.8.2/GAMA_1.8.2_Alpha_Mac_01.31.21_70052748.zip i uploaded a new zip package. Well see,.. Cheers.

arturgalenom commented 3 years ago

Well, I had the same problem again. :(

hqnghi88 commented 3 years ago

OK, please wait a bit. @AlexisDrogoul please, can you reupload the package for macos (that has been tested with the attribute +x). The current package is produced on a linux system (and the previous is made by GithubAction - means linux also) , i verified that it has +x, but it seems not be enough.

AlexisDrogoul commented 3 years ago

Hi. @arturgalenom, can you try not uncompressing it automatically but with BetterZip, for instance ?

arturgalenom commented 3 years ago

Hi @AlexisDrogoul extracting with BetterZip 5.0.3 worked fine! But I've got another problem, I think it's not related to this topic, but I am putting here.

The application only worked when executed with Java 15. Executing with Java 11, I got this exception:

Caused by: java.lang.UnsupportedClassVersionError: msi/gama/application/Application has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 55.0

The release notes say that is compatible with Java 11+.

Thanks for your help guys.

AlexisDrogoul commented 3 years ago

Discussion continues on #3084.