-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throwing error while fatJaring using gradle #237
Comments
One thing, use this as the example of code. I believe once your present code creates and runs through the fat, it will not change the LED. https://github.com/Pi4J/pi4j-example-minimal I created a clone of this example successfully ran it. FAT used info from https://pi4j.com/documentation/building/fat-jar/ and example https://github.com/Pi4J/pi4j-example-fatjar to copy the needed edits to the pom file. I edited the pom file to add the FAT specific details . Was able to: mvn clean package, cd into target/distribution and sudo java -jar pi4j-example-fatjar.jar Give me a minute and I will attach my pom hope this help. Tom |
I could see you prefer gradle to build. I used the example testcase from above and added gradle to it. I see an error. I normally use maven so all this is a matter of digging and I have not found an answer. I do see that running under gradle build there are fewer providers loaded. Maven these output providers. Using gradle only My error is Was this your initial error when you said a 'lib' was not found ? |
@taartspi that was absolutely the error that I faced while fatJaring for the first time but was resolved easily(not considering the last exception) |
Hi did you solve this problem? I got the same exception. If I run my code on my computer in Intellij IDEA with the Embedded Linux JVM plugin, then the code works well (GPIO Out turns HIGH and Input is detected, ecc..). If I create a fatjar with gradle, copy the file to my RPI4 and execute it with java -jar, then I got the same exception (Provider not found). |
@RLEO94 for overall can't guarantee wouldn't throw |
Hi |
Hey @Reqeique, I'm not sure if you were able to solve this issue, but I managed to solve it by checking out tasks.named("shadowJar", ShadowJar::class.java) {
mergeServiceFiles()
manifest.attributes["Main-Class"] = "MinimalExampleKt"
} |
This is worth including in the docs alongside the maven Uber Jar document. |
I was currently experimenting with pi4j but when I start to fat Jar it, it kept throwing exception
my first attempt was to utilize shadowJar, which wasn't able to jar all the necessary libraries resulting
lib wasn't found exception
so I put all the necessary
jar
files manually but gaveMethod [create([class java.lang.Integer])] could not be resolved in provider [pigpio-digital-output(com.pi4j.plugin.pigpio.provider.gpio.digital.PiGpioDigitalOutputProviderImpl)]; Overridden instances of 'create()' are not supported unless defined as default methods in the provider interface
following that I tried my third attempts which was to utilize built in jaring method using the following code
but throws the same execption no luck!
Note: the code i used was from https://pi4j.com/documentation/io-examples/digital-output/ which was then converted to kotlin
The text was updated successfully, but these errors were encountered: