Sample Header Ad - 728x90

Netbeans - Run/Debug the project as root

0 votes
0 answers
35 views
Is there a way to run/debug my Java program from Netbeans as root? Context: I'm working on RaspberryPi 4 and using PI4J library to access GPIO. Lib offers several I/O Providers and the only one that covers all my use cases (digital input, digital output, SPI) is PiGpio which according to documentation requires that any app using it is run with sudo - otherwise when trying to access GPIO results in a crash with an exception Exception in thread "main" com.pi4j.library.pigpio.PiGpioException: PIGPIO ERROR: PI_INIT_FAILEDl pigpio initialisation failed The first thing I tried is running Netbeans from terminal using sudo netbeans, but that results with IDE opening in an empty window with no user interface and warnings in terminal: WARNING: package com.apple.eio not in java.desktop WARNING: package jdk.internal.opt not in java.desktop WARNING: package com.sun.java.swing.plaf.windows not in java.desktop WARNING: package com.apple.laf not in java.desktop So that didn't work. Is there something else I could try to run my program from Netbeans as root?
Asked by mag_zbc (121 rep)
Apr 3, 2025, 04:14 PM
Last activity: Apr 3, 2025, 05:35 PM