java - 是否有用于访问 native Windows API 的 Java 库?

标签 java windows winapi

是否有用于访问 native Windows API 的 Java 库?使用 COM 或 JNI。

最佳答案

你可以试试这两个,我都看到成功了。

http://jawinproject.sourceforge.net

The Java/Win32 integration project (Jawin) is a free, open source architecture for interoperation between Java and components exposed through Microsoft's Component Object Model (COM) or through Win32 Dynamic Link Libraries (DLLs).

https://github.com/twall/jna/

JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing anything but Java code—no JNI or native code is required. This functionality is comparable to Windows' Platform/Invoke and Python's ctypes. Access is dynamic at runtime without code generation.

JNA allows you to call directly into native functions using natural Java method invocation. The Java call looks just like it does in native code. Most calls require no special handling or configuration; no boilerplate or generated code is required.

也在这里阅读:

http://en.wikipedia.org/wiki/Java_Native_Interface

The Java Native Interface (JNI) is a programming framework that allows Java code running in a Java Virtual Machine (JVM) to call and to be called1 by native applications (programs specific to a hardware and operating system platform) and libraries written in other languages, such as C, C++ and assembly.

http://en.wikipedia.org/wiki/Java_Native_Access

Java Native Access provides Java programs easy access to native shared libraries without using the Java Native Interface. JNA's design aims to provide native access in a natural way with a minimum of effort. No boilerplate or generated glue code is required.

关于java - 是否有用于访问 native Windows API 的 Java 库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/606820/

相关文章:

c++ - 将 GetVersionEx 数字转换为操作系统名称

C++ - Windows - 如何(写入&&读取)命令外壳

c++ - 我在哪里可以创建没有管理员权限/特权的目录?

java:Hibernate 一对多关联

windows - 双工命名管道在某个写入时挂起

winapi - PostMessage 似乎被其他窗口的操作阻止

visual-c++ - 为什么没有定义 PCTSTR 但定义了 LPCTSTR?

java - 使用 Java JNA 和 SendInput() 发送键盘输入

java - Android Apache Logger 在生产(发布版本)中无故崩溃

java - 我需要将正则表达式的所有匹配项包含到一个文本文件中;我是java编程新手