Hallo!
..
Ich bin ja nicht unbedingt ein totaler noob, aber ich bringe es scheinbar nicht zustande, die Jar Dateien von pi4j (wird zum Ansteuern der GPIOs vom Raspberry benötigt) richtig zum laufen zu bringen...
Die Jar Dateien habe ich zum Bildpath hinzugefügt (dieses Vorgehen kenne ich schon von den SQL Treibern), doch wenn ich dann mein kleines Testprogramm laufen lassen will kommen (zig) Fehlermeldungen dich ich als "du hast den Buildpath nicht richtig eingebunden" interpretiere.
Ich habe nun schon einiges versucht bin aber ziemlich ratlos wie ich das beheben kann, weiss hier vlt. jmd bitte Rat?
Hier die Console von Eclipse (kepler):
und hier noch der verursachende Code:
..
Ich bin ja nicht unbedingt ein totaler noob, aber ich bringe es scheinbar nicht zustande, die Jar Dateien von pi4j (wird zum Ansteuern der GPIOs vom Raspberry benötigt) richtig zum laufen zu bringen...
Die Jar Dateien habe ich zum Bildpath hinzugefügt (dieses Vorgehen kenne ich schon von den SQL Treibern), doch wenn ich dann mein kleines Testprogramm laufen lassen will kommen (zig) Fehlermeldungen dich ich als "du hast den Buildpath nicht richtig eingebunden" interpretiere.
Ich habe nun schon einiges versucht bin aber ziemlich ratlos wie ich das beheben kann, weiss hier vlt. jmd bitte Rat?
Hier die Console von Eclipse (kepler):
Java:
GPIO Tests... started.
erstelle GPIO Controller...
java.io.IOException: Cannot run program "bash": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at com.pi4j.util.ExecUtil.execute(ExecUtil.java:45)
at com.pi4j.util.ExecUtil.execute(ExecUtil.java:40)
at com.pi4j.system.SystemInfo.getBashVersionInfo(SystemInfo.java:441)
at com.pi4j.system.SystemInfo.access$000(SystemInfo.java:43)
at com.pi4j.system.SystemInfo$2.run(SystemInfo.java:193)
at com.pi4j.system.SystemInfo$2.run(SystemInfo.java:190)
at java.security.AccessController.doPrivileged(Native Method)
at com.pi4j.system.SystemInfo.isHardFloatAbi(SystemInfo.java:190)
at com.pi4j.util.NativeLibraryLoader.load(NativeLibraryLoader.java:153)
at com.pi4j.wiringpi.Gpio.<clinit>(Gpio.java:138)
at com.pi4j.io.gpio.RaspiGpioProvider.<init>(RaspiGpioProvider.java:47)
at com.pi4j.io.gpio.GpioFactory.getDefaultProvider(GpioFactory.java:102)
at com.pi4j.io.gpio.impl.GpioControllerImpl.<init>(GpioControllerImpl.java:67)
at com.pi4j.io.gpio.GpioFactory.getInstance(GpioFactory.java:85)
at consoleProg.GPIOtests.main(GPIOtests.java:24)
Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 19 more
java.io.IOException: Cannot run program "/usr/bin/readelf": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at com.pi4j.util.ExecUtil.execute(ExecUtil.java:45)
at com.pi4j.util.ExecUtil.execute(ExecUtil.java:40)
at com.pi4j.system.SystemInfo.getReadElfTag(SystemInfo.java:472)
at com.pi4j.system.SystemInfo.hasReadElfTag(SystemInfo.java:459)
at com.pi4j.system.SystemInfo.access$100(SystemInfo.java:43)
at com.pi4j.system.SystemInfo$2.run(SystemInfo.java:193)
at com.pi4j.system.SystemInfo$2.run(SystemInfo.java:190)
at java.security.AccessController.doPrivileged(Native Method)
at com.pi4j.system.SystemInfo.isHardFloatAbi(SystemInfo.java:190)
at com.pi4j.util.NativeLibraryLoader.load(NativeLibraryLoader.java:153)
at com.pi4j.wiringpi.Gpio.<clinit>(Gpio.java:138)
at com.pi4j.io.gpio.RaspiGpioProvider.<init>(RaspiGpioProvider.java:47)
at com.pi4j.io.gpio.GpioFactory.getDefaultProvider(GpioFactory.java:102)
at com.pi4j.io.gpio.impl.GpioControllerImpl.<init>(GpioControllerImpl.java:67)
at com.pi4j.io.gpio.GpioFactory.getInstance(GpioFactory.java:85)
at consoleProg.GPIOtests.main(GPIOtests.java:24)
Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 20 more
java.io.IOException: Cannot run program "bash": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at com.pi4j.util.ExecUtil.execute(ExecUtil.java:45)
at com.pi4j.util.ExecUtil.execute(ExecUtil.java:40)
at com.pi4j.system.SystemInfo.getBashVersionInfo(SystemInfo.java:441)
at com.pi4j.system.SystemInfo.access$000(SystemInfo.java:43)
at com.pi4j.system.SystemInfo$2.run(SystemInfo.java:193)
at com.pi4j.system.SystemInfo$2.run(SystemInfo.java:190)
at java.security.AccessController.doPrivileged(Native Method)
at com.pi4j.system.SystemInfo.isHardFloatAbi(SystemInfo.java:190)
at com.pi4j.util.NativeLibraryLoader.load(NativeLibraryLoader.java:154)
at com.pi4j.wiringpi.Gpio.<clinit>(Gpio.java:138)
at com.pi4j.io.gpio.RaspiGpioProvider.<init>(RaspiGpioProvider.java:47)
at com.pi4j.io.gpio.GpioFactory.getDefaultProvider(GpioFactory.java:102)
at com.pi4j.io.gpio.impl.GpioControllerImpl.<init>(GpioControllerImpl.java:67)
at com.pi4j.io.gpio.GpioFactory.getInstance(GpioFactory.java:85)
at consoleProg.GPIOtests.main(GPIOtests.java:24)
Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 19 more
java.io.IOException: Cannot run program "/usr/bin/readelf": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at com.pi4j.util.ExecUtil.execute(ExecUtil.java:45)
at com.pi4j.util.ExecUtil.execute(ExecUtil.java:40)
at com.pi4j.system.SystemInfo.getReadElfTag(SystemInfo.java:472)
at com.pi4j.system.SystemInfo.hasReadElfTag(SystemInfo.java:459)
at com.pi4j.system.SystemInfo.access$100(SystemInfo.java:43)
at com.pi4j.system.SystemInfo$2.run(SystemInfo.java:193)
at com.pi4j.system.SystemInfo$2.run(SystemInfo.java:190)
at java.security.AccessController.doPrivileged(Native Method)
at com.pi4j.system.SystemInfo.isHardFloatAbi(SystemInfo.java:190)
at com.pi4j.util.NativeLibraryLoader.load(NativeLibraryLoader.java:154)
at com.pi4j.wiringpi.Gpio.<clinit>(Gpio.java:138)
at com.pi4j.io.gpio.RaspiGpioProvider.<init>(RaspiGpioProvider.java:47)
at com.pi4j.io.gpio.GpioFactory.getDefaultProvider(GpioFactory.java:102)
at com.pi4j.io.gpio.impl.GpioControllerImpl.<init>(GpioControllerImpl.java:67)
at com.pi4j.io.gpio.GpioFactory.getInstance(GpioFactory.java:85)
at consoleProg.GPIOtests.main(GPIOtests.java:24)
Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 20 more
Aug 06, 2014 2:40:01 PM com.pi4j.util.NativeLibraryLoader load
Schwerwiegend: Failed to load library [pi4j] using the System.load(file) method using embedded resource file: [jar:file:/C:/Users/user stuff usw... /RaspberryTests/lib/pi4j-core-sources.jar!/lib/soft-float/libpi4j.so]
Aug 06, 2014 2:40:01 PM com.pi4j.util.NativeLibraryLoader load
Schwerwiegend: ERROR: The native library [pi4j : libpi4j.so] could not be found in the JVM library path nor could it be loaded from the embedded JAR resource file; you may need to explicitly define the library path '-Djava.library.path' where this native library can be found.
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.pi4j.wiringpi.Gpio.wiringPiSetup()I
at com.pi4j.wiringpi.Gpio.wiringPiSetup(Native Method)
at com.pi4j.io.gpio.RaspiGpioProvider.<init>(RaspiGpioProvider.java:47)
at com.pi4j.io.gpio.GpioFactory.getDefaultProvider(GpioFactory.java:102)
at com.pi4j.io.gpio.impl.GpioControllerImpl.<init>(GpioControllerImpl.java:67)
at com.pi4j.io.gpio.GpioFactory.getInstance(GpioFactory.java:85)
at consoleProg.GPIOtests.main(GPIOtests.java:24)
und hier noch der verursachende Code:
Java:
package consoleProg;
import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioFactory;
import com.pi4j.io.gpio.GpioPinDigitalOutput;
import com.pi4j.io.gpio.PinState;
import com.pi4j.io.gpio.RaspiPin;
//import com.pi4j.io.gpio.*;
public class GPIOtests {
/**
* @param args
*/
public static void main(String[] args) throws InterruptedException{
System.out.println("GPIO Tests... started. \n erstelle GPIO Controller... ");
// Erstellt einen GpioController welcher diverse Funktionen anbietet um
// Ein- Ausgabe Operation durchzuführen.
final GpioController gpio = GpioFactory.getInstance();
System.out.println("Programm ist beendet.");
}
}
Zuletzt bearbeitet: