Starting JNI in Mac vscode environment

Related tags

Native JNI
Overview

JNI

Starting JNI in Mac vscode environment.

본 소스코드 경로는 [projectname]/src/* 이다.

  1. Java 소스코드 작성
    Decline native, load library (helloJNI.java 소스코드 참조)

  2. 클래스 파일 생성

    $ javac [helloJNI].java
    
    • create [helloJNI].class
  3. 헤더 생성

    $ javah -JNI [helloJNI]         (구 버전)
    $ javac [helloJNI].java -h .    (신 버전)
    
    • 헤더 includepath 오류가 뜬다면 C/C++ Configurations 경로를 다음과 같이 수정해준다.
    /Applications/**
    /Users/[사용자 이름]/Desktop/**
    
  4. C or C++ 소스코드 작성(helloJNI.cpp 소스코드 참조)

  5. 라이브러리 컴파일

  • [Java <=> C]

    $ gcc -I”/[JDK 경로]/Contents/Home/include" -I”/[JDK 경로]/Contents/Home/include/darwin" -o lib[라이브러리명].jnilib -shared [패키지명].c
    
  • [Java <=> C++]

    $ g++ -I"/[JDK 경로]/Contents/Home/include" -I"/[JDK 경로]/Contents/Home/include/darwin" -o lib[라이브러리명].jnilib -shared [패키지명].cpp
    
    • lib[라이브러리명].jnilib 생성
  • 세팅 완료 및 컴파일

    • 라이브러리 참조 가져오기

      $ java -Djava.library.path=. [helloJNI]
      
    • java 직접 컴파일

      $ java [helloJNI].java 
      
You might also like...

Manage your Java environment

Master your Java Environment with jenv Website : http://www.jenv.be Maintainers : Gildas Cuisinier Future maintainer in discussion: Benjamin Berman As

Dec 30, 2022

Payara Server is an open source middleware platform that supports reliable and secure deployments of Java EE (Jakarta EE) and MicroProfile applications in any environment: on premise, in the cloud or hybrid.

Payara Server is an open source middleware platform that supports reliable and secure deployments of Java EE (Jakarta EE) and MicroProfile applications in any environment: on premise, in the cloud or hybrid.

Payara Platform Community Edition Create. Innovate. Elevate. Payara Platform Community Edition features open source server runtimes for development pr

Dec 27, 2022

RStudio is an integrated development environment (IDE) for R

RStudio RStudio is an integrated development environment (IDE) for the R programming language. Some of its features include: Customizable workbench wi

Dec 29, 2022

A MATLAB-like scientific scripting environment for Kotlin, a simpler Kotlin only version of KotlinLab

KotlinLab: Easy and effective MATLAB-like scientific programming with Kotlin and Java JShell Installation The installation of KotlinLab is very simple

Sep 28, 2022

Forest_tracker - Help protect the environment with such a simple app.

Forest Tracker 🌳 🌲 🌱 Introduction Hey there! This app is all about protecting the environment! A unique method. Deforestation is happening at an al

May 11, 2022

Google App Engine Standard Environment Source Code for Java 8 and Java11

 Google App Engine Standard Environment Source Code for Java 8 and Java11

Google App Engine Standard Environment Source Code for Java 8 and Java11. This is a repository that contains the Java Source Code for Google App Engin

Jan 2, 2023

A Jenkins plugin for inserting the commits changelog into the jenkins build environment.

commits-changelog-env-plugin A Jenkins plugin for inserting the commits changelog into the jenkins build environment. Jenkins插件, 在构建时通过将提交的更新列表插入 Jenk

Feb 16, 2022

Implementation of Greedy Particle Swarm Optimization, HSGA and Hybrid(GA+PSO) for the purpose of Task Scheduling in cloud computing environment using CloudSim

Implementation of Greedy Particle Swarm Optimization, HSGA and Hybrid(GA+PSO) for the purpose of Task Scheduling in cloud computing environment using CloudSim

Dec 18, 2022

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment

Summary A lightweight open framework for building fast and efficient cloud-native Java microservices: Open Liberty is fast to start up with low memory

Dec 21, 2022

A virtual Linux shell environment application for Android OS. Runs Alpine Linux in QEMU system emulator. Termux app fork.

vShell (Virtual Shell) — a successor of Termux project which provides an alternate implementation of the Linux terminal emulator for Android OS.

Feb 1, 2022

An easy to use api to interact with many versions of minecraft in a version independent environment.

Glass - API An easy to use api to interact with many versions of minecraft in a version independent environment. Setup Instructions should be relative

Jan 25, 2022

The project is a simple vulnerability Demo environment written by SpringBoot

The project is a simple vulnerability Demo environment written by SpringBoot

The project is a simple vulnerability Demo environment written by SpringBoot. Here, I deliberately wrote a vulnerability environment where there are arbitrary file uploads, and then use the `scan` attribute in the loghack configuration file to cooperate with the logback vulnerability to implement RCE.

Dec 14, 2022

An extension that wraps a Cellpose environment such that WSI can be analyzed using Cellpose through QuPath.

An extension that wraps a Cellpose environment such that WSI can be analyzed using Cellpose through QuPath.

QuPath Cellpose extension This repo adds some support to use 2D Cellpose within QuPath through a Python virtual environment. Installing Step 1: Instal

Nov 25, 2022

A React Native Template for installing a working ClojureScript, Krell, and Storybook environment

A React Native Template for ClojureScript, Krell, and Storybook Getting Started npx react-native init YourProjectName --template react-native-template

Dec 23, 2022
Owner
김용빈
김용빈
A JNI code generator based on the JNI generator used by the eclipse SWT project

HawtJNI Description HawtJNI is a code generator that produces the JNI code needed to implement java native methods. It is based on the jnigen code gen

FuseSource 153 Nov 17, 2022
:package: Gradle/Maven plugin to package Java applications as native Windows, Mac OS X, or GNU/Linux executables and create installers for them.

JavaPackager JavaPackager is a hybrid plugin for Maven and Gradle which provides an easy way to package Java applications in native Windows, Mac OS X

Francisco Vargas Ruiz 665 Jan 8, 2023
Packages your JAR, assets and a JVM for distribution on Windows, Linux and Mac OS X

About Packages your JAR, assets and a JVM for distribution on Windows, Linux and macOS, adding a native executable file to make it appear like a nativ

libgdx 2.4k Dec 24, 2022
Packages your JAR, assets and a JVM for distribution on Windows, Linux and Mac OS X

About Packages your JAR, assets and a JVM for distribution on Windows, Linux and macOS, adding a native executable file to make it appear like a nativ

libgdx 2.4k Jan 5, 2023
Java/JNI bindings to libpostal for for fast international street address parsing/normalization

jpostal These are the Java/JNI bindings to libpostal, a fast, multilingual NLP library (written in C) for parsing/normalizing physical addresses aroun

openvenues 94 Oct 15, 2022
JPassport works like Java Native Access (JNA) but uses the Foreign Linker API instead of JNI. Similar to JNA, you declare a Java interface that is bound to the external C library using method names.

JPassport works like Java Native Access (JNA) but uses the Foreign Linker API instead of JNI. Similar to JNA, you declare a Java interface t

null 28 Dec 30, 2022
A library for bypassing all of Java's security mechanisms, visibility checks, and encapsulation measures via the JNI API

Narcissus: thwart strong encapsulation in JDK 16+ Narcissus is a JNI native code library that provides a small subset of the Java reflection API, whil

ToolFactory 29 Nov 3, 2022
using LWJGL to make a mini minecraft (mac also can run)

MineCraft Mini Features MineCraft Lite in Java and OpenGL Physics simulation, water simulation Perlin noise algorithm to generate maps Directional flo

null 1 Jan 4, 2022
The ANT HAL Service functions as a JNI wrapper for the ANT HAL.

Android ANT HAL Service v.4.0.0 - 25 Aug 2014 The ANT HAL Service functions as a JNI wrapper for the ANT HAL. The ANT Hal Service provides the messagi

Project Kaleidoscope 0 Jun 11, 2022