当前位置:网站首页>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
边栏推荐
- PXE installation "recommended collection"
- AcWing 340. Solution to communication line problem (binary + double ended queue BFS for the shortest circuit)
- Refactoring: improving the design of existing code (Part 2)
- 良心总结!Jupyter Notebook 从小白到高手,保姆教程来了!
- Start practicing calligraphy
- 现在券商的优惠开户政策什么?实际上网上开户安全么?
- [source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
- B-end e-commerce - reverse order process
- C language linked list -- to be added
- esp32c3 crash分析
猜你喜欢
浏览器缓存机制概述
Istio1.12: installation and quick start
Sometimes only one line of statements are queried, and the execution is slow
pytorch 模型保存的完整例子+pytorch 模型保存只保存可訓練參數嗎?是(+解决方案)
台湾SSS鑫创SSS1700替代Cmedia CM6533 24bit 96KHZ USB音频编解码芯片
API文档工具knife4j使用详解
[NLP] a detailed generative text Abstract classic paper pointer generator
Jetson XAVIER NX上ResUnet-TensorRT8.2速度与显存记录表(后续不断补充)
【Hot100】21. Merge two ordered linked lists
Solution to blue screen after installing TIA botu V17 in notebook
随机推荐
Share several map bed websites for everyone to share pictures
GCC: Graph Contrastive Coding for Graph Neural NetworkPre-Training
Why do I have a passion for process?
B-end e-commerce - reverse order process
AcWing 1129. Heat wave solution (shortest path SPFA)
Educational codeforces round 129 (rated for Div. 2) supplementary problem solution
B端电商-订单逆向流程
Google Earth engine (GEE) - Landsat 9 image full band image download (Beijing as an example)
Esp32c3 crash analysis
勵志!大凉山小夥全獎直博!論文致謝看哭網友
攻防世界pwn题:Recho
For (Auto A: b) and for (Auto & A: b) usage
Implementation of online shopping mall system based on SSM
CRM客户关系管理系统
蓝牙芯片ble是什么,以及该如何选型,后续技术发展的路径是什么
Basic concept of database, installation and configuration of database, basic use of MySQL, operation of database in the project
多端小程序开发有什么好处?覆盖百度小程序抖音小程序微信小程序开发,抢占多平台流量红利
Automatically generate VGg image annotation file
API documentation tool knife4j usage details
Postman interface test practice, these five questions you must know