The Oracle-recommended reference implementation at OpenJDK has the native math methods in the following folder location:
jdk1.6\src\jdk\src\share\native\java\lang\fdlibm\src\*.c
Frage
Per the title, where is the source code for the native java.lang.math methods JDK 7?
Please don't point me to Where to find source code for java.lang native methods? this only answers for JDK 6.
Oracle no longer appears to provide source for native methods at all.
I looked in http://hg.openjdk.java.net/jdk7/hotspot/hotspot but there are thousands and thousands of files with no obvious relationship to the package structure of the Java core so I cannot see any way to find the java.lang.Math methods.
Lösung
The Oracle-recommended reference implementation at OpenJDK has the native math methods in the following folder location:
jdk1.6\src\jdk\src\share\native\java\lang\fdlibm\src\*.c
Andere Tipps
You can start the browsing from StrictMath.c
For example, asin
(redefined as jasin
) is in e_asin.c
If just research, you can use OPENJDK7&8 instead.
you can download from OpenJDK Project.
you can attach to eclipse.