# Calling C and Assembly from Java with JNI on Windows

DevFeed: [Calling C and Assembly from Java with JNI on Windows](<https://devfeed.tech/articles/java-c-assembly-matryoshka-38613.md>)

Original publisher: [Read original article](<https://krossovochkin.com/posts/2019_06_04_java_c_assembly_matryoshka/>)

Published: 2019-06-04T00:00:00Z

Content type: tutorial

Language: en

Sources: [Vasya Drobushkov](<https://devfeed.tech/sources/vasya-drobushkov.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Assembly](<https://devfeed.tech/topics/assembly.md>), [C](<https://devfeed.tech/topics/c.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [assembly](<https://devfeed.tech/tags/assembly.md>), [c](<https://devfeed.tech/tags/c.md>), [code](<https://devfeed.tech/tags/code.md>), [java](<https://devfeed.tech/tags/java.md>), [windows](<https://devfeed.tech/tags/windows.md>)

## AI overview

A practical demonstration of connecting Java to C through JNI and delegating a method from C to Assembly on Windows. The example uses a simple Java command-line program that sums two integers, and the article notes that this setup provides no real-world speed advantage for such a small example.

## Source excerpt

Source Disclaimers: I'll use Windows and more particularly Visual C++ with its Inline Assembler. If you use MacOs or Linux you will have significant differences comparing to what is described in the article. Everything below is shown mostly for demonstration purposes Introduction Java is mature self-sufficient language, though as we all know it is possible to "connect" java to C (via Java-Native-Interface or JNI) to speed up some critical pieces of code. Also for C/C++ it is possible to delegate some even more critical pieces of code directly to Assembly.