Core Java

Java Visualizer Tutorial

1. Overview

We look at the Java Visualizer Plugin of IntelliJ IDE in this article. The integrated development environment has an editor, compiler, interpreter, and debugger. They can be used from a user interface for developing applications for the web and mobile. Java visualizer is a plugin for IntelliJ IDE to look at the code execution steps during debugging and check the values of the variables on the path of execution.

2. Java Visualizer

2.1 Prerequisites

Java 8 is required on the Linux, windows, or Mac operating system. IntelliJ Idea Ultimate 2019.1 is necessary on the operating system which you want to execute the code.

2.2 Download

You can download Java 8 from the Oracle website. IntelliJ Idea Ultimate 2019.1 is available at this link.

2.3 Setup

2.3.1 IntelliJ Setup

The IntelliJ idea-2019.1.3.dmg can be downloaded as the macOS Disk Image file. You can mount the disk image file as a disk in the Mac. Ensure that you have copied the IntelliJ IDEA to the Applications folder

2.4 Launching IDE

2.4.1. IntelliJ

The IntelliJ idea has the functionality to improve efficiency and the programmer’s productivity. The IDE has features related to coding assistance and supplementary tools. Click on the IntelliJ Idea icon to launch the IDE. The welcome screen comes up as shown above.

IntelliJ Welcome

The screen pops up where you need to create a new project. The screenshot is attached below:

IntelliJ Create New Project

You can create a new project and select the Java Project. It is shown below in the attached screenshot.

IntelliJ Project Setting

You can create a Java HelloWorld project. The selection can be done as shown in the picture below:

Intellij Java Hello World

The project workspace screen comes up. The screenshot is as shown below:

Intellij Hello World

2.5 What is a java visualizer?

Java visualizer is a tool to visualize the call stack and objects on the heap. This plugin is used during the debugging of Java applications.

2.6 How do we use a java visualizer?

This plugin is used for visualizing java code execution and its call stack. This helps during debugging and stepping through the code while setting breakpoints. Java visualizer shows the stack of the current debugging program.

2.7 How we can install and execute a visualizer plugin in IntelliJ ?

To start with, IntelliJ can be started as an application by clicking on the icon. From the preferences -> plugins, you can search for java visualizer as shown in the screenshot below:

java visualizer - intellij plugins
IntelliJ Plugins

You can click on the green button to install the visualizer plugin.

Intellij Plugin Accept

The plugin gets downloaded and installed. You can restart the IntelliJ IDE and look at sample code shown below.

IntelliJ Debug

A breakpoint is set on the print statement within the for a loop. Now start debugging the application. Click on the Java visualizer. You can see the call stack as the for loop steps through from 0 to 9.

IntelliJ Debug i=0

You can see the value 9 as the for loop reaches the end of the loop.

java visualizer - intellij debug i=9
IntelliJ Debug i=9

3. Download the Source Code

Download
You can download the full source code of this example here: Java Visualizer Tutorial

Bhagvan Kommadi

Bhagvan Kommadi is the Founder of Architect Corner & has around 20 years’ experience in the industry, ranging from large scale enterprise development to helping incubate software product start-ups. He has done Masters in Industrial Systems Engineering at Georgia Institute of Technology (1997) and Bachelors in Aerospace Engineering from Indian Institute of Technology, Madras (1993). He is member of IFX forum,Oracle JCP and participant in Java Community Process. He founded Quantica Computacao, the first quantum computing startup in India. Markets and Markets have positioned Quantica Computacao in ‘Emerging Companies’ section of Quantum Computing quadrants. Bhagvan has engineered and developed simulators and tools in the area of quantum technology using IBM Q, Microsoft Q# and Google QScript. He has reviewed the Manning book titled : "Machine Learning with TensorFlow”. He is also the author of Packt Publishing book - "Hands-On Data Structures and Algorithms with Go".He is member of IFX forum,Oracle JCP and participant in Java Community Process. He is member of the MIT Technology Review Global Panel.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
Back to top button