Execute jni in Maven ubuntu - java

I have to call native function from Java with JNI and Maven on Ubuntu 14.04. I have generated .so file and I don't know how to specify in Maven pom.xml file to access .so file. I searched about this and I got the following link: Calling native functions from Java with JNI and Maven
So, as per the link should I create multiple pom.xml files to execute?
Also, I came across posts suggest to use plugin such as NAR plugin to execute JNI with Maven. Please guide me on how to execute JNI with Maven on Ubuntu.

Related

Or-tools java.lang.NoClassDefFoundError: com/sun/jna/Platform

Hi I'm trying to run this sample code on my eclipse ide and have manually adding the jars file without using the pom file provided but it's complaining with this error.
I managed to compile and run the sample code using 'make run' command.
Any idea is it possible to copy the library jar files and use it in my own project in eclipse?

Dose any one can run imagej plugin by using jni?

Recently I am using java and maven dependency to run a program. At first, I used a jni file(libtensorflow_jni-1.7.0) during mvn compiling to generate jar plugin for imagej, and it works well. Then I changed jni dependency(libtensorflow_jni_gpu 1.12.0) in my pom.xml. After compiling, I trying to use the generated jar file in imagej, but the plugin failed( it used to work before i use that jni). There is no error message. Is there any way I can fix this?

OSB with Java Callout

I'm facing an issue. On testing a java code with external jar dependency separately, it is working. But when trying to deploy OSB code with java callout calling the same java code, it is throwing method does not exist.
There are multiple ways to resolve this issue.
you can create a fat jar(it will contain all class files, Tools are available online or can use Eclipse or any ide to export the code.) for your Java code along with Dependencies and libraries.
You can deploy your dependencies as libraries/Application or copy Weblogic lib folder it depends on your dependency type. after deployment, you must restart the domain. Then u can deploy import your java callout Jar/Archive in OSB.

Programming Akka in Java and sbt dependencies

I am learning Akka and am trying out Akka remoting. I am using the intellij IDE and the language being used is Java. I tried running the AKKA remote example (Calculator). I am not using the sbt tool. How do I build the application and run it. I tried running the example, but I dont think it is reading the configuration files correctly and is not creating a remote actor. I have included the akka jar files in the project. I have created a simple java project in intellij to run the program.
Am I doing it the right way?. What are the alternate ways to build and run the same. How to use sbt with Java.
You can create Dependencies.scala and Versions.scala under project folder; which again you can use with build.sbt.
build.sbt is very similar to build.xml with maven. You can define libraryDependencies and assembly file name, etc.
For example you can refer https://github.com/asethia/akka-streaming-graph/tree/master/project in detail.

Submitting Spark Application through command line

I have a Spark Application which I initially created using maven. I converted my maven project into an Eclipse project, and I am now working on it via Eclipse.
I also have my own version of the Spark source code to which I have made some modifications and added additional methods. I am able to build my version of Spark and obtain the jar file for spark-core.
In my Eclipse project I now replace the spark-core that is in the build path with the newly built spark-core jar. I am able to utilize the new methods I created and verify this by running the application through Eclipse.
Now, I am trying to submit my application through the command line. I use the spark-submit command from the Spark project I have modified. When I submit my jar, I get an error saying the method I created does not exist. I'm not sure what I'm doing wrong. I would appreciate some insight on what I should be doing.
UPDATE
I now understand that there are certain jars that I need to have from my custom build. Exactly which jars are these? I understand the spark-assembly jar is one. Are there any others?

Categories