当前位置:网站首页>Use graalvm native image to quickly expose jar code as a native shared library
Use graalvm native image to quickly expose jar code as a native shared library
2022-07-02 20:03:00 【dalongrong】
Mainly from jgrapht Of capi Learned , Say, tidy up , Later you can use
Reference play
- Code definition
package org.pkg.implnative;
- 1.
import org.graalvm.nativeimage.c.function.CEntryPoint;
- 1.
import org.graalvm.word.Pointer;
- 1.
public final class NativeImpl {
- 1.
@CEntryPoint(name = "Java_org_pkg_apinative_Native_add")
- 1.
public static int add(Pointer jniEnv, Pointer clazz, @CEntryPoint.IsolateThreadContext long isolateId, int a, int b) {
- 1.
return a + b;
- 1.
}
- 1.
}
- 1.
- Generating shared libraries
Use it directly maven plugin It is also a good method
$GRAALVM/bin/native-image --shared -H:Name=libnativeimpl -cp nativeimpl
- 1.
- effect

explain
be based on graalvm We can achieve something like golang Of export Ability , It's very convenient
Reference material
https://www.graalvm.org/reference-manual/native-image/ImplementingNativeMethodsInJavaWithSVM/
https://github.com/jgrapht/jgrapht-capi
边栏推荐
- 良心总结!Jupyter Notebook 从小白到高手,保姆教程来了!
- Solution: vs2017 cannot open the source file stdio h main. H header document [easy to understand]
- AcWing 181. Turnaround game solution (search ida* search)
- [NLP] a detailed generative text Abstract classic paper pointer generator
- JS如何取整数
- Istio部署:快速上手微服务,
- Automatic reading of simple books
- Attack and defense world PWN question: Echo
- One side is volume, the other side is layoff. There are a lot of layoffs in byte commercialization department. What do you think of this wave?
- 【Hot100】23. Merge K ascending linked lists
猜你喜欢

浏览器缓存机制概述

【NLP】一文详解生成式文本摘要经典论文Pointer-Generator

upload-labs

良心总结!Jupyter Notebook 从小白到高手,保姆教程来了!

After 65 days of closure and control of the epidemic, my home office experience sharing | community essay solicitation

Motivation! Big Liangshan boy a remporté le prix Zhibo! Un article de remerciement pour les internautes qui pleurent

测试人员如何做不漏测?这7点就够了

Istio1.12:安装和快速入门

Istio deployment: quickly start microservices,

为什么我对流程情有独钟?
随机推荐
RPD product: super power squad nanny strategy
【Hot100】23. 合并K个升序链表
GCC: Graph Contrastive Coding for Graph Neural NetworkPre-Training
Motivation! Big Liangshan boy a remporté le prix Zhibo! Un article de remerciement pour les internautes qui pleurent
Common problems and description of kt148a voice chip IC development
How to avoid duplicate data in gaobingfa?
How my mother-in-law and daughter-in-law get along
[JS] get the search parameters of URL in hash mode
Kt148a voice chip IC user end self replacement voice method, upper computer
CheckListBox control usage summary
Taiwan SSS Xinchuang sss1700 replaces cmmedia cm6533 24bit 96KHz USB audio codec chip
高并发下如何避免产生重复数据?
【Hot100】21. 合并两个有序链表
Summary of interview experience, escort your offer, full of knowledge points
Self-Improvement! Daliangshan boys all award Zhibo! Thank you for your paper
在消费互联网时代,诞生了为数不多的头部平台的话
自动化制作视频
Spark source code compilation, cluster deployment and SBT development environment integration in idea
VBScript详解(一)
GCC: Graph Contrastive Coding for Graph Neural NetworkPre-Training