spring-jackson

  • 异常信息
    • jackson.databind.exc.InvalidDefinitionException cannot deserialize from Object value
  • 原因
    • 在该实体类中添加了一个为了方便实例化该类用的构造函数,导致JVM不会添加默认的无参构造函数,而jackson的反序列化需要无参构造函数,因此报错。
  • 解决
    • 补上一个无参构造器
  • 原理
    参考

java-matlab

mac 环境

  • java 1.8
  • R2019b (9.7)
  • macos Mojave 10.14.6

本地运行

  1. 下载 MATLAB Runtime 下载地址
  2. 将 MATLAB jar 引入到项目里
  3. 就可使用 jar 的类和方法

安装 MATLAB Runtime

  • centos 7.6
  • macos Mojave 10.14.6
  • centos 7.6
    • vim ~/.bash_profile
    • 设置变量
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      export 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
      11
      export 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"