-3

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.

Community
  • 1
  • 1
Tyler Durden
  • 11,156
  • 9
  • 64
  • 126

3 Answers3

2

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
rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156
Tyler Durden
  • 11,156
  • 9
  • 64
  • 126
1

You can start the browsing from StrictMath.c

For example, asin (redefined as jasin) is in e_asin.c

robermann
  • 1,722
  • 10
  • 19
0

If just research, you can use OPENJDK7&8 instead.

you can download from OpenJDK Project.

you can attach to eclipse.

stackvoid
  • 117
  • 1
  • 2
  • 9
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – amdixon Oct 10 '15 at 14:19
  • @amdixon: You need to be more thoughtful in applying the link-only answer deletion rule. It doesn't make sense to "include the essential parts" of a download link. – President James K. Polk Oct 10 '15 at 15:08
  • @JamesKPolk the user is asking which specific file some code is in. a download link for the entire jdk is therefore not informative. so yes essential parts should include the file location within the zip ( and probably the user should learn how to search ) – amdixon Oct 11 '15 at 00:33
  • Thanks for your hints – stackvoid Oct 13 '15 at 03:13