Problem with maximizing figure window in MATLAB 2016a

3 views (last 30 days)
After maximizing figure in MATLAB 2016a on my Linux machine, the figure window behaves weirdly. Mouse actions happen somewhere other than where they are intended to. Any idea? Attaching are the examples: zooming-in and selecting options.
svooo on 7 Aug 2017
Well, I submitted a bug report to Matlab and it turned out that some versions of Java doesn't play well with GTK due to some sort of bug in java. so changing the command to start matlab with the system java version solved the problem from me. the following I adopted from Arch wiki
MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre matlab
I tried both java-7-openjdk and java-8-openjdk, in both cases the issue disappeared

Sign in to comment.

Accepted Answer

svooo on 8 Aug 2017
As I mentioned in the comment, the problem is that some versions of java don't play well along gtk. in my case using the system java instead of the default java that comes with Matlab solves the issue. to start from the terminal you can use a command specified in the previous comment, otherwise you can modify the matlab.desktop file, by changing the exec line to the following
Exec=env MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre matlab -desktop
  1 Comment
Billa on 10 Aug 2017
Thank you very much for the answer. It solved the problem.

Sign in to comment.

More Answers (1)

Mahaveer Jain
Mahaveer Jain on 25 Mar 2019
The above solution work but in case if you get error at startup, you can use oracle Java (/usr/lib/jvm/oracle_jdk8) which I felt better experience than openjdk.


Find more on Desktop in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!