java-matlab
mac 环境
- java 1.8
- R2019b (9.7)
- macos Mojave 10.14.6
本地运行
- 下载 MATLAB Runtime 下载地址
- 将 MATLAB jar 引入到项目里
- 就可使用 jar 的类和方法
安装 MATLAB Runtime
- centos 7.6
- wget https://ssd.mathworks.com/supportfiles/downloads/R2019b/Release/9/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R2019b_Update_9_glnxa64.zip
- unzip -d MATLAB MATLAB_Runtime_R2019b_Update_9_glnxa64.zip
- cd MATLAB/
- ./install -mode silent -agreeToLicense yes
- macos Mojave 10.14.6
- 可视化界面点击即可
设置环境变量
- 可视化界面点击即可
- centos 7.6
- vim ~/.bash_profile
- 设置变量
1
2
3
4
5
6
7
8
9
10
11export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}\
/usr/local/MATLAB/MATLAB_Runtime/R2022b/runtime/glnxa64:\
/usr/local/MATLAB/MATLAB_Runtime/R2022b/bin/glnxa64:\
/usr/local/MATLAB/MATLAB_Runtime/R2022b/sys/os/glnxa64:\
/usr/local/MATLAB/MATLAB_Runtime/R2022b/extern/bin/glnxa64"
<!-- 本机设置 -->
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}\
/usr/local/MATLAB/MATLAB_Runtime/v97/runtime/glnxa64:\
/usr/local/MATLAB/MATLAB_Runtime/v97/bin/glnxa64:\
/usr/local/MATLAB/MATLAB_Runtime/v97/sys/os/glnxa64:\
/usr/local/MATLAB/MATLAB_Runtime/v97/extern/bin/glnxa64"
- mac
- vim ~/.bash_profile
- 设置变量
1
2
3
4
5
6
7
8
9
10
11export DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH:+${DYLD_LIBRARY_PATH}:}\
<MATLAB_RUNTIME_INSTALL_DIR>/runtime/maci64:\
<MATLAB_RUNTIME_INSTALL_DIR>/bin/maci64:\
<MATLAB_RUNTIME_INSTALL_DIR>/sys/os/maci64:\
<MATLAB_RUNTIME_INSTALL_DIR>/extern/bin/maci64"
<!-- 本机设置 -->
export DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH:+${DYLD_LIBRARY_PATH}:}\
/Applications/MATLAB/MATLAB_Runtime/v97/runtime/maci64:\
/Applications/MATLAB/MATLAB_Runtime/v97/bin/maci64:\
/Applications/MATLAB/MATLAB_Runtime/v97/sys/os/maci64:\
/Applications/MATLAB/MATLAB_Runtime/v97/extern/bin/maci64"