在linux操作系统下配置相关JavaEE的开发环境

  1. 新建文件夹/opt/mysql,并cd进去
  2. 运行wget http://dev.mysql.com/get/mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar,下载mysql安装包

PS:centos7.6自带的类mysql数据库是mariadb,会跟mysql冲突,要先删除。

  1. 运行tar -xvf mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar
  2. 运行rpm -qa|grep mari,查询mariadb相关安装包
  1. 运行rpm -e --nodeps mariadb-libs,卸载
  2. 然后开始真正安装mysql,依次运行以下几条

rpm -ivh mysql-community-common-5.7.26-1.el7.x86_64.rpm

rpm -ivh mysql-community-libs-5.7.26-1.el7.x86_64.rpm

rpm -ivh mysql-community-client-5.7.26-1.el7.x86_64.rpm

rpm -ivh mysql-community-server-5.7.26-1.el7.x86_64.rpm

  1. 运行systemctl start mysqld.service,启动mysql
  2. 然后开始设置root用户密码

Mysql自动给root用户设置随机密码,运行grep "password" /var/log/mysqld.log可看到当前密码

  1. 运行mysql -u root  -p,用root用户登录,提示输入密码可用上述的,可以成功登陆进入mysql命令行
  2. 设置root密码,对于个人开发环境,如果要设比较简单的密码(生产环境服务器要设复杂密码),可以运行

set global validate_password_policy=0;  提示密码设置策略

(validate_password_policy默认值1,)

  1. set password for 'root'@'localhost' =password('hspedu100');
  2. 运行flush privileges;使密码设置生效

 

Manager_N.class
idea-IU-202.7660.26/jbr/lib/modular-sdk/modules_libs/jcef/libjcef.so
idea-IU-202.7660.26/jbr/lib/modular-sdk/modules_src/jcef/module-info.java
idea-IU-202.7660.26/jbr/lib/modules
idea-IU-202.7660.26/jbr/lib/psfont.properties.ja
idea-IU-202.7660.26/jbr/lib/psfontj2d.properties
idea-IU-202.7660.26/jbr/lib/security/blacklisted.certs
idea-IU-202.7660.26/jbr/lib/security/cacerts
idea-IU-202.7660.26/jbr/lib/security/default.policy
idea-IU-202.7660.26/jbr/lib/security/public_suffix_list.dat
idea-IU-202.7660.26/jbr/lib/server/Xusage.txt
idea-IU-202.7660.26/jbr/lib/server/libjsig.so
idea-IU-202.7660.26/jbr/lib/server/libjvm.so
idea-IU-202.7660.26/jbr/lib/snapshot_blob.bin
idea-IU-202.7660.26/jbr/lib/swiftshader/libEGL.so
idea-IU-202.7660.26/jbr/lib/swiftshader/libGLESv2.so
idea-IU-202.7660.26/jbr/lib/tzdb.dat
idea-IU-202.7660.26/jbr/lib/v8_context_snapshot.bin
idea-IU-202.7660.26/jbr/release
idea-IU-202.7660.26/product-info.json
idea-IU-202.7660.26/plugins/Kotlin/kotlinc/bin/kotlin
idea-IU-202.7660.26/plugins/Kotlin/kotlinc/bin/kotlin-dce-js
idea-IU-202.7660.26/plugins/Kotlin/kotlinc/bin/kotlinc
idea-IU-202.7660.26/plugins/Kotlin/kotlinc/bin/kotlinc-js
idea-IU-202.7660.26/plugins/Kotlin/kotlinc/bin/kotlinc-jvm
idea-IU-202.7660.26/bin/format.sh
idea-IU-202.7660.26/bin/fsnotifier
idea-IU-202.7660.26/bin/fsnotifier64
idea-IU-202.7660.26/bin/idea.sh
idea-IU-202.7660.26/bin/inspect.sh
idea-IU-202.7660.26/bin/printenv.py
idea-IU-202.7660.26/bin/restart.py
idea-IU-202.7660.26/jbr/bin/jaotc
idea-IU-202.7660.26/jbr/bin/java
idea-IU-202.7660.26/jbr/bin/javac
idea-IU-202.7660.26/jbr/bin/jdb
idea-IU-202.7660.26/jbr/bin/jfr
idea-IU-202.7660.26/jbr/bin/jhsdb
idea-IU-202.7660.26/jbr/bin/jjs
idea-IU-202.7660.26/jbr/bin/jrunscript
idea-IU-202.7660.26/jbr/bin/keytool
idea-IU-202.7660.26/jbr/bin/pack200
idea-IU-202.7660.26/jbr/bin/rmid
idea-IU-202.7660.26/jbr/bin/rmiregistry
idea-IU-202.7660.26/jbr/bin/serialver
idea-IU-202.7660.26/jbr/bin/unpack200
idea-IU-202.7660.26/jbr/lib/chrome-sandbox
idea-IU-202.7660.26/jbr/lib/jcef_helper
idea-IU-202.7660.26/jbr/lib/jexec
idea-IU-202.7660.26/jbr/lib/jspawnhelper
[root@192 idea]# ls
ideaIU-2020.2.3.tar.gz  idea-IU-202.7660.26
[root@192 idea]# cd idea-IU-202.7660.26/
[root@192 idea-IU-202.7660.26]# ls
bin        help                   jbr  license  product-info.json
build.txt  Install-Linux-tar.txt  lib  plugins  redist
[root@192 idea-IU-202.7660.26]# cd bin/
[root@192 bin]# ls
appletviewer.policy  idea64.vmoptions  idea.svg        log.xml
format.sh            idea.png          idea.vmoptions  printenv.py
fsnotifier           idea.properties   inspect.sh      restart.py
fsnotifier64         idea.sh           libdbm64.so
[root@192 bin]# ./idea.sh 
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
8月 04, 2024 6:11:56 下午 java.util.prefs.FileSystemPreferences$1 run
信息: Created user preferences directory.
8月 04, 2024 6:11:56 下午 java.util.prefs.FileSystemPreferences$6 run
警告: Prefs file removed in background /root/.java/.userPrefs/prefs.xml
2024-08-04 18:11:58,293 [   1948]  ERROR - llij.ide.plugins.PluginManager - UI initialization failed 
com.intellij.ide.plugins.StartupAbortedException: UI initialization failed
	at com.intellij.idea.StartupUtil.lambda$prepareApp$3(StartupUtil.java:193)
	at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:986)
	at java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(CompletableFuture.java:970)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
	at com.intellij.idea.StartupUtil.lambda$scheduleInitUi$9(StartupUtil.java:373)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.util.concurrent.CompletionException: java.awt.AWTError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:346)
	at java.base/java.util.concurrent.CompletableFuture$BiRelay.tryFire(CompletableFuture.java:1423)
	... 10 more
Caused by: java.awt.AWTError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.
	at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
	at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:102)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:61)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:315)
	at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:101)
	at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:83)
	at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:129)
	at java.desktop/sun.awt.X11.XToolkit.<clinit>(XToolkit.java:231)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:315)
	at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:588)
	at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:583)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:582)
	at java.desktop/java.awt.Toolkit.getEventQueue(Toolkit.java:1499)
	at java.desktop/java.awt.EventQueue.invokeLater(EventQueue.java:1318)
	at com.intellij.idea.StartupUtil.lambda$scheduleInitUi$9(StartupUtil.java:324)
	... 7 more
2024-08-04 18:11:58,295 [   1950]  ERROR - llij.ide.plugins.PluginManager - IntelliJ IDEA 2020.2.3  Build #IU-202.7660.26 
2024-08-04 18:11:58,295 [   1950]  ERROR - llij.ide.plugins.PluginManager - JDK: 11.0.8; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o. 
2024-08-04 18:11:58,295 [   1950]  ERROR - llij.ide.plugins.PluginManager - OS: Linux 

Start Failed: Failed to initialize graphics environment

java.awt.AWTError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.
	at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
	at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:102)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:61)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:315)
	at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:101)
	at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:83)
	at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:129)
	at java.desktop/sun.awt.X11.XToolkit.<clinit>(XToolkit.java:231)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:315)
	at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:588)
	at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:583)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:582)
	at java.desktop/java.awt.Toolkit.getEventQueue(Toolkit.java:1499)
	at java.desktop/java.awt.EventQueue.invokeLater(EventQueue.java:1318)
	at com.intellij.idea.StartupUtil.lambda$scheduleInitUi$9(StartupUtil.java:324)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:834)

-----
JRE 11.0.8+10-b944.34 amd64 by JetBrains s.r.o.
/opt/idea/idea-IU-202.7660.26/jbr
[root@192 bin]# cd~
bash: cd~: 未找到命令...
[root@192 bin]# cd ~
[root@192 ~]# mkdir /opt/mysql
[root@192 ~]# cd /opt/mysql/
[root@192 mysql]# ls
mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar
[root@192 mysql]# tar -xvf mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar 
mysql-community-embedded-devel-5.7.26-1.el7.x86_64.rpm
mysql-community-libs-5.7.26-1.el7.x86_64.rpm
mysql-community-embedded-5.7.26-1.el7.x86_64.rpm
mysql-community-test-5.7.26-1.el7.x86_64.rpm
mysql-community-embedded-compat-5.7.26-1.el7.x86_64.rpm
mysql-community-common-5.7.26-1.el7.x86_64.rpm
mysql-community-devel-5.7.26-1.el7.x86_64.rpm
mysql-community-client-5.7.26-1.el7.x86_64.rpm
mysql-community-server-5.7.26-1.el7.x86_64.rpm
mysql-community-libs-compat-5.7.26-1.el7.x86_64.rpm

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值