Class not found exception for LinuxFile #160
Replies: 3 comments
-
hi, I have the same problem as you. Did you solve this problem?If you decide, help me. /I use netbeans 12.0, java ant/ |
Beta Was this translation helpful? Give feedback.
-
It looks the LinuxFile plugin is missing. I'm not familiar with Netbeans myself, but will try to help. Sidenote: it is possible to create a project with IntelliJ on PC/MAC and deploy to Pi with Maven, it's both described with the Maven archetype (https://pi4j.com/getting-started/developing-on-a-remote-pc/) and CrowPi examples (https://pi4j.com/getting-started/crowpi/develop-with-intellij/). Do you have a view of the libraries which get included in your project or uploaded to the Pi? Instead of using var piGpio = PiGpio.newNativeInstance();
var pi4j = Pi4J.newContextBuilder()
.noAutoDetect()
.add(
PiGpioDigitalInputProvider.newInstance(piGpio),
PiGpioDigitalOutputProvider.newInstance(piGpio),
PiGpioPwmProvider.newInstance(piGpio),
PiGpioI2CProvider.newInstance(piGpio),
PiGpioSerialProvider.newInstance(piGpio),
PiGpioSpiProvider.newInstance(piGpio)
)
.build(); |
Beta Was this translation helpful? Give feedback.
-
Hello, i am using I2C with pi4j for my project and run in this very same issue. i solved this by checking the pi4j-plugin-linuxfs.jar loaded on raspberry, and in fact LinuxFile was missing. You can open a jar just like a compressed archive, i personally use 7zip to do that. My guess is that during the transfer via SSH from your local machine to the raspberry something went wrong and the jar was not correctly copied, and LinuxFile was lost along the way. As i manually replaced the jar on the raspberry, i was able to run my ant project with remote platform in netbeans and everything worked smoothly. |
Beta Was this translation helpful? Give feedback.
-
I created new project in IDE Netbeans (the newest) using Ant project builder because only Ant supports now remote lunching jar on raspi. Gradle and Maven in Project/Properites/Run don't have option for Runtime Platform. I downloaded libraries and added to project:
and try to run (compiled ok) code:
but on runtime I get:
Beta Was this translation helpful? Give feedback.
All reactions