Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Java in native executable

Options
  • 14-06-2001 6:31pm
    #1
    Registered Users Posts: 7,314 ✭✭✭


    Right this may sound stupid or just odd, but from my experence with java its useless n pointless for clients on the win32 platfrom unless in a native executable.....but how one gets this to work i don't know...i have seen natives made from java but is there some secret program companies keep to turn class into exe? altho it might sound like it defeats the purpose of java but none the less...and this info don't seem to be anywhere i've talked to many college students doing java...none have a clue don't seem to be in any books either any help?


Comments

  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    creating natives defeats the purpose of Java and I've found most Natives aren't really.

    What that is an Exe which launches "java x.class" and contains a scaled down JDK which contains only the packages related to it. Jext is an example of this.

    It is not a good idea though as your just wasting diskspace. It's better for the client to have a JDK on thier machine and just run it from there.


  • Registered Users Posts: 7,314 ✭✭✭Nietzschean


    yeah i'd agree but the only problem is what % of people in the world know how to work a jdk? and what if jdk versions don't match?


  • Closed Accounts Posts: 1,322 ✭✭✭phobos


    I was acutally wondering the same thing. What if your clients did not have a jdk etc...

    In college we were told: To compile java source in to a native machine code, you would use a JIT compiler. Now as far as I know there are easy to come by. But I don't have any experience with one, because I have never released any application software to the general public before (hense I wouldn't have to worry about it). Tis a pitty because it's easy with applets because your browser has it's own VM and can lauch the Java classes in those, but what to do with an application is a different story alltogether.

    I suppose to back up all this rambling, check this out
    http://www.sun.com/solaris/jit/

    G'luck

    ;-phobos-)

    [This message has been edited by phobos (edited 15-06-2001).]


  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    JIT compiles the bytecode into native machine code so it can run faster. It does not make an EXE.



  • Registered Users Posts: 7,314 ✭✭✭Nietzschean


    So the question remains how do they make those programs from java n have no class files in the final realse?


  • Advertisement
  • Closed Accounts Posts: 1,322 ✭✭✭phobos


    Damit, close though!

    Serial, if you find the solution to the EXE creation process, make sure you let the rest of us know.

    I downloaded an application off the net recently that was written in Java + used a batch file to execute it's byte code. But the batch file just pointed to the jdk on my machine. I would guess that it searched for the path of my java.exe interpreter first (coz I could have installed that anywhere). That is really crap thought, coz I cannot see how it would work if I had no jdk.

    Now I'm confused confused.gif

    ;-phobos-)



  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    For Win32 you could use J++, and before you all start going on about the price of Visual Studio (I know, I know) you can download the MSJavaSDK for free from:

    http://www.microsoft.com/java/download/dl_sdk40.htm

    although it is 19.2mb so I your downloading at home it's not free. Back to my point though; basically this uses the J++ compiler to create a COM wrappable EXE that will run on Win32 platforms that have the Microsoft Virtual Machine, and Windows comes bundled with IE so they all have it. To create you EXE you:

    1)Compile your classes with jvc.exe
    2)Register the classes with vjreg.exe
    3)Package them with jexegen.exe


    Easy isn't it? No it's not but it is do-able, and you always have Boards.ie for support. I've created EXE and ActiveX Dll's with Java using this method.


    [edit]
    Oh, and this SDK comes with a lot of documentation that is easy to use
    [/edit]

    [This message has been edited by Evil Phil (edited 15-06-2001).]


  • Registered Users Posts: 7,314 ✭✭✭Nietzschean


    thx alot for the info thats working fine fer me now altho the stupid ms compiler is rejecting half me ole code smile.gif


  • Closed Accounts Posts: 218 ✭✭Void


    I mentioned this product before.
    IBM's "Visual Age for Java" is a very nice product that (among other things) lets you compile Java code to native binaries for various platforms (Win32, RS/Whatever - that IBM thingy.....etc).


Advertisement