Linux下安装java
java官网下载最新版本jdk:jdk-8u91-linux-x64.tar.gz。
按照官网说明安装:JDK Installation for Linux Platforms
最后配置环境变量:编辑.bashrc
文件。
Linux服务器上java运行报错
1 | Error occurred during initialization of VM |
或者1
2Error occurred during initialization of VM
Could not reserve enough space for code cache
根据报错提示主要是运行内存不足造成,解决办法如下:1
set JAVA_OPTS=-Xms512m -Xmx512m -XX:MaxPermSize=256m
more:http://stackoverflow.com/questions/4401396/could-not-reserve-enough-space-for-object-heap