Git Product home page Git Product logo

Comments (15)

ThadHouse avatar ThadHouse commented on July 17, 2024

Note Java will have this issue as well, since it no longer includes ntcore, cscore or jni in the jar itself. I would much rather prefer figuring out how to put the dependency version in the pom. I'm hoping we can do that fairly easily using things built into gradle, as I think it's too late before the season to add another package structure to our maven repo.

from allwpilib.

JaciBrunning avatar JaciBrunning commented on July 17, 2024

I believe this can be done in Gradle. I'm not sure if it's the same with the version of the Maven Plugin that is used in this repo, but you can modify the Pom directly from the DSL https://github.com/Open-RIO/ToastAPI/blob/development/build.gradle#L228-L240

from allwpilib.

dixonwille avatar dixonwille commented on July 17, 2024

@ThadHouse Hey having an issue with the code running on the RIO where I think your comment comes into play. I am using gradle to grab dependencies from the maven repository. I have opencv, cscore, athena, athena-jni, NetworkTables all being included in the jar. Yet when going into the rio an try and run robotCommand, Java complains it cannot find JNI. Not sure what is missing...

Exception in thread "main" java.lang.UnsatisfiedLinkError: no wpilibJavaJNI in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1119)
	at edu.wpi.first.wpilibj.hal.JNIWrapper.<clinit>(JNIWrapper.java:22)
	at edu.wpi.first.wpilibj.RobotBase.initializeHardwareConfiguration(RobotBase.java:171)
	at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:194)

from allwpilib.

ThadHouse avatar ThadHouse commented on July 17, 2024

No native libraries are included anymore in any of the WPILib Java Jars. In order to run them, you will need to deploy all the files inside the following following dependencies

  • athena-jni
  • athena-runtime
  • opencv-jni

In addition, you will need to get the athena-uberzip artifact from the cscore repo, and deploy the libcscore.so file, and all the files ending in .3.1. You do not need to extract the rest of the files from that archive.

from allwpilib.

ThadHouse avatar ThadHouse commented on July 17, 2024

Oh and they all need to be deployed to /usr/local/frc/lib. Along with running ldconfig after deploying the libraries.

from allwpilib.

dixonwille avatar dixonwille commented on July 17, 2024

from allwpilib.

333fred avatar 333fred commented on July 17, 2024

I believe the cause of the issue here (for Java) is that since we're publishing zip files and not the actual compilation output, Maven doesn't have the correct dependencies. The C++ root cause is that Maven was in no way designed to do what we're doing with it. 😄 @ThadHouse, we'll want to fix this as part of our artifact cleanup.

from allwpilib.

jrmihalick avatar jrmihalick commented on July 17, 2024

@ThadHouse After updating the firmware on our RoboRIO from the 2017 firmware to the 2018 firmware, we are getting the same error that @dixonwille mentioned on Jan 8, 2017. That is, we are getting this error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no wpilibJavaJNI in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at edu.wpi.first.wpilibj.hal.JNIWrapper.<clinit>(JNIWrapper.java:22) at edu.wpi.first.wpilibj.RobotBase.initializeHardwareConfiguration(RobotBase.java:171) at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:194)

Sure enough, when we check the /usr/local/frc/lib directory on the RIO, there is no wpilibJavaJNI.so file there (or anything similarly named). Can anyone suggest why this file might now be missing OR where we can get the file? I have looked in MANY of the artifacts on the maven repository at http://first.wpi.edu/FRC/roborio/maven/release and I am not finding the file in any of those artifacts. Your help would be greatly appreciated.

from allwpilib.

ThadHouse avatar ThadHouse commented on July 17, 2024

Are you guys using the 2018 eclipse or gradlerio release? The name of that library changed for 2018, and so did more of the maven locations.

from allwpilib.

jrmihalick avatar jrmihalick commented on July 17, 2024

We are deploying with 2018 eclipse and just started to learn about gradlerio, but haven't gotten very far with Gradlerio. We'd be happy to start using gradlerio if that will fix this problem.

from allwpilib.

ThadHouse avatar ThadHouse commented on July 17, 2024

Hmm. 2018 eclipse should work just fine. You definitely upgraded the plugins to 2018, right? And did an Rio reimage?

from allwpilib.

jrmihalick avatar jrmihalick commented on July 17, 2024

@ThadHouse Thanks, your questions helped us figure out what the issue was. As I mentioned, we had new firmware deployed to the robot, but we had the remnants of a working gradle build that was working for 2017, but we didn't have fully updated to work with 2018 and GradleRIO. We got the project updated to use GradleRIO and we now at least have a different error that we can work on tomorrow. We no longer are getting the error I mentioned above. Thanks again!

from allwpilib.

jrmihalick avatar jrmihalick commented on July 17, 2024

Bottom line is that we were running code with 2017 WPI lib dependencies included, but deploying to a RIO with 2018 firmware/libraries installed on it. Thus the reason our robot code was trying to load a library which no longer exists.

from allwpilib.

ThadHouse avatar ThadHouse commented on July 17, 2024

This hasn't been 100% fixed, but with the merge to the uber repo, all utilities now have the same version. So for users, this should be much easier. I'm going to leave the issue open though.

from allwpilib.

PeterJohnson avatar PeterJohnson commented on July 17, 2024

This should no longer be an issue with the move to GradleRIO.

from allwpilib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.