# Processing 4.x + IntelliJ - How to properly debug a custom library

**URL:** https://discourse.processing.org/t/processing-4-x-intellij-how-to-properly-debug-a-custom-library/40519
**Category:** Development
**Created:** [January 9, 2023, 9:58am UTC](https://discourse.processing.org/t/processing-4-x-intellij-how-to-properly-debug-a-custom-library/40519 "2023-01-09T09:58:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![haschdl](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/haschdl/32/1082_2.png) [@haschdl](https://discourse.processing.org/u/haschdl)
#### Post date: [January 9, 2023, 9:58am UTC](https://discourse.processing.org/t/processing-4-x-intellij-how-to-properly-debug-a-custom-library/40519/1 "2023-01-09T09:58:25Z")

</div>

I’m looking for a better debugging experience to make my library more robust. This is about developing libraries for processing using IntelliJ (\*). It is not about debugging a sketch running in Processing.

I would like to set breakpoints in the code and have the execution halts at such breakpoints.  
Here is what I tried:

- Start PDE, open a sketch that uses the custom library, run the sketch.
- From IntelliJ, Run \> Attach to Process. Select the process for the running sketch.

Result: Error.

```auto
Error running 'localhost:8070': Unable to open debugger port (127.0.0.1:8070): java.net.ConnectException "Connection refused (Connection refused)"

```

(\*) I assume the question would apply to Eclipse but I can’t say for sure.

_emphasized text_
