JDK 22安装指南
JDK(Java Development Kit)是Java语言的软件开发工具包(SDK),主要用于开发Java应用程序。它是Java平台的核心部分,为Java开发者提供了全面的开发环境和工具。提供了Java开发所需的各种工具,如编译器(javac)、调试器(jdb)、性能分析工具(jconsole)等。这些工具帮助开发者编写、编译、调试和性能分析Java程序。
1.下载jdk
2.解压
3.解压后的文件夹移动到/usr/local并且改名
4.找到可执行文件
5.在profile中配置jdk环境变量P
将java的可执行文件添加到¥PATH环境变量中
配置JAVA_HOME=/usr/local/jdk1/
Source /profile
[root@localhost ~]# rz -E
rz waiting to receive.
[root@localhost ~]# yum remove *java* //移除所有与Java相关的软件包
[root@localhost ~]# tar -zxvf jdk-22_linux-x64_bin.tar.gz //解压安装包
[root@localhost ~]# ls
[root@localhost ~]# mv jdk-22.0.1 /usr/local/
[root@localhost ~]# ls /usr/local/
[root@localhost ~]# vi /etc/profile
[root@localhost ~]# source /etc/profile //当前shell会话重新读取并执行/etc/profile文件中的命令和设置
[root@localhost ~]# java -version
java version "22.0.1" 2024-04-16
Java(TM) SE Runtime Environment (build 22.0.1+8-16)
Java HotSpot(TM) 64-Bit Server VM (build 22.0.1+8-16, mixed mode, sharing)
[root@localhost ~]# cd /usr/local/
[root@localhost local]# ls
apache-tomcat-10.1.25 etc include lib libexec share
bin games jdk-22.0.1 lib64 sbin src
[root@localhost local]# cd jdk-22.0.1/ //进入到jdk-22.0.1
[root@localhost jdk-22.0.1]# ls
bin conf include jmods legal lib LICENSE man README release
[root@localhost jdk-22.0.1]# cd bin/ //进入到bin
[root@localhost bin]# ./java -jar /root/todolist.jar
Python环境
- pythonweb
- 人工智能环境
- 数据分析
Python2
With open(“a.txt”,”wb”)as f:
f.write(“writer”)
[root@localhost bin]# python2
Python 2.7.5 (default, Apr 11 2018, 07:36:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
[root@localhost bin]# python
Python 2.7.5 (default, Apr 11 2018, 07:36:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> with open("a.txt","wb")as f:
… f.write("python")
…
>>> ls
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'ls' is not defined
>>> os.listdir("./")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'os' is not defined
>>> os.listdir("./")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'os' is not defined
>>> import os
>>> os.listdir("./")
['jar', 'jarsigner', 'java', 'javac', 'javadoc', 'javap', 'jcmd', 'jconsole', 'jdb', 'jdeprscan', 'jdeps', 'jfr', 'jhsdb', 'jimage', 'jinfo', 'jlink', 'jmap', 'jmod', 'jpackage', 'jps', 'jrunscript', 'jshell', 'jstack', 'jstat', 'jstatd', 'jwebserver', 'keytool', 'rmiregistry', 'serialver', 'a.txt']
>>> quit()
[root@localhost bin]# python
Python 2.7.5 (default, Apr 11 2018, 07:36:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> with open("b.txt","wb") as f:
… f.write("我,秦始皇")
…
>>> ls
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'ls' is not defined
>>> import os
>>> os.listdir("./")
['jar', 'jarsigner', 'java', 'javac', 'javadoc', 'javap', 'jcmd', 'jconsole', 'jdb', 'jdeprscan', 'jdeps', 'jfr', 'jhsdb', 'jimage', 'jinfo', 'jlink', 'jmap', 'jmod', 'jpackage', 'jps', 'jrunscript', 'jshell', 'jstack', 'jstat', 'jstatd', 'jwebserver', 'keytool', 'rmiregistry', 'serialver', 'a.txt', 'b.txt']
>>> quit()
[root@localhost bin]#
作者:有你的晚安._