Explain Java stack traces

Paste a Java stack trace, the exception and at lines a program prints when it crashes, and Vibe explains it in plain English: which exception stopped the program, which line of your code it came from, what Caused by: and ... 2 more mean, and where the real cause is.

stacktrace.txt

Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Anthropic to write the explanation. Don't paste keys or passwords. Common key formats are refused.

Vibe12 lines selected

Press Explain it for the sample, or paste your own code first.

What this Java stack trace sample shows

the first line
Exception in thread "main" means nothing caught the exception, so the main thread ended, and with no other threads running, the program stopped with exit code 1. Then come the exception's class, java.lang.IllegalStateException, and its message, Bad row 3 in orders.csv. That message is from the program's own code: inside a catch, line 19 of OrderLoader.java threw this exception in place of the one it caught.
frames
Each at line is a method that was still running, the newest first: OrderLoader.load at line 19 was called by Main.run at line 12, which was called by Main.main at line 8. Frames that start with java.base/ are inside Java's own library, like the 2 Integer.parseInt lines. The first frame from the program's own package, com.example.shop, is the place to start reading.
Caused by
Caused by: is the error that started it, printed because the code passed it along when it threw the new one. NumberFormatException: For input string: " 3" means Integer.parseInt got text that isn't a whole number, and the quotes show the space before the 3. Row 3 of orders.csv, counting the header as row 1 the way the message does, is A1002,TEE-M, 3, and split(",") keeps that space. The first frame from the program in this block, OrderLoader.parseQty at line 26, is the line that called parseInt.
... N more
... 2 more means the cause's last 2 frames are the same as the last 2 frames printed above it, Main.run and Main.main, so Java prints them once. The cause block ends at OrderLoader.load(OrderLoader.java:16), the line inside the try that called parseQty; line 19 in the first block is where the new exception was thrown.

Good to know

  • Run with OpenJDK 21.0.13.1 (Temurin) on Linux, in a test project with 3 files in the package com.example.shop and an orders.csv with a header line and 3 orders. Java prints file names and line numbers, not folders, so no paths appear.
  • Removing the space from row 3 printed 3 orders, 6 units and exited with code 0. So did keeping the space and changing line 26 to Integer.parseInt(raw.trim()).

Before you trust it: A catch block that throws a new exception can drop the cause. With e taken out of new IllegalStateException("Bad row " + (i + 1) + " in " + file.getFileName(), e), the program printed only the first 4 lines of the trace: the message and 3 frames, with no Caused by: and nothing about " 3". With e passed along, the cause and the line that failed were there. When an AI tool writes a catch that throws something new, check that the old exception is passed in.

Explain Java stack traces beside your editor

Unvibe is a free app for Mac and Windows. In the app there is no pasting: select code in any app and press Control+U (Ctrl+Alt+U on Windows).

Install on Mac

curl -fsSL https://unvibe.site/install.sh | bash

Paste into Terminal. Unvibe isn't notarized by Apple yet, so this is the smooth path.

No install warning? Use Unvibe in your browser

Opening the .dmg the first time
  1. Open the .dmg and drag Unvibe to Applications.
  2. Open it once; macOS says it can't verify it. Click Done, not the blue Move to Trash.
    macOS dialog: “Unvibe” Not Opened, with a blue Move to Trash button on top and Done under it
    Real screen, macOS 26. On macOS 15 the two buttons sit side by side.
  3. System Settings › Privacy & Security, scroll down to Security, then press Open Anyway. Confirm, then enter your Mac password. The button shows for about an hour after you try to open Unvibe.
    macOS Privacy & Security, Security section: Unvibe was blocked to protect your Mac, with the Open Anyway button
    Real screen, macOS 15

The Terminal line checks the download against the published SHA-256 and Unvibe's self-signed signature before it installs anything. More help with the first open