search
HomeOperation and MaintenanceLinux Operation and MaintenanceHow to check the version of jdk in linux
How to check the version of jdk in linuxNov 11, 2022 am 11:58 AM
linuxjavajdk

View method: 1. If the jdk environment variable is not set, you need to first use the cd command to enter the directory where the jdk is located, the syntax is "cd directory address", and then execute the "./bin/java -version" command. Get version information. 2. If the environment variable is set, directly execute "java -version" to obtain the version information.

How to check the version of jdk in linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

JDK is a software development kit in the Java language, mainly used for Java applications on mobile devices and embedded devices. JDK is the core of the entire Java development. It includes the JAVA running environment (JVM Java system class library) and JAVA tools. So how to check what version of jdk is in linux? Find out below.

How to check the jdk version in Linux

1. The jdk environment variable is not set

1. Check the directory where jdk is located on Linux

[root@centos6 ~]# echo $JAVA_HOME

Get the directory where jdk is located/usr/java/jdk1.7.0_80

2. Enter the directory where jdk is located

[root@centos6 ~]# cd /usr/java/jdk1.7.0_80

3. Run

[root@centos6 jdk1.7.0_80]# ./bin/java -version

The result is as shown in the figure:

How to check the version of jdk in linux

2. Set the environment variable

1. Execute

[root@centos6 usr]# java -version

in any directory. The result is as shown in the figure:

How to check the version of jdk in linux

Expand knowledge : Uninstall jdk

1. Determine the JDK version:

[root@centos6 lib]# rpm -qa|grep jdk
[root@centos6 lib]# rpm -qa | grep gcj

Possible results are:

jdk-1.7.0_80-fcs.x86_64
libgcj-4.4.7-3.el6.x86_64

2. Then uninstall:

[root@centos6 lib]# rpm -e --nodeps libgcj-4.4.7-3.el6.x86_64
# 或者
[root@centos6 lib]# rpm -e --nodeps jdk-1.7.0_80-fcs.x86_64

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of How to check the version of jdk in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
如何在 Windows 11 上安装 Java如何在 Windows 11 上安装 JavaApr 13, 2023 pm 09:22 PM

尽管每隔一段时间就会出现大量应用程序,但 Java 仍然是迄今为止最常用和最重要的编程语言之一。许多应用程序依赖于 Windows 操作系统上的 Java,更新它意味着通过为 Java 应用程序提供安全运行的稳定性和安全性来提高性能。您还可以在 Linux 和 macOS 平台上安装 Java。唯一的区别是每个平台的包/文件。现在,有了 Windows 11,是时候下载 Java,在今天的文章中,我们将带您完成在您的设备上安装它的简单步骤。我应该下载哪个版本的 Java?您下载的 Java 版本

java之JDK动态代理实例分析java之JDK动态代理实例分析Apr 30, 2023 pm 01:16 PM

1、说明Java中提供了一个动态代理类Proxy,Proxy并不是我们所说的代理对象的类,而是提供了一个创建代理对象的静态方法(newProxyInstance)来获取代理对象。2、实例publicclassHelloWorld{publicstaticvoidmain(String[]args){//获取代理对象ProxyFactoryfactory=newProxyFactory();SellTicketsproxyObject=factory.getProxyObject();proxyO

oracle数据库需要jdk吗oracle数据库需要jdk吗Jun 05, 2023 pm 05:06 PM

oracle数据库需要jdk,其原因是:1、当使用特定的软件或功能时需要包含在JDK中的其他软件或库;2、需要安装Java JDK才能在Oracle数据库中运行Java程序;3、JDK提供了开发和编译Java应用程序的功能;4、满足Oracle对Java函数的要求,以帮助实现和实现特定功能。

深度Linux系统安装JDK教程深度Linux系统安装JDK教程Feb 15, 2024 pm 12:36 PM

深度Linux系统是一款基于Linux内核的国产操作系统,具有稳定、安全、易用等特点,在深度Linux系统中,安装JDK(JavaDevelopmentKit)是开发Java应用程序的必要步骤,本文将详细介绍如何在深度Linux系统中安装JDK。安装步骤打开深度Linux系统的终端。使用命令行下载JDK安装包,命令如下:```shellsudoapt-getinstallopenjdk-11-jdk```等待下载完成后,系统会自动安装JDK。验证JDK是否安装成功,输入以下命令:```javaj

linux jdk目录在哪linux jdk目录在哪Mar 22, 2023 am 09:52 AM

linux jdk目录在bin目录下,具体查找方法是:1、通过“whereis java”命令找到javad的执行目录;2、通过执行文件找到链接文件;3、通过“ls -lrt /etc/alternatives/java”命令找到安装目录即可。

一起聊聊Java多线程之线程安全问题一起聊聊Java多线程之线程安全问题Apr 21, 2022 pm 06:17 PM

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于多线程的相关问题,包括了线程安装、线程加锁与线程不安全的原因、线程安全的标准类等等内容,希望对大家有帮助。

jdk怎么安装-jdk安装教程jdk怎么安装-jdk安装教程Mar 04, 2024 pm 05:10 PM

近期有很多小伙伴咨询小编jdk怎么安装,接下来就让我们一起学习一下jdk怎么安装的全部内容吧,希望可以帮助到大家。1、首先下载JDK安装文件,进入JDK安装界面,如图所示。2、单击“下一步”按钮,进入JDK自定义安装界面,如图所示。3、建议选择直接安装到默认目录,单击“下一步”按钮即可进行安装,如图所示。也可以单击“更改”按钮,自行选择安装目录。4、安装完毕后,弹出界面,单击“关闭”按钮即可,如图所示。上面就是小编为大家带来的jdk怎么安装的全部教程,希望对大家能够有所帮助哦。

Linux系统中jdk环境怎么配置Linux系统中jdk环境怎么配置May 12, 2023 am 09:31 AM

如下操作步骤为linux系统中部署jdk环境1.下载jdk安装包2.新建安装jdk文件夹(/usr/local/java/jdk)cd/usr/localmkdir/usr/local/javalocal目录下新建java目录cd/usr/local/javamkdir/usr/local/java/jdk新建jdk目录cd/usr/local/java/jdk3.上传jdk安装包到linux4.解压jdk安装包解压格式:tarzxvf压缩包名称后面的名称可以只输入一个首字母,然后使用Tab按键

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software