Normally Spring Boot comes with Tomcat, and Java itself runs on the JVM, so you can work locally, but I created an environment on Vagrant to operate another tool from Java.
OpenJDK 11 Maven 3.6.3 CentOS 7
JDK
yum update -y nss curl libcurl //Update because it is old
touch /etc/yum.repos.d/adoptopenjdk.repo
echo [AdoptOpenJDK] >> /etc/yum.repos.d/adoptopenjdk.repo
echo name=AdoptOpenJDK >> /etc/yum.repos.d/adoptopenjdk.repo
echo baseurl=https://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/centos/7/x86_64 >> /etc/yum.repos.d/adoptopenjdk.repo
echo enabled=1 >> /etc/yum.repos.d/adoptopenjdk.repo
echo gpgcheck=1 >> /etc/yum.repos.d/adoptopenjdk.repo
echo gpgkey=https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public >> /etc/yum.repos.d/adoptopenjdk.repo
yum -y install adoptopenjdk-11-openj9.x86_64
java -version
Maven
wget http://ftp.yz.yamagata-u.ac.jp/pub/network/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
tar xf apache-maven-3.6.3-bin.tar.gz -C /opt
ln -s /opt/apache-maven-3.6.3/ /opt/maven
touch /etc/profile.d/maven.sh
echo "export JAVA_HOME=/usr/lib/jvm/adoptopenjdk-11-openj9" >> /etc/profile.d/maven.sh
echo "export M2_HOME=/opt/maven" >> /etc/profile.d/maven.sh
echo "export MAVEN_HOME=/opt/maven" >> /etc/profile.d/maven.sh
echo 'export PATH=${M2_HOME}/bin:${PATH}' >> /etc/profile.d/maven.sh
rm apache-maven-3.6.3-bin.tar.gz
$ mvn spring-boot:run
If I mounted the source on Vagrant with rsync and installed Spring Boot Devtools, I could do hot reload, so I could move it comfortably.
https://knasmueller.net/spring-boot-development-environment-virtualbox
Recommended Posts