You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Clement Levallois <cl...@protonmail.com.INVALID> on 2020/12/29 11:05:04 UTC

Running a modular (JPMS) java project from NetBeans in debug mode?

Hi,

At the moment I run my jigsaw / JPMS project from the command line:
java --module-path mods/core --module net.clementlevallois.certificateapp.core

This works fine but this prevents me from using NetBeans debugging capabilities (line by line debugging in particular). How can I come back to NetBeans for launching my modular projects? (without maven plugins, just the equivalent of the command line above: java --module-path etc). Thx!

Clement Levallois
--

Re: Running a modular (JPMS) java project from NetBeans in debug mode?

Posted by Clement Levallois <cl...@protonmail.com.INVALID>.
Hi,
Thank you, your questions put me on the right track. I did what you suggested (right click and Debug) and met an error about missing javafx libs. I need to add the javafx plugin, add the javafx lib in NetBeans and basically follow the steps here: https://openjfx.io/openjfx-docs/#introduction

Still, the debugger was just "listening" without doing anything, the app was not running. I followed the further steps here to attach the debugger:
https://stackoverflow.com/questions/56197372/i-cant-debug-an-application-using-netbeans-11-with-javafx-12

And now everything is fine. Thx!

Clement

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday 29 December 2020 12:32, Geertjan Wielenga <ge...@googlemail.com.INVALID> wrote:

> What happens when you set a breakpoint in your code in NetBeans and right-click the project and choose Debug?
>
> You might need to look at the Debug action, after right-clicking the project, choosing Properties, and look in the Actions category to finetune the Debug action for your needs.
>
> Gj
>
> On Tue, 29 Dec 2020 at 12:21, Clement Levallois <cl...@protonmail.com.invalid> wrote:
>
>> Hi,
>>
>> The project is made of a parent pom and child maven modules. Yes, I can open it in NetBeans and build it.
>>
>> The build creates a "mods" folder where all the JPMS jars are generated.
>> Then, I run the app with a command which specifies the module-path and the start module:
>> java --module-path mods/gui --module net.clementlevallois.javafxtest.gui
>>
>> The result looks like:
>> https://github.com/seinecle/yetanotherjavafxjmpstest
>>
>> So... not sure at which step / how I can use the "debug" function in NetBeans for such a project?
>>
>> Clement
>> Sent with [ProtonMail](https://protonmail.com) Secure Email.
>>
>> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>> On Tuesday 29 December 2020 12:12, Geertjan Wielenga <ge...@googlemail.com.INVALID> wrote:
>>
>>> What happens when you use File | Open Project and browse to the root folder? Alternatively, create a new Java project in NetBeans and copy your code into the generated project template.
>>>
>>> Gj
>>>
>>> On Tue, 29 Dec 2020 at 12:05, Clement Levallois <cl...@protonmail.com.invalid> wrote:
>>>
>>>> Hi,
>>>>
>>>> At the moment I run my jigsaw / JPMS project from the command line:
>>>> java --module-path mods/core --module net.clementlevallois.certificateapp.core
>>>>
>>>> This works fine but this prevents me from using NetBeans debugging capabilities (line by line debugging in particular). How can I come back to NetBeans for launching my modular projects? (without maven plugins, just the equivalent of the command line above: java --module-path etc). Thx!
>>>>
>>>> Clement Levallois
>>>> --

Re: Running a modular (JPMS) java project from NetBeans in debug mode?

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
What happens when you set a breakpoint in your code in NetBeans and
right-click the project and choose Debug?

You might need to look at the Debug action, after right-clicking the
project, choosing Properties, and look in the Actions category to finetune
the Debug action for your needs.

Gj

On Tue, 29 Dec 2020 at 12:21, Clement Levallois
<cl...@protonmail.com.invalid> wrote:

> Hi,
>
> The project is made of a parent pom and child maven modules. Yes, I can
> open it in NetBeans and build it.
>
> The build creates a "mods" folder where all the JPMS jars are generated.
> Then, I run the app with a command which specifies the module-path and the
> start module:
> java --module-path mods/gui --module net.clementlevallois.javafxtest.gui
>
> The result looks like:
> https://github.com/seinecle/yetanotherjavafxjmpstest
>
> So... not sure at which step / how I can use the "debug" function in
> NetBeans for such a project?
>
> Clement
> Sent with ProtonMail <https://protonmail.com> Secure Email.
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Tuesday 29 December 2020 12:12, Geertjan Wielenga
> <ge...@googlemail.com.INVALID> wrote:
>
> What happens when you use File | Open Project and browse to the root
> folder? Alternatively, create a new Java project in NetBeans and copy your
> code into the generated project template.
>
> Gj
>
> On Tue, 29 Dec 2020 at 12:05, Clement Levallois
> <cl...@protonmail.com.invalid> wrote:
>
>> Hi,
>>
>> At the moment I run my jigsaw / JPMS project from the command line:
>> java --module-path mods/core --module
>> net.clementlevallois.certificateapp.core
>>
>> This works fine but this prevents me from using NetBeans debugging
>> capabilities (line by line debugging in particular). How can I come back to
>> NetBeans for launching my modular projects? (without maven plugins, just
>> the equivalent of the command line above: java --module-path etc). Thx!
>>
>>
>> Clement Levallois
>> --
>>
>>
>>
>

Re: Running a modular (JPMS) java project from NetBeans in debug mode?

Posted by Neil C Smith <ne...@apache.org>.
On Tue, 29 Dec 2020 at 11:21, Clement Levallois
<cl...@protonmail.com.invalid> wrote:
> So... not sure at which step / how I can use the "debug" function in NetBeans for such a project?

You'll likely need to edit the actions for run / debug in project
properties to use module path rather than class path (you can still
use classpath variable to set module path), and also update the main
class reference.  My nbactions isn't checked in so I can't link to it,
and don't have it to hand right now - can check for you if need be - I
do have this working OK for me in a modular JPMS project but took a
little tweaking.  Be good if there was support for this by default,
but not sure how best the IDE could cover both bases here?

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Running a modular (JPMS) java project from NetBeans in debug mode?

Posted by Clement Levallois <cl...@protonmail.com.INVALID>.
Hi,

The project is made of a parent pom and child maven modules. Yes, I can open it in NetBeans and build it.

The build creates a "mods" folder where all the JPMS jars are generated.
Then, I run the app with a command which specifies the module-path and the start module:
java --module-path mods/gui --module net.clementlevallois.javafxtest.gui

The result looks like:
https://github.com/seinecle/yetanotherjavafxjmpstest

So... not sure at which step / how I can use the "debug" function in NetBeans for such a project?

Clement
Sent with [ProtonMail](https://protonmail.com) Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday 29 December 2020 12:12, Geertjan Wielenga <ge...@googlemail.com.INVALID> wrote:

> What happens when you use File | Open Project and browse to the root folder? Alternatively, create a new Java project in NetBeans and copy your code into the generated project template.
>
> Gj
>
> On Tue, 29 Dec 2020 at 12:05, Clement Levallois <cl...@protonmail.com.invalid> wrote:
>
>> Hi,
>>
>> At the moment I run my jigsaw / JPMS project from the command line:
>> java --module-path mods/core --module net.clementlevallois.certificateapp.core
>>
>> This works fine but this prevents me from using NetBeans debugging capabilities (line by line debugging in particular). How can I come back to NetBeans for launching my modular projects? (without maven plugins, just the equivalent of the command line above: java --module-path etc). Thx!
>>
>> Clement Levallois
>> --

Re: Running a modular (JPMS) java project from NetBeans in debug mode?

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
What happens when you use File | Open Project and browse to the root
folder? Alternatively, create a new Java project in NetBeans and copy your
code into the generated project template.

Gj

On Tue, 29 Dec 2020 at 12:05, Clement Levallois
<cl...@protonmail.com.invalid> wrote:

> Hi,
>
> At the moment I run my jigsaw / JPMS project from the command line:
> java --module-path mods/core --module
> net.clementlevallois.certificateapp.core
>
> This works fine but this prevents me from using NetBeans debugging
> capabilities (line by line debugging in particular). How can I come back to
> NetBeans for launching my modular projects? (without maven plugins, just
> the equivalent of the command line above: java --module-path etc). Thx!
>
>
> Clement Levallois
> --
>
>
>