Identify library file/Source that contains native method implementation

家住魔仙堡 提交于 2019-12-02 08:15:39

Found answer for String.intern() with quick google search

Yet to find answer for generic way to identify native implementation/library

Download this JDK 6 library:

http://download.java.net/jdk6/source/

and search through sources.

But I think, some code implementations are not accessible as OpenSource

There is no general approach to find source code for (any) native method. But if we narrow the question to the native jre methods, then you can find some implementations in the (full) source code of openJdk.

Just keep in mind that those are the implementations for just one JRE, other implementations of Java may have different implementations of the native methods.

To find the source for a native method: search the repository for the JNI header files, then you should get the name of the C/C++ function that provides the implementation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!