Skip to content

Create and visualize static call graphs of Spring/Java applications

Notifications You must be signed in to change notification settings

marcello-dev/java-call-graph-plotter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Call Graph Plotter

This project allows generating and visualizing static call graphs for Spring/Java applications.

Installation

After cloning the repository, create a Python 3.8 virtual environment in the project folder:

python -m venv .venv

Activate the virtual environment and install the dependencies:

source .venv/bin/activate
pip install -r requirements.txt

Usage

Create a call graph from your Jar:

java -jar javacg/javacg-0.1-SNAPSHOT-static.jar your-jar.jar > call-graph.txt

If you just want to test how it works, you can use the example jar in the folder target-jar:

java -jar javacg/javacg-0.1-SNAPSHOT-static.jar target-jar/demo-customer-0.0.1-SNAPSHOT.jar > call-graph.txt

Now create the graph by running:

python callgraphplotter.py call-graph.txt ApiDBSelector

A new graph will be created in the folder output. It's a html file so you can open it in the browser. If you used the example jar, this is what you should see in the browser: Graph in the browser

More info

See the full article on Medium.

About

Create and visualize static call graphs of Spring/Java applications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages