From ArchWiki
Jump to: navigation, search

Compatibility with Java 7

Whereas this page claims that versions of MATLAB earlier than R2013a are not compatible with Java 7, I have installed and am running R2012a (the last version available for 32-bit Linux) on current 32-bit Arch Linux while having only jre7-openjdk installed without problem. It might be the case that this section needs a qualifier "on 64-bit" I presume or perhaps one that points out (in-)compatibility between MATLAB programs and to MATLAB external Java 7 software on the system, but it's not generally true that one needs to install anything else simply to run MATLAB R2012a.

In fact, except for R2013a and earlier on Mac OS X, MATLAB uses the JVM that it itself provides and which it installs in $MATLAB/sys/java/jre. For R2012a on 32-bit Linux, this is:

>> version -java

ans =

Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode

and I have yet to uncover any issue with this. Both while installing and running MATLAB I suppose one might need to be careful to not have any environment variables set that would tell the installer and/or MATLAB to not in fact use its own JVM (such as, from the above link, MATLAB_JAVA) but that's about it.

(I have moreover not encountered the need to install the here mentioned font packages xorg-fonts-100dpi, xorg-fonts-75dpi and xorg-fonts-type1; text within figures displays fine for me without them).

Rene (talk) 01:34, 4 May 2014 (UTC)

I use 64-bit MATLAB and have no idea what the issues with Java are. I can either use or not use the supplied java or my systems java-7-openjdk with all releases of 64-bit MATLAB between R2010b and R2014a.
I cannot resize the fonts in a figure, xlabel('BIG FONT', 'FontSize', 42); ylabel('small font', 'FontSize', 12); gives the same size font, in all 64-bit releases without xorg-fonts-100dpi installed on the X11 server. My system is running at 96 DPI according to xdpyinfo|grep resolution, so potentially/presumably xorg-fonts-75dpi might be needed on other systems
Dshub (talk) 13:06, 29 May 2014 (UTC)
Given that we now have confirmation from both 32 and 64-bit (*) the best thing might be to simply do away with that Java warning; I also have no idea what it's about. When googling, I did find people running into install time errors which they orginally blamed on a Java version mismatch, but which turned out to be no more than having a tmpfs on /tmp of insufficient size to host MATLAB's native JVM, which the installer copies to /tmp and runs from there -- at least for version R2012a.
As to the font issue; you're right: also no scaling with your example command for me... but in my case even without having any fixed fonts installed (system-wide). I know little about X11 font-issues other than not WANTING the old core fonts installed, and willl not try to comment on that issue further. Can't say I plot a lot anyway :-/
Would've been sort of good though if the original author of that section had been a bit more verbose about what exact problems he or she encountered...
(*) Well, I haven't tried running MATLAB with the system-native java-7-openjdk; if you want me to test, I can do so tommorow or day after.
Rene (talk) 13:33, 29 May 2014 (UTC)
I am heavily updating the wiki now. I also created a matlabAUR PKGBUILD on the AUR that hopefully will take care of some of the issues. As for the xorg stuff. I think I originated the solution a couple of years ago (i.e., I found the packages that I needed) at MATLAB answers, but never really tried to document it.
Dshub (talk) 16:51, 29 May 2014 (UTC)
Looks good to me. Unfortunately, it seems I cannot attach a file either here or on the AUR but I'm locally also using a PKGBUILD, and one that's rather less impressed with the mex/gcc version issue. Specifically, I simply remove the "validate_gcc" calls from (/opt/MATLAB/bin/) "mex" (line 1653) and "mbuild" (line 2372); works fine for MATLAB R2012a and gcc 4.9.0 at least.
A slight heads-up: I saw you install the .xpm icon for older versions of MATLAB and back when I was using Xfce, I had to convert that icon to a PNG since XPM icon rendering in the Xfce menu caused trouble: specifically, it wouldn't scale. In my current PKGBUILD, I do:
convert $srcdir/Matlab_Logo.png -resize ${RES}x${RES}\! $pkgdir/usr/share/icons/hicolor/${RES}x${RES}/apps/MATLAB.png
in which Matlab_Logo.png is [1]. My PKGBUILD depends on hicolor-icon-theme and gtk-update-icon-cache and I run
gtk-update-icon-cache -f -q -t /usr/share/icons/hicolor
from an install= install script; post_install, post_upgrade and post_remove hooks as usual. For RES I use 16, 22, 24, 32, 36, 48 and 64 given that I had those hicolor dirs already anyway, but just one is necessary (also with Xfce).
Rene (talk) 01:48, 30 May 2014 (UTC)