How to build jnativehook on window 10 -
i using jnativehook on program. edit source code little , works on mac. when executed on window, got error.
8월 18, 2017 10:47:48 오전 org.jnativehook.defaultlibrarylocator getlibraries 심각: unable extract nativelibrary /org/jnativehook/lib/windows/x86_64/jnativehook.dll! java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ com.sun.javafx.application.launcherimpl.launchapplicationwithargs(launcherimpl.java:389) @ com.sun.javafx.application.launcherimpl.launchapplication(launcherimpl.java:328) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ sun.launcher.launcherhelper$fxhelper.main(unknown source) caused by: java.lang.unsatisfiedlinkerror: org.jnativehook.globalscreen.getautorepeatrate()ljava/lang/integer; @ org.jnativehook.globalscreen.getautorepeatrate(native method) @ org.jnativehook.globalscreen.<clinit>(unknown source) @ smiplayer.main.main(main.java:75) ... 11 more exception running application smiplayer.main
so tried build on window. setted java_home path , added jnitasks. got message.
build failed c:\jnativehook-2.1.0\build.xml:345: execute failed: java.io.ioexception: cannot run program "sh" (in directory "c:\jnativehook-2.1.0\src\libuiohook"): createprocess error=2
i tried cross.build.xml god error.
build failed c:\jnativehook-2.1.0\cross.build.xml:160: following error occurred while executing line: c:\jnativehook-2.1.0\jnitasks\build.xml:76: compile failed; see compiler error output details.
line 160 5th line of below code block compiling jnitasks source...
<ant antfile="${basedir}/jnitasks/build.xml" dir="${basedir}/jnitasks"> <target name="compile" /> <target name="jar" /> <!-- need override src , bin locations. --> <property name="dir.bin" value="${basedir}/jnitasks/bin" /> <property name="dir.src" value="${basedir}/jnitasks/src" /> <property name="dir.jar" value="${basedir}" /> <!-- set few of configurable properties. --> <property name="ant.build.debug" value="${ant.build.debug}" /> <property name="ant.build.javac.compiler" value="${ant.build.javac.compiler}" /> <property name="ant.build.javac.source" value="${ant.build.javac.source}" /> <property name="ant.build.javac.target" value="${ant.build.javac.target}" /> <property name="ant.build.javac.args" value="${ant.build.javac.args}" /> </ant> </target>
and line 76 8th line of below code block
<condition property="ant.build.javac.bootclasspath" value="${env.jdk_home}/bundle/classes/classes.jar"> <available file="${env.jdk_home}/bundle/classes/classes.jar" type="dir" /> </condition> <condition property="ant.build.javac.bootclasspath" value="${env.java_home}/bundle/classes/classes.jar"> <available file="${env.java_home}/bundle/classes/classes.jar" type="dir" /> </condition> <condition property="ant.build.javac.bootclasspath" value="${java.home}/bundle/classes/classes.jar"> <available file="${java.home}/bundle/classes/classes.jar" type="file" /> </condition> <fail message="could not determine ant.build.javac.bootclasspath location. please set jdk_home / java_home environment variable or manually set ant.build.javac.bootclasspath property location of rt.jar file.">
i didn't tried cross.build.xml on mac yet.
i need help..
you must compile native code separately each platform. cannot compile windows on mac without cross compiler msys2. can compile set of binaries on each platform using ant compile-native
, combine lib directories before calling ant jar
. cross.build.xml file used cross-compile platforms linux. instructions on cross-compiling located in wiki.
your windows 10 build failing because not using correct shell compile from. must use mingw32/64 shell run ant. again, outlined in wiki on project page.
Comments
Post a Comment