Git Product home page Git Product logo

Comments (10)

FlorianKirmaier avatar FlorianKirmaier commented on September 28, 2024

Thank you for reporting this, we will take a look into this.

from hellojpro.

FlorianKirmaier avatar FlorianKirmaier commented on September 28, 2024

These are not really JPro issues, but general gradle topics.

in the newer gradle versions, the scope is named testImplementation instead of testCompile. Probably happened, because your JNI tutorial was using an older gradle version.
You will also need a settings.gradle to include the other project:

include "hello"
include "server"

from hellojpro.

harideva16 avatar harideva16 commented on September 28, 2024

I modified but it comes error.

jni

I want to use JNI with JPRO.

Can you give a tutorial for me?

from hellojpro.

FlorianKirmaier avatar FlorianKirmaier commented on September 28, 2024

Gradle provides a list of tutorials: https://gradle.org/guides/

You have to move the JUnit dependency, out of the dependencies of the build script.
You can create a new dependency block, at the bottom of your application. Then it should work.

from hellojpro.

harideva16 avatar harideva16 commented on September 28, 2024

I tried but same error.

from hellojpro.

FlorianKirmaier avatar FlorianKirmaier commented on September 28, 2024

Do you use the gradle wrapper? Without more details I cant help you.

from hellojpro.

harideva16 avatar harideva16 commented on September 28, 2024

When I run I have the following error.

C:\Users\pja\Documents\HelloJPro>gradlew test
> Task :hello:compileDebugCpp FAILED

FAILURE: Build failed with an exception.

 * What went wrong:
 Execution failed for task ':hello:compileDebugCpp'.
 > No tool chain is available to build C++ for host operating system 'Windows 10' architecture 'x86-64':
 - Tool chain 'visualCpp' (Visual Studio):
   - Could not locate a Visual Studio installation, using the command line tool, Windows registry or system path.
 - Tool chain 'gcc' (GNU GCC):
 - Could not find C++ compiler 'g++' in system path.
 - Tool chain 'clang' (Clang):
   - Could not find C++ compiler 'clang++' in system path.

  * Try:
   Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with -- 
   scan to get full insights.

  * Get more help at https://help.gradle.org

  BUILD FAILED in 1s
  3 actionable tasks: 1 executed, 2 up-to-date

How can I solve this error ?

from hellojpro.

FlorianKirmaier avatar FlorianKirmaier commented on September 28, 2024

I think it wants you to install/configure c++ in some form.
But I can't help you with it. Maybe ask the people from the JNI plugin? Or try to fix it yourself, I think you only have to install some components, probably easy.

from hellojpro.

harideva16 avatar harideva16 commented on September 28, 2024

My java file

public class HelloWorld {
public native void print();

static {
    System.loadLibrary("hello");
}

public static void main(String[] args) {
    new HelloWorld().print();
}

}

OUTPUT

10:30:26: Executing task 'HelloWorld.main()'...

> Task :compileJava
> Task :processResources NO-SOURCE
> Task :classes

> Task :HelloWorld.main() FAILED
2 actionable tasks: 2 executed
java.lang.UnsatisfiedLinkError: no hello in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:871)
at java.lang.System.loadLibrary(System.java:1124)
at HelloWorld.<clinit>(HelloWorld.java:5)
Exception in thread "main" 
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':HelloWorld.main()'.
> Process 'command 'C:/Program Files/OpenJDK/openjdk-8u292-b10/bin/java.exe'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to 
get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s
 10:30:33: Task execution finished 'HelloWorld.main()'.

How can I solve this ?

from hellojpro.

FlorianKirmaier avatar FlorianKirmaier commented on September 28, 2024

JPro currently only supports java 11 and above. But that's not related to your issue. You will somehow have to load the library. I think either System.load and/or by setting -Djava.library.path=....
But this is not the right place to ask for it, so I'm closing the ticket.

from hellojpro.

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.