Java + Spring development environment construction with VirtualBox + Ubuntu (Xfce4)

Preface

It is convenient to have one Linux environment that can be broken, so prepare it. Xfce4 is adopted because it is relatively light in the desktop environment of Ubuntu.

goal

We aim to be able to develop Java + Spring web applications on Ubuntu.

Assumption: My environment

Environment construction procedure

VirtualBox DL

https://www.virtualbox.org/wiki/Downloads

Ubuntu image DL

https://www.ubuntulinux.jp/download

VM initial settings

When creating a new

Change HDD to 10GB-> 32GB

After new creation

Major items Medium item Sub-item
General Altitude Clipboard sharing: bidirectional
General Altitude Drag and drop: bidirectional
system Motherboard Main memory: 8192MB
system Motherboard Boot order: Remove floppy
system Motherboard Chipset: ICH9
system processor Number of processors: 2
system Acceleration Paravirtualized interface: KVM
display screen Video memory: 256MB
display screen Number of displays: 1
display screen Acceleration: Enable
display screen Acceleration: Enable
storage controller:IDE * Only at initial startup: Ubuntu iso image that has been downloaded
Shared folder Select a folder for sharing Check the mount

Ubuntu installation

After starting the VM, follow the on-screen instructions to install. Select Japanese in the first language selection. -> Reboot

Various settings of Ubuntu

Complete update support and Guest Addition installation.

Install Xfce4

#Install Synaptic Package Manager
$ sudo apt install synaptic

#Kill the conky process
$ killall conky

#In the search window`xfce4`And install the following
・ Xfce4
・ Xfce4-goodies

-> Reboot

Ubuntu (Xfce4) boot

On the login screen, select the xfce4 session from the * mark and log in.

Japanese setting (Option)

See IBus-Mozc: http://www.fuukemn.biz/page74-ubuntu-xfce.html

User subordinates in English

$ LANG=C xdg-user-dirs-gtk-update

Install various development tools

Commands

Java / SDKMAN Official: https://sdkman.io/install Official: https://sdkman.io/jdks

#Installing SDKMAN
$ curl -s "https://get.sdkman.io" | bash
$ source "$HOME/.sdkman/bin/sdkman-init.sh"

#Java installation
$ sdk list java
$ sdk install java

* Maven and Grade are OK with this
$ sdk install maven
$ sdk install gradle

VSCode Official: https://code.visualstudio.com/docs/setup/linux

$ curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
$ sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/
$ sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'

$ sudo apt-get install apt-transport-https
$ sudo apt-get update
$ sudo apt-get install code

Git / Github

#Installation
$ sudo apt install git

#Initial setting
$ git config --global user.name "ottoman"
$ git config --global user.email "[email protected]"

#ssh key generation&Register on Github
$ cd ~/.ssh(If not, make)
$ ssh-keygen -t rsa
 ->Public key(id_rsa.pub)Register the contents on Github

#commit editor to vim
$ git config --global core.editor vim

SpringToolSuite (STS) + Japanese localization

Installation

Official: Download and unzip from https://spring.io/tools * This time sts-4.6.1.RELEASE

#Create a directory for STS under opt
$ sudo mkdir /opt/sts

#Placement
$ cp -r sts-4.6.1.RELEASE /opt/sts/

Create a boot shell

sts.sh


#!/bin/bash
JDK_VERSION=11.0.7.hs-adpt
STS_VERSION=4.6.1

export JAVA_HOME=/home/swat/.sdkman/candidates/java/$JDK_VERSION
export PATH=$PATH:$JAVA_HOME/bin

cd /opt/sts/sts-$STS_VERSION.RELEASE/
./SpringToolSuite4

Create launcher

Set to call the previous shell image.png

Localizing into Japanese

Official: Download the Linux version from https://mergedoc.osdn.jp/ image.png

#Sts the contents of features and plugins in the unzipped-4.6.1.Copy to RELEASE features and plugins
$ sudo cp -r ./features/jp.sourceforge.mergedoc.pleiades/ /opt/sts/sts-4.6.1.RELEASE/features/
$ sudo cp -r ./plugins/jp.sourceforge.mergedoc.pleiades/ /opt/sts/sts-4.6.1.RELEASE/plugins/

#Add the following to the ini file(sts-4.6.1.RELEASE/SpringToolSuite4.ini)
-Xverify:none
-javaagent:plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar

If you start it with this, it will be in Japanese image.png

Postman installation

sudo snap install postman

NVM / Node.js (bonus)

Official: https://github.com/nvm-sh/nvm#install--update-script

#NVM installation
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

# .Check bashrc
$ cat .bashrc | grep -A3 'export NVM_DIR'
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

# .Reflect bashrc
$ source ~/.bashrc

#Check the version of nvm
$ nvm --version
0.35.3

# Node.js installation
$ nvm ls-remote
$ nvm install v12.16.3

Finally

I might put something like this

--DB client

Recommended Posts

Java + Spring development environment construction with VirtualBox + Ubuntu (Xfce4)
Spring Boot + Docker Java development environment construction
java development environment construction
[Environment construction] Build a Java development environment with VS Code!
Prepare Java development environment with Atom
Java web application development environment construction with VS Code (struts2)
Build WebAPP development environment with Java + Spring with Visual Studio Code
[Java development environment construction] Install OpenJDK 11 (Java 11) on macOS with Homebrew.
Prepare Java development environment with VS Code
Laravel development environment construction with Docker (Mac)
Java development environment construction memo on Mac
Environment construction with Docker (Ubuntu20.04) + Laravel + nginx
Java environment construction
Create Spring Boot-gradle-mysql development environment with Docker
Java development environment
[Spring] Environment construction
Introduction to Java development environment & Spring Boot application created with VS Code
Spring Boot environment construction with Docker (January 2021 version)
[Jakarta EE 8 application development with Gradle] 1. Environment construction
[Java] Build Java development environment on Ubuntu & check execution
JAVA + STS (Spring Tool Suite) environment construction procedure
Wordpress local environment construction & development procedure with Docker
Create a Spring Boot development environment with docker
Build a Java development environment with VS Code
[Flutter] Ubuntu 20.04 environment construction
Java development environment memo
Build Java development environment with VS Code on Mac
Java development environment construction on Mac-JDK Install (2020 preservation version)
[Mac] VS Code development environment construction (Java, Gradle, Node.js)
Stable development environment construction manual for "Rails6" with "Docker-compose"
[Java] Environment construction procedure for developing struts 1.3 with Eclipse
Build Java development environment with WSL2 Docker VS Code
How to build Java development environment with VS Code
Prepare the environment for java11 and javaFx with Ubuntu 18.4
Build Java program development environment with Visual Studio Code
Database environment construction with Docker in Spring boot (IntellJ)
Java development environment construction (Mac + Pleiades All in One Eclipse 4.7 + Spring Boot + Gradle (Buildship))
[Spring Boot] Environment construction (macOS)
Java Config with Spring MVC
Java development environment (Mac, Eclipse)
JavaFX environment construction in Java 13
[Docker] Rails 5.2 environment construction with docker
Using Mapper with Java (Spring)
AtCoder Challenge Environment Construction (Java 8)
Docker × Spring Boot environment construction
Laravel environment construction (Ubuntu 18.04 LTS)
React environment construction with Docker
I tried to create a java8 development environment with Chocolatey
Web application development environment construction in Java (for inexperienced people)
Build a "Spring Thorough Introduction" development environment with IntelliJ IDEA
Case that gave up environment construction of react with ubuntu
Domain Driven Development with Java and Spring Boot ~ Layers and Modules ~
Create a Java and JavaScript team development environment (gradle environment construction)
Rails + MySQL environment construction with Docker
[Windows] WSL2 + Ubuntu + Node.js environment construction
Node.js environment construction with Docker Compose
[Eclipse Java] Development environment setting memo
Install java with Ubuntu 16.04 based Docker
Environment construction for Servlet application development
[Java] [Spring] [JavaScript] [gulp] [webpack] [uglify] Private AngularJS application development environment
Let's create Ubuntu environment with vmware