欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Ubuntu - 安装 Spring Tool Suite 4

程序员文章站 2022-04-22 23:49:33
...

Ubuntu - 安装 Spring Tool Suite 4

系统环境信息

Ubuntu 版本信息:

# lsb_release --all
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic

CPU 信息:

# more /proc/cpuinfo 
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 60
model name	: Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
stepping	: 3
microcode	: 0x27
cpu MHz		: 798.236
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clf
lush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_p
erfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 mon
itor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_dea
dline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibr
s ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep 
bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_m
ultihit
bogomips	: 5188.01
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 60
model name	: Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
stepping	: 3
microcode	: 0x27
cpu MHz		: 798.436
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 2
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clf
lush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_p
erfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 mon
itor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_dea
dline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibr
s ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep 
bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_m
ultihit
bogomips	: 5188.01
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

processor	: 2
vendor_id	: GenuineIntel
cpu family	: 6
model		: 60
model name	: Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
stepping	: 3
microcode	: 0x27
cpu MHz		: 801.740
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 1
cpu cores	: 2
apicid		: 2
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clf
lush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_p
erfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 mon
itor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_dea
dline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibr
s ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep 
bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_m
ultihit
bogomips	: 5188.01
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 60
model name	: Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
stepping	: 3
microcode	: 0x27
cpu MHz		: 960.518
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 1
cpu cores	: 2
apicid		: 3
initial apicid	: 3
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clf
lush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_p
erfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 mon
itor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_dea
dline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibr
s ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep 
bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_m
ultihit
bogomips	: 5188.01
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

内存信息:

# more /proc/meminfo 
MemTotal:        8066848 kB
MemFree:         6633836 kB
MemAvailable:    7327568 kB
Buffers:           50144 kB
Cached:           982832 kB
SwapCached:            0 kB
Active:           356924 kB
Inactive:         815312 kB
Active(anon):     238284 kB
Inactive(anon):    40788 kB
Active(file):     118640 kB
Inactive(file):   774524 kB
Unevictable:       97724 kB
Mlocked:               0 kB
SwapTotal:       9999356 kB
SwapFree:        9999356 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:        236908 kB
Mapped:           211096 kB
Shmem:            139828 kB
KReclaimable:      49796 kB
Slab:              86684 kB
SReclaimable:      49796 kB
SUnreclaim:        36888 kB
KernelStack:        5584 kB
PageTables:        19280 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    14032780 kB
Committed_AS:    1985744 kB
VmallocTotal:   34359738367 kB
VmallocUsed:       26616 kB
VmallocChunk:          0 kB
Percpu:             2784 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
CmaTotal:              0 kB
CmaFree:               0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB
DirectMap4k:      121600 kB
DirectMap2M:     5036032 kB
DirectMap1G:     3145728 kB

Java 版本信息:

# java -version
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)

下载 Spring Tool Suite

访问 https://spring.io/tools,下载 Linux 64-bit 版本:
Ubuntu - 安装 Spring Tool Suite 4

解压

下载完成之后,进入 Spring Tool Suite (STS) 所在目录,解压 STS:

# tar -zxvf spring-tool-suite-4-4.5.1.RELEASE-e4.14.0-linux.gtk.x86_64.tar.gz

解压之后,获得 sts-4.5.1.RELEASE:

# ls -l
-rw-r--r-- 1 root root 393504116 2月   7 20:02 spring-tool-suite-4-4.5.1.RELEASE-e4.14.0-linux.gtk.x86_64.tar.gz
drwxr-xr-x 9 root root      4096 1月  21 21:41 sts-4.5.1.RELEASE

将其复制到 /opt/ 目录下:

# cp -r sts-4.5.1.RELEASE /opt/

查看复制结果(第 5 行):

# ls -l /opt/
total 16
drwxr-xr-x 7 root root 4096 2月   7 11:33 jdk1.8.0_241
drwxr-xr-x 6 1001 1001 4096 1月   7 20:24 node-v12.14.1-linux-x64
drwxr-xr-x 9 root root 4096 2月   7 20:16 sts-4.5.1.RELEASE
drwxrwxr-x 5 mk   mk   4096 12月 26 10:31 Typora

通过终端启动 STS

须知:此时我是桌面环境下使用终端,使用普通用户。之前通过远程连接工具执行操作的,使用 root 用户。

进入 STS 所在目录:

$ cd /opt/sts-4.5.1.RELEASE/

查看该目录中的内容:

$ ll
total 1412
drwxr-xr-x  9 root root   4096 2月   7 20:16 ./
drwxr-xr-x  6 root root   4096 2月   7 20:16 ../
-rw-r--r--  1 root root 178549 2月   7 20:16 artifacts.xml
drwxr-xr-x  4 root root   4096 2月   7 20:16 configuration/
drwxr-xr-x  2 root root   4096 2月   7 20:16 dropins/
-rw-r--r--  1 root root     61 2月   7 20:16 .eclipseproduct
drwxr-xr-x 82 root root  12288 2月   7 20:16 features/
-rwxr-xr-x  1 root root 136129 2月   7 20:16 icon.xpm*
-rw-r--r--  1 root root  11522 2月   7 20:16 license.txt
drwxr-xr-x  2 root root   4096 2月   7 20:16 META-INF/
-rw-r--r--  1 root root 937589 2月   7 20:16 open-source-licenses.txt
drwxr-xr-x  4 root root   4096 2月   7 20:16 p2/
drwxr-xr-x 26 root root  61440 2月   7 20:16 plugins/
drwxr-xr-x  2 root root   4096 2月   7 20:16 readme/
-rwxr-xr-x  1 root root  61176 2月   7 20:16 SpringToolSuite4*
-rw-r--r--  1 root root    380 2月   7 20:16 SpringToolSuite4.ini

Ubuntu - 安装 Spring Tool Suite 4

启动 STS:

$ ./SpringToolSuite4

Ubuntu - 安装 Spring Tool Suite 4

第一次启动 STS,提示选择工作空间:
Ubuntu - 安装 Spring Tool Suite 4

选择工作空间之后,点击 Launch 启动:
Ubuntu - 安装 Spring Tool Suite 4

设置桌面启动方式

然而,我们不可能每次都通过终端启动 STS,这样太麻烦了。

所以,我们需要配置 STS 的桌面启动方式。

进入 /usr/share/applications/ 目录,创建一个 desktop 文件:

$ sudo vim spring-tool-suite-4.desktop

输入如下配置信息(具体配置请根据 STS 的安装情况修改):

[Desktop Entry]
Name=SpringToolSuite4
GenericName=IDE
GenericName[de]=IDE
Exec=/opt/sts-4.5.1.RELEASE/SpringToolSuite4
Terminal=false
Type=Application
Keywords=STS;IDE;
Icon=/opt/sts-4.5.1.RELEASE/icon.xpm
Categories=Utility;IDE;
StartupNotify=false

配置完成之后,就可以在 Show Applications 中找到 STS:
Ubuntu - 安装 Spring Tool Suite 4

相关标签: Ubuntu ubuntu