How can I view native code in Java?

I am trying to write a program to find the log of a number. I looked for Java's implementation in Math.log(x), but it is a native method. How can I see the code in the other language(C or C++)? I have looked at JNI, but i don't think it is what i need. Any Ideas??

Before the Mustang release, i don't believe sun
released the source code to the native binaries.Actually, I'm pretty sure they did, but I don't know off the top of my head where to get it. You'd have to search.

Similar Messages

  • How can i watch native code for hashCode() in Object class?

    How can i watch native code for hashCode() in Object class?

    Those are two different requirements. You still haven't told us why you want the first one.
    The second one is called JNI - Java Native Interface. There is a forum here, and a large amount of documentation, and a book about it.

  • How can i merge javafx code and java fxml code in a single project

    how can i merge javafx code and java fxml code in a single project.
    Please let me Know as soon as possible.

    Everything that it is possible to retrieve from a class file can be deduced from the class file definition.
    http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html
    Sylvia.

  • How can i rewrite this code into java?

    How can i rewrite this code into a java that has a return value?
    this code is written in vb6
    Private Function IsOdd(pintNumberIn) As Boolean
        If (pintNumberIn Mod 2) = 0 Then
            IsOdd = False
        Else
            IsOdd = True
        End If
    End Function   
    Private Sub cmdTryIt_Click()
              Dim intNumIn  As Integer
              Dim blnNumIsOdd     As Boolean
              intNumIn = Val(InputBox("Enter a number:", "IsOdd Test"))
              blnNumIsOdd = IsOdd(intNumIn)
              If blnNumIsOdd Then
           Print "The number that you entered is odd."
        Else
           Print "The number that you entered is not odd."
        End If
    End Sub

    873221 wrote:
    I'm sorry I'am New to Java.Are you new to communication? You don't have to know anything at all about Java to know that "I have an error," doesn't say anything useful.
    I'm just trying to get you to think about what your post actually says, and what others will take from it.
    what does this error mean? what code should i replace and add? thanks for all response
    C:\EvenOdd.java:31: isOdd(int) in EvenOdd cannot be applied to ()
    isOdd()=true;
    ^
    C:\EvenOdd.java:35: isOdd(int) in EvenOdd cannot be applied to ()
    isOdd()=false;
    ^
    2 errors
    Telling you "what code to change it to" will not help you at all. You need to learn Java, read the error message, and think about what it says.
    It's telling you exactly what is wrong. At line 31 of EvenOdd.java, you're calling isOdd(), with no arguments, but the isOdd() method requires an int argument. If you stop ant think about it, that should make perfect sense. How can you ask "is it odd?" without specifying what "it" is?
    So what is this all about? Is this homework? You googled for even odd, found a solution in some other language, and now you're just trying to translate it to Java rather than actually learning Java well enough to simply write this trivial code yourself?

  • How can I view the code for a routine in an update rule

    on loading data for 0PLANT_ATTR, I am getting an error for No Local Currency found in Plant 1000 and SAles Org 6000. 
    in looking at the update rules for this, I see that there is a routine for the update of the local currency:
    Perform GET_LOCCURRCY_FOR_PLANT
    USING COMM_STRUCTURE-PLANT
    COMM_STRUCTURE-SALESORG
    CHANGING hlp_monitor
    RESULT
    hlp_subrc.
    How do I see the code behind this?  I want to make sure that I understand everything that needs to be populated in Master Data so that I can ask my functional consultant to update all the necessary fields.
    Thanks
    JP

    Hi Riccardo,
    When I double click on it, I get a message at the bottom that says program reindexed. 
    After looking again, I found that when I double clicked on the comm structure, then the routine, I was able to see it.
    Thanks
    JP

  • How can I view html codes ?

    I have some text and images composed in a yahoo group.  I need to cut and paste it into an html box on MYSPACE.  I've already tried checking Yahoo's "View html Source" box.  Nothing appears.  I also tried clicking on my imac "View Source" in the tool bar, pasted the code into the html box but only got code, not text and images. 
    Is this something that can't be done unless you are an html code wiz?

    I don't use Myspace, but if you're given an HTML box to fill in, it will almost certainly show as code until you submit it, and then, if the code is correct, it should display your layout correctly as text and images on the new page.
    Note that images may not transfer correctly unless their source tags contain absolute references - eg "http://yahoo.com/images/myimage1.jpg" should be fine, but "../images/image1.jpg" will not work.
    Matt

  • How can I view the code of a program in a browser?

    For example, is it possible for me to see the code of this program:
    http://cisweb.mwcc.edu/st01/robertscourseversion2/runapplet.htm
    Sorry, I know this is a dumb question, I just started to learn Java.

    In general, no. The applet you see is contained in one or more .class files -
    possibly contained in a .jar file. There may also be other files (resources)
    that the applet is using.
    If you go to that page and look at the .html source (browsers will let you do this)
    you see:<html>
      <body>
        <applet code = ClassApplet.class
          width = 400
          height = 400>
        </applet>
      </body>
    </html>In this case it appears that at least one of the files involved can be obtained
    from the url http://cisweb.mwcc.edu/st01/robertscourseversion2/ClassApplet.class
    It is possible to "reconstruct" the source (search the fabulous web for
    "Java Decompiler"). And this source may well lead you other classes and
    resources that are being used.*
    There may be legal restrictions on what you can and can't do with stuff that's
    made publically accessible on the internet. (I'm no lawyer.)
    * In the course of writing this I downloaded JAD - a common java decompiler -
    and ran it on this class file. There seem to be no other .class files being
    referenced within it.

  • How can we write the code for opening the command prompt and closing the

    how can we write the code in java for opening the command prompt and closing the cmd prompt from eclipse (cmd prompt should close when click on the turminate button in eclipse)

    rakeshsikha wrote:
    how can we write the code for opening the command prompt and closing theBy typing in Eclipse (which you seemingly have)?

  • How can I view the source code of chrome://browser/content/browser.xul?

    How can I view the source code of chrome://browser/content/browser.xul of mobile FireFox?
    In my desktop version I just open this page in new tab and view webpage source, but there is no option for FF mobile to view source code.
    Best regards.

    Does the view-source: protocol work on mobile?
    *view-source:chrome://browser/content/browser.xul

  • How can i modify exe resource in java?

    How can i modify exe resource in java?
    No jni
    thx.

    if it is .NET code decompilation is possible if, and only if the code is not Packed by protections!
    but if the EXE file is native and created by VB 6.0,C/C++,Delphi,... it is not possible to obtain source code from it, not as far as i know.
    (some program does it , but the returned source code is as useful as its assembly code in debugger).
    if decompilation was that easy then Reverse Engineering was no longer needed!
    What program it is so that can put two exe file into each other ?
    the program you seen might put second exe file into its DATA section then when it executes ,
    it jumps to data section of itself!
    otherwise it is not possible.
    Good luck.
    Edited by: 0mega7 on Apr 5, 2008 8:27 AM
    Edited by: 0mega7 on Apr 5, 2008 8:29 AM

  • Profile native code that JAVA application runs

    our application is suffers from a severe memory leak. the application runs on Weblogic that uses the severe container and access Oracle DB.
    the JAVA heap was monitored for several weeks (using the verbose gc flag) and no leak was discovered. we monitored the native heap (by using the pmap command) and we saw that the heap size increasing. therefor we think the problem is in the native code that runs in this process (the major suspect is the OCI, Oracle client).
    after reading the man page of collect and your Article (Profiling Java Appl with Sun Studio 11) I'm confused. I would like to monitor the native heap (with -H option) but in the man page it's written that "Heap profiling is not supported for java programs" so i wheni set the flag -j off i got a warning that this process is java and i might use the -j on.
    please advice what are the values of the flags -j an -H in case of i need to monitor the native code of java application.
    thanks
    yahav

    thanks again for the additional article about the Weblogic.
    in the startManaged script I added the following prefix:
    collect -H on -j off -d /tmp/ java...
    when i typed leaks on er_print, i got a list of possible leaks and allocs.
    some activities were made on the application so i assume that data should be collected. as the size of the experiment folder slightly increased.
    so far we can assume that the data that is relegated to the non java process was collected.
    when i typed leaks again within the er_print tool i got the same results.
    it means that no native heap activities was made.
    is it correct analysis?
    regards the leak that was discovered above, how one can identify the function that cause this leak. i can see calls like:
    malloc, ReadKnownVMs, CreateExecutionEnvironment. this functions relate to the JVM. i would expect to see some trace (allocs) regards the other native code that runs such as the Oracle OCI client.
    I'm suspecting i'm collecting this info.
    is there any other flags to set for such collection? or any other commands in the analysis command

  • How can i get system variable using java

    Hi,
    I just want to know how can i get system variables using java code.
    for example i want to get the the date for today or i want to get the number of processes that's running.
    Thanks alot

    Hi,
    I just want to know how can i get system variables
    using java code.
    for example i want to get the the date for today or i
    want to get the number of processes that's running.
    Thanks alotSome generic "system variables" are available though Java, usually through the System class.
    Date today = new Date();
    is instantiated with the current date and time.
    Other system values, like environment values, should be passed to java through the command line (-D option) by setting system properties.
    Finally, platform specific values like the number of processes running will have to be written in platform specific code and executed by JNI (java native interface).
    Java is platform or system agnostic. Common system values, like time, are implemented. Hopefully you won't need platform specific values.

  • How can I view my iCloud contacts from someone else's iPhone? I don't want to change their phone settings.

    Yesterday I ran into a problem that was eye opening to say the least. I could not not access my contacts in order to find a friend's phone number. No one remembers phone numbers any more. God knows I don't.
    I was on a jetski and it broke down. I was stranded at a dock miles away. I needed to contact my friend to tell him (a) I'm ok, (b) where I was, (c) to bring a tow. Of course I had no phone on me because it would have gotten soaked.
    People were kind enough on the dock to let me use their smart phones to attempt to retreive the phone number and call for help. But I quickly discovered that it is impossible.
    On an iPhone, I tried to use their Safari browser to go to www.icloud.com. When you do that, it simply redirects you to the apps. But it isn't my phone, and their apps are logged in to the owner's accounts. I wasn't about to update the settings in a stranger's phone.
    One guy let me try his iPad with Cellular. Same problem as the iphones. It would not let me use www.icloud.com. It insisted that I use the native iOS apps.
    On an Android, www.icloud.com would simply refuse to work. It would say it was not supported.
    The question I have is: How can I view my contacts from someone else's smart phone in an emergency situation?
    Second question: Why can't I use www.icloud.com on a smart phone's web browser like I can on regular computer?
    I got lucky. I happened to know my mom's home number. Many hours later she was home and I was able to use a phone to call her. She brought up www.icloud.com on her home computer, logged on as me, and read me the phone number I was seeking. But what are the chances of being able to call a trusted person who has access to a computer to do this for you?

    Without "pretending" to be yourself on the other phone (change settings) there's nothing else you can do.
    iOS devices are meant to be single user and can't view iCloud.com the same way a Mac or PC can do.
    You need to find a desktop or laptop machine (Mac or PC) to log in at iCloud.

  • How can i execute Spaces API in java main class?

    Hi
    I am able to execute Spaces API through portal application. However if i try to execute it in java main class, its throwing an exception
    "SEVERE: java.io.FileNotFoundException: .\config\jps-config.xml (The system cannot find the path specified)"
    oracle.wsm.common.sdk.WSMException: WSM-00145 : Keystore location or path can not be null or empty; it must be configured through JPS configuration or policy configuration override.
    How can i set this path, so that i can execute Spaces API from java main class.
    Need this main class to configure in cron job, to schedule a task.
    Regards
    Raj

    Hi Daniel
    Currently i have implemented create functionality in my portal application using Spaces API, which is working fine. Now the requirement is, i need to implement a "Cron Job" to schedule a task, which will execute to create space(for example once in a week). Cron job will execute only the main method. So I have created java main class, in which I have used Spaces API to perform create space operation. Then it was giving exception.
    Later I understood the reason, as I am executing the Space API with a simple JSE client, its failing since a simple java program has no idea of default-keystore.jks, jps-config.xml, Security Policy. Hence i have included those details in main class. Now I am getting new error,
    SEVERE: WSM-06303 The method "registerListener" was not called with required permission "oracle.wsm.policyaccess"
    For your reference i have attached the code below, please help. How can i use Spaces API in java main method(i mean public static void main(String[] args) by giving all required information.
        public static void main(String[] args) throws InstantiationException,
                                                      GroupSpaceWSException,
                                                      SpacesException {
            Class2 class2 = new Class2();
            GroupSpaceWSContext context = new GroupSpaceWSContext();
            FactoryFinder.init(null);
            context.setEndPoint("http://10.161.226.30/webcenter/SpacesWebService");
            context.setSamlIssuerName("www.oracle.com");
            context.setRecipientKeyAlias("orakey");
            Properties systemProps = System.getProperties();
            systemProps.put("java.security.policy","oracle/wss11_saml_or_username_token_with_message_protection_client_policy");
            systemProps.put("javax.net.ssl.trustStore","C:\\Oracle\\Middleware11.1.7\\wlserver_10.3\\server\\lib\\cacerts.jks");
    systemProps.put("oracle.security.jps.config","C:\\Oracle\\Middleware11.1.7\\user_projects\\domains\\workspace\\system11.1.1.7.40.64.93\\DefaultDomain\\config\\fmwconfig\\jps-config.xml");
            systemProps.put("javax.net.ssl.keyStore",C:\\Oracle\\Middleware11.1.7\\user_projects\\domains\\workspace\\system11.1.1.7.40.64.93\\DefaultDomain\\config\\fmwconfig\\consumer.jks");
            systemProps.put("javax.net.ssl.keyStorePassword", "Test12");
            System.setProperties(systemProps);
            GroupSpaceWSClient groupSpaceWSClient;
            try {
                groupSpaceWSClient = new GroupSpaceWSClient(context);
                System.out.println("URL: " +
                                   groupSpaceWSClient.getWebCenterSpacesURL());
                //delete the Space
                List<String> groupSpaces = groupSpaceWSClient.getGroupSpaces(null);
                System.out.println("GroupSpaces:: " + groupSpaces.size());
            } catch (Exception e) {
    Regards
    Raj

  • How can i get the code html and css of my form please help me

    how can i get the code html and css of my form

    HI,
    If you like to embed the HTML form in your web page then you will need to obtain the form code from the Distribite/Embed tab. Additional information can be found here: http://forums.adobe.com/docs/DOC-1991
    You will not be able to access/modify the css code or the rest of the form html code.  If you like to view the source of of a HTML page, please use your browser 'view source code' functionality.
    I hope this answer your question,
    Thanks,
    Lucia

Maybe you are looking for