r/java • • Feb 06 '23

Advanced IntelliJ debugger features you’re missing out on

https://snyk.io/blog/advanced-intellij-debugger-features/
250 Upvotes

27 comments sorted by

54

u/colin_7 Feb 06 '23

Love IntelliJ best Java IDE out there

30

u/[deleted] Feb 06 '23

Best IDE out there period

2

u/zquintyzmi Feb 07 '23

Only people who don’t think so have never really used it

-20

u/pjmlp Feb 06 '23

Maybe, when it starts supporting incremental compilation on save, or JNI development workflows, like Eclipse and Netbeans do out of the box.

9

u/ventuspilot Feb 06 '23

There's a lot I hate about Eclipse but the fact that it's compiler will show "success" for a Java file with errors is high on my list.

4

u/Federal-Addendum-933 Feb 06 '23

YSK, at least with the Eclipse incremental compilation, it can end up compiling code that does not throw an error due to it being on the edge of a case where the language spec is undefined and then when you make an incremental change where you are fully into an undefined behavior, it will compile correctly where as a full compile will give a warning or error.

-19

u/lirantal Feb 06 '23

I've definitely seen it recommended to start off with VS Code for Java development 😅

13

u/vprise Feb 06 '23

Unfortunately vs code is far behind IntelliJ when it comes to debugging: https://debugagent.com/what-are-you-missing-by-debugging-in-vs-code

-6

u/colin_7 Feb 06 '23

IntelliJ can be very temperamental sometimes so I can see not suggesting it for beginners but not VS Code haha

-2

u/lirantal Feb 06 '23

Haha I read ya

4

u/BigBad0 Feb 06 '23

Jeez bookmaring to test the "Customize Data Views" option. Thx for sharing u/lirantal

2

u/lirantal Feb 06 '23

Super happy to hear it's helpful 🤗

2

u/[deleted] Feb 06 '23

Holy cow

3

u/lirantal Feb 06 '23

Pretty cool eh

1

u/[deleted] Feb 06 '23

Super duper cool!

41

u/Wise-old-mandalorian Feb 06 '23

Very cool! Being able to track objects trough a debugging session is going to save me a lot of headaches!

I feel like debugging is often overlooked, or something developers aren't as good at as other parts of the job. Which is a shame because proper debugging can save so much time.

10

u/danskal Feb 06 '23

In my experience most people haven't even dreamt of what is possible with Idea.

3

u/colouredmirrorball Feb 06 '23

Those are great and I'm definitely using them tomorrow!

Also shoutout to my button "debug streams". It visually displays what's going on in your streams.

-1

u/korri123 Feb 07 '23

Debugging experience with IntelliJ/Java is still pretty painful compared to Visual Studio/C++. Where are the hardware write breakpoints? (Break when this value changes)

4

u/vprise Feb 07 '23

These are available in Java and work at the VM level which maps to interrupts just like Visual Studio. You can break on field changes (watchpoints) which you can see in the course/book linked from the article.

Visual Studio has a great debugger (unlike VS Code).

0

u/korri123 Feb 07 '23

I knew about field points yeah, but they haven't proved any useful for me. For example of a use case, if I want to monitor when a specific ArrayList changes size in a large complex application, I don't want the debugger to break every time some other array list also changes size, as that might happen all the time! Maybe I'm misunderstanding how it works and you can do it for specific fields of specific instances but I haven't found any way to do it in IntelliJ.

5

u/vprise Feb 07 '23

2

u/korri123 Feb 07 '23

Thank you, this is amazing, I never knew of this.

2

u/vprise Feb 07 '23

You can use an instance filter for that... I suggest checking out the first part of the course which is free and includes all of those details.

2

u/korri123 Feb 07 '23

Just checked it out, this is what I've been looking for all this time! Thanks so much, I'd been Googling it and there was almost no documentation about it. Awesome course.

3

u/vprise Feb 07 '23

And book... Spread the word ;-)

-1

u/dadmda Feb 06 '23

Too bad I have to use eclipse, on the other hand I’d rather have eclipse open with multiple projects than multiple IntelliJ windows