The best and the easiest way to check if Java is being installed on your system is by using the Command Prompt on Windows or Terminal if you're on Mac OS X or any other Linux/Unix flavor.
macOS / Linux / Unix :Open Terminal and type the following command :
$ java -version
If java is being installed on the system you will get a response with the version details,
$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
$

Mac OS X check java installed version using terminal.png
On Windows: XP/7/Vista/8/10
Open Command Prompt and type the following command,
c:\> java -version
If it is installed you should get the ver details as the response of the command,
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) Client VM (build 23.25-b01, mixed mode, sharing)
The other ways to check if Java is installed :
For Windows XP- Click on Start.
- Now Select Control Panel
- Under Control Panel → Add/Remove Programs
- Check in Add/Remove control panel list of softwares installed contains Java with version.

Get Java version.png

Check java installed on Mac OS X.png
- Click on Start
- Now Select Control Panel
- Now Click on Programs and Features
- Check if there is Java version included.
- Goto Control Panel
- Under Control Panel select Programs
- Now Click Programs and Features
- Check if installed Java version is listed.
- Goto System Preferences (you can do a spotlight search to get there)
- Check if you can see Java Icon
- Click on the Java icon
- Click on About button to get the version details
More Posts related to Java,
- Add two numbers using Java Generics
- Convert Java List to Json String using Jackson
- Convert Java Object to JSON using Jackson Library
- Java SE JDBC: Insert with PreparedStatement Example
- [Program] How to read three different values using Scanner in Java
- Java JDBC Batch Update Example with PreparedStatement
- Java Stream flatmap() Examples
- Save Java Object as JSON file using Jackson Library
- Java get day of the week as an int using DayOfWeek
- Create Nested Directories using Java Code
- Java JDBC Delete a Record in Database Table using PreparedStatement
- List of jars required for Struts2 project
- Convert Java Object to XML using Jackson Library
- Struts2 : java.lang.ClassNotFoundException: org.apache.commons.fileupload.RequestContext
- Java JDBC Get Id of the Inserted Record with AutoIncrement
- How to list all tables using Java JDBC
- Java Jackson ObjectMapper Class with Examples
- Fix: Maven - Failed to execute goal - Compilation failure - Source/Target option 5 is no longer supported. Use 7 or later
- Eclipse : The type java.lang.CharSequence cannot be resolved. Indirectly referenced from required .class files
- Formatting Double in Java [Examples]
- How to run Java Unit Test cases with Apache Maven?
- [fix] NullPointerException Cannot Invoke findById because Repository is null - Java Spring
- [Fix] java: integer number too large compilation error
- [Java] Read a File with UTF-8 Encoding
- How to detect Operating System using Java code
More Posts:
- Git Commit - Author identity unknown, Please tell me who you are email - Git
- Fix: Microsoft OneDrive We are currently experiencing technical difficulties - Microsoft
- Display ls command file sizes in KB (kilobytes) MB (megabytes) or GB (gigabytes) [Linux/macOS] - MacOS
- You're not on Teams yet, but you can set it up for your organization. [Microsoft Teams Login Error] - Microsoft
- How to create a circular Image using pure CSS Code - CSS
- auth_client_using_bad_version_title : Error Android Lint - Android
- Cannot access Windows application shortcuts on Start menu and Taskbar - Windows
- Find Covid-19 Vaccine centers on macOS or iOS Maps App - News