当前位置:网站首页>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
边栏推荐
- Solution to blue screen after installing TIA botu V17 in notebook
- [ERP software] what are the dangers of the secondary development of ERP system?
- 为什么我对流程情有独钟?
- Start practicing calligraphy
- Exemple complet d'enregistrement du modèle pytoch + enregistrement du modèle pytoch seuls les paramètres d'entraînement sont - ils enregistrés? Oui (+ Solution)
- 攻防世界pwn题:Recho
- Data Lake (XII): integration of spark3.1.2 and iceberg0.12.1
- Istio1.12:安装和快速入门
- At compilation environment setup -win
- 分享几个图床网址,便于大家分享图片
猜你喜欢
Spark source code compilation, cluster deployment and SBT development environment integration in idea
SBT tutorial
疫情封控65天,我的居家办公心得分享 | 社区征文
Jetson XAVIER NX上ResUnet-TensorRT8.2速度与显存记录表(后续不断补充)
数据库模式笔记 --- 如何在开发中选择合适的数据库+关系型数据库是谁发明的?
自動生成VGG圖像注釋文件
KT148A语音芯片ic的软件参考代码C语言,一线串口
Postman接口测试实战,这5个问题你一定要知道
通信人的经典语录,第一条就扎心了……
Istio1.12: installation and quick start
随机推荐
接口测试到底怎么做?看完这篇文章就能清晰明了
Kt148a voice chip IC user end self replacement voice method, upper computer
台湾SSS鑫创SSS1700替代Cmedia CM6533 24bit 96KHZ USB音频编解码芯片
After 65 days of closure and control of the epidemic, my home office experience sharing | community essay solicitation
AcWing 181. Turnaround game solution (search ida* search)
How to set priorities in C language? Elaborate on C language priorities
upload-labs
职场四象限法则:时间管理四象限与职场沟通四象限「建议收藏」
RPD出品:Superpower Squad 保姆级攻略
How can testers do without missing tests? Seven o'clock is enough
AcWing 1127. Sweet butter solution (shortest path SPFA)
八年测开经验,面试28K公司后,吐血整理出高频面试题和答案
Istio deployment: quickly start microservices,
Cuckoo filter
Automated video production
有时候只查询一行语句,执行也慢
Data Lake (XII): integration of spark3.1.2 and iceberg0.12.1
CheckListBox control usage summary
Motivation! Big Liangshan boy a remporté le prix Zhibo! Un article de remerciement pour les internautes qui pleurent
SBT tutorial