Coder Social home page Coder Social logo

Compiling on Windows about jnativehook HOT 2 CLOSED

kwhat avatar kwhat commented on July 29, 2024
Compiling on Windows

from jnativehook.

Comments (2)

kwhat avatar kwhat commented on July 29, 2024

Hi,

Yes, I got fed up with Google's buggy git hosting so I migrated to github for the time being. I will probably mirror the repository back at some point in the near future.

Let me give you a little background regarding the current project structure. I have separated out JNativeHook into two projects; The java/jni portion is still under jnativehook and all of the platform-related code to make it function is in libuiohook. (https://github.com/kwhat/libuiohook) The primary reason for doing this was to make some of the more difficult bugs easier to debug, including the one you mentioned. There are a couple of demo programs included in libuiohook that can be used as an entry point to test and debug the dll it produces.

On to compiling. All supported platforms should compile without issue, however the toolchain setup is a bit different. For Windows you will need to install MSYS2 from http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/ to c:\msys[2|64]. I prefer using ConEMU (http://sourceforge.net/projects/conemu/) with the settings >> startup script set to "path C:\msys64\bin;%path% && sh.exe" instead of the built in msys2_shell.bat, however both will work fine. After you install MSYS2 run pacman -Sy followed by pacman -S autoconf automake-wrapper mingw-w64-x86_64-gcc gcc mingw-w64-x86_64-libtool libtool make pkg-config That should install all of the required dependencies except for ant. Install that as you normally would along with a JDK and make sure your JDK_HOME or JAVA_HOME environment variable is pointing to the correct path.

Calling ant compile jar on JNativeHook should just "work" after that. The src code for libuiohook and JNITasks will be pulled in and compiled automatically. If you are going to do some debugging, I would suggest patching the JNativeHook build.xml file around line 335 and adding demo to the task to build the above mentioned demo programs. This will allow you to debug the native portion of the code without stepping around the JVM in the debugger.

One more note. I did a bit of work on autotools for libuiohook last night and it looks like I managed to break compiling on Windows. If you are seeing "error: cannot find input file: `pc/uiohook.pc.in'", roll back to the previous revision of libuiohook until I have an opportunity to fix it. If you ever asked yourself if you should learn/use autotools, don't. It's not worth it, not if it was the last build system on Earth and you needed to compile a program to save the planet. If you run into any other problems feel free to contact me directly or on irc.freenode.net #jnativehook.

from jnativehook.

kwhat avatar kwhat commented on July 29, 2024

This should be fixed. If it is still an issue, please reopen.

from jnativehook.

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.