2
votes

I am trying to install MATLAB on my Fedora 22. At the end, I get an error

The application encountered an unexpected error and needs to close. You may want to try re-installing your product(s). More information can be found at /tmp/mathworks_root.log

When I look in mathworks_root.log file, I see that Java Home is not set properly during installation step

Java Home /tmp/mathworks_32206/sys/java/jre/glnxa64/jre

although I set this environment variable, output of this command

echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-40.b14.fc22.x86_64/jre/bin/java

Do you know, why this happens?

Thanks!

1
JAVA_HOME should be only till '/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-40.b14.fc22.x86_64'Sajan Chandran
Set your JAVA_HOME correctly...its not correctRajesh
I did it, and same thing happens.user3616359

1 Answers

1
votes

It is clear that your installation script doesn't know which java to use. Maybe it doesn't recognise the $JAVA_HOME variable? Try running the command java -version, it should output you the java version if the command is recognised. Depending on what the command returns I'd try the following:

  1. If you get a correct response from java -version run the installation script again in a new shell session. Try looking at the script itself, maybe it requires some specific version of java?
  2. If you don't get a correct response, make sure your java is installed in some directory, and instead of specifying the $JAVA_HOME simply add an alias to this command in some system folder. My setup is this:

    • various JDKs in /opt/ folder:

    /opt> ls -l drwxr-xr-x 8 kmejka kmejka 4096 kwi 10 20:53 jdk1.7.0_79/ drwxr-xr-x 8 kmejka kmejka 4096 gru 18 2014 jdk1.8.0_31/

    • symlink /opt to the jdk I want to use globally:

    kmejka@kmejka-work /opt> ll jdk lrwxrwxrwx 1 root root 17 cze 26 14:20 jdk -> /opt/jdk1.8.0_31//

    • symlinks in /usr/bin to all the needed java commands (you need at least the command ```java``, I've got more of them:

    kmejka@kmejka-work /opt> ll /usr/bin/java* lrwxrwxrwx 1 root root 17 lut 1 12:05 /usr/bin/java -> /opt/jdk/bin/java* lrwxrwxrwx 1 root root 18 lut 1 12:05 /usr/bin/javac -> /opt/jdk/bin/javac* lrwxrwxrwx 1 root root 18 lut 1 12:06 /usr/bin/javah -> /opt/jdk/bin/javah* lrwxrwxrwx 1 root root 18 lut 1 12:05 /usr/bin/javap -> /opt/jdk/bin/javap*

This setup gives me flexibility to easily change the java version that I need - just switch the symlink!