尝试在Octave中安装java-package。
octave:4> pkg install java-1.2.9.tar.gz
但是我收到了这个错误?
Error while trying to install Java package:
environment variable 'JAVA_HOME' has not been set.
use 'setenv ("JAVA_HOME", "/full/path/to/javaJDK")'
Hint:
JAVA_HOME should usually be set such that either:
(on *nix:)
<JAVA_HOME>/jre/lib/<arch>/client/ contains libjvm.so (file or symlink)
(on OSX:)
<JAVA_HOME>/../Libraries/ contains a file libclient.dylib
(on Windows:)
<JAVA_HOME>/jre/lib/<arch>/ contains a file jvm.cfg
(<arch> depends on your system hardware, can be i386, x86_64, alpha, arm, ...)
Use forward slashes as path separator, also on Windows
Aborting pkg install
error: called from 'pre_install' in file /tmp/oct-Ssqypw/java/pre_install.m near line 115, column 5
error: called from:
error: /usr/share/octave/3.6.4/m/pkg/pkg.m at line 834, column 5
error: /usr/share/octave/3.6.4/m/pkg/pkg.m at line 383, column 9
然后尝试将以下内容添加到/usr/share/octave/site/m/startup/octaverc
setenv ("JAVA_HOME", "/usr/lib/jvm/java-6-openjdk/jre/lib/i386/client")
也
setenv ("JAVA_HOME", "/usr/lib/jvm/java-6-openjdk/jre/lib/i386/client/")
......但现在得到
八度:2 - ; pkg install java-1.2.9.tar.gz
Error while trying to install Java package:
JAVA_HOME environment variable does not properly point to a JDK
Hint:
JAVA_HOME should usually be set such that either:
(on *nix:)
<JAVA_HOME>/jre/lib/<arch>/client/ contains libjvm.so (file or symlink)
(on OSX:)
<JAVA_HOME>/../Libraries/ contains a file libclient.dylib
(on Windows:)
<JAVA_HOME>/jre/lib/<arch>/ contains a file jvm.cfg
(<arch> depends on your system hardware, can be i386, x86_64, alpha, arm, ...)
Use forward slashes as path separator, also on Windows
Aborting pkg install
error: called from 'pre_install' in file /tmp/oct-o7N2Fa/java/pre_install.m near line 115, column 5
error: called from:
error: /usr/share/octave/3.6.4/m/pkg/pkg.m at line 834, column 5
error: /usr/share/octave/3.6.4/m/pkg/pkg.m at line 383, column 9
我也尝试过:sudo ln -s /usr/lib/jvm/java-6-openjdk/jre/lib/i386/client /usr/lib/jvm/java-6-openjdk/jre/lib/i386/server
基于此链接:http://octave.1599824.n4.nabble.com/Installing-JAVA-for-octave-td4650491.html