Help understanding
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: Help understanding

  1. #1
    Join Date
    Sep 2011
    Posts
    197

    Help understanding

    So there is the java language you use to code, which is compiled and ends up being the JNI? But, there are also java commands like goto, that I have only seen when dealing with .bat files or basically GUI. So the main java language is to JNI, whereas the commands are to GUI?

  2. #2
    Join Date
    Jun 1999
    Location
    SW Missouri
    Posts
    3,422

    Re: Help understanding

    the java language you use to code, which is compiled and ends up being the JNI

    No. The compiled code is the .class file which is read and interpreted by the java program

    there are also java commands like goto

    No. Java does not have commands. goto is a statement in some other computer languages.
    Norm

  3. #3
    Join Date
    May 2009
    Posts
    2,413

    Re: Help understanding

    Quote Originally Posted by kolt007 View Post
    So there is the java language you use to code, which is compiled and ends up being the JNI? But, there are also java commands like goto, that I have only seen when dealing with .bat files or basically GUI. So the main java language is to JNI, whereas the commands are to GUI?
    Sounds familiar. Bobgateaux or Kingofthejav I presume?

  4. #4
    Join Date
    Sep 2011
    Posts
    197

    Re: Help understanding

    Quote Originally Posted by Norm View Post
    No. Java does not have commands. goto is a statement in some other computer languages.
    I've used goto like this
    Code:
    if exists %program files%/java/jdk (goto end)
    :end
    %programfiles%/internet explorer/iexplore.exe
    exit
    Also, you say no but, I thought JNI was the .class file's I thought that was the native interface? If not what is it called?

  5. #5
    Join Date
    Jun 1999
    Location
    SW Missouri
    Posts
    3,422

    Re: Help understanding

    .class files contain byte code
    Norm

  6. #6
    Join Date
    May 2009
    Posts
    2,413

    Re: Help understanding

    Quote Originally Posted by kolt007 View Post
    I've used goto like this
    Also, you say no but, I thought JNI was the .class file's I thought that was the native interface? If not what is it called?
    In most cases the Java source code is compiled to an intermediate language called bytecode. This bytecode is then run by a program called the JVM (Java Virtual Machine). The JVM is formally an interpreter but it's very advanced. It performs compilations of the bytecode to native machine language on the fly while the program is running. This makes Java programs very fast, almost as fast as programs that are compiled to machine language before they're run (which is possible to do also with Java programs (with the help of a so called Java native compiler)).

    The JNI (Java Native Interface) is a specification telling how one can make code written in other languages part of a Java program.

  7. #7
    Join Date
    Sep 2011
    Posts
    197

    Re: Help understanding

    what about .bat does .bat use different API classes then the normal java code? I think it's doubtfull but, some how when you give a file the extension '.bat' it inherits things like a direct link to a shell window? HOw does that work is that run by JVM because I don't even need to compile a .bat...

  8. #8
    Join Date
    May 2006
    Location
    UK
    Posts
    4,474

    Re: Help understanding

    what about .bat
    A .bat file has nothing to do with Java, it is text file containing commands which are interpreted by the Windows command interpretor. See the article.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center