Converting .java to .exe files  to run those without runtime environment

i want to convert my java code to a windows application file so that when ever i have to take it to some place for description, i would not require to install java run time environment. and can show up the working of the code with the help of it..................

Converting a Java application into an exe file
This question is sometimes asked many times on a single day in the comp.lang.java.* newsgroups, and I always end up asking the same question: why do you want to? Most answers fall into one of four categories, and each prompts a different course of action. Most of the time, an exe file isn't actually required.
Reason 1: Speed
"Java is interpreted, so I want to make it native and make it faster." Well, very few modern desktop VMs actually spend much time interpreting Java bytecodes these days. Everyone and their dog has a JIT (Just In Time) compiler which will compile your code into native form before running it. Smart VMs will do this only when appropriate (ie if the code is going to be run more than once, or contains loops etc), and may recompile the code on the fly if the conditions change (eg if a subclass is loaded which invalidates some inlining optimisations, or if the code is run very frequently and therefore merits more aggressive optimisations). The bottom line is that for most applications, Java running on a VM is pretty fast these days. It's usually pretty close to the speed of a natively compiled and similar C/C++ application - certainly I've seen changing compiler (or compiler options) for C/C++ make more difference to speed than going between Java running on a VM and natively compiled Java.
There are some situations where the speed difference is significant. If you're really desperate for that extra bit of performance, try evaluating one of the native compilers listed here with your particular application. Make sure you write some real benchmarks though - vague notions of "feeling faster" may well be down to preconceptions.
Remember, too, that as new VMs come out, they tend to improve performance. That means that to get the best out of your application if it's running on a VM, the user only needs to download a later VM - no action is needed on your part. If they're using your natively compiled code, you'll probably need to recompile on a later version of the native compiler, if one is available.
Reason 2: Being able to open an application by double-clicking on it
If you can ask the user to install a JRE first, executable jar files are the way to go here. They're very simple to set up and use, and it won't cost you any money. See "Jar" in the Java Glossary for further information on how to create an executable jar file.
Reason 3: Not having to distribute a jar file and the JRE
Well, in some form or other, your users will need a runtime environment. Some native code compilers even require you to have a JRE installed as well! Chances are you're not going to be able to create a much smaller download, if that's the worry. However, there are other options here which make it easy to install your application. There's Java Web Start which also includes automatic upgrading of your software, but which will impose some restrictions (a bit like an applet, but slightly less restrictive) unless you sign your application. Alternatively, there are quite a few installers available, some of which are free (or free for personal use). See Installer in the Java Glossary for a list of some of them.
Reason 4: Intellectual property protection
Java byte-code can be decompiled pretty easily, and even obfuscators can only do so much. Here, native compilers really do make a difference. Obviously they won't make your code totally impossible to understand, but it'll be very difficult to get back to Java sources which could be modified and recompiled. The only further question to ask at this stage is whether the downsides of native compilation (eg it being a less-well-used (and therefore likely to be less solid) platform, being expensive etc) are worth the upside of the added protection. In some cases the answer will be yes, in some cases the answer will be no.
What next?
If, after reading through the above, you still want to try a native compiler, you can usually evaluate them before buying them. (Some are free, of course.) There's a list on Marco Schmidt's web-site, along with another view of the pros and cons.
I go the above article in : http://www.yoda.arachsys.com/java/javaexe.html

Similar Messages

  • Bakrudeen :convert Java to executable file on DOS6.22 without JVM

    I'm sorry that I can't see your solution any more.
    Hi,Bakrudeen
    I've seen the your advice, but I can't find the KVM for >DOS6.22. Any other solution?
    Thanks a lot.Dengwu

    Check out this link http://gcc.gnu.org/java

  • Is it possible to convert Java to EXE and run this EXE file without any JRE

    hello friends
    I have GCC/GCJ for windows but dont know how to work with it... it creates file with .o extension but i m not able to create .exe from that... i installed mingw for that also .. unsuccessful ...
    tell me the solution for it... i want to generate machine dependent exe from java file...on the web i ve seen that GCC/GCJ is used on linux platform..not cleared properly..
    Again i m writing my question
    Is it possible to convert Java to EXE and run this EXE file without any JRE if yes then how... tell me the procedure to do that...

    Vipul wrote:
    Its software now hardware .... some times u need these things ...anyway do u ve solution for my questionSo what? By creating a native executable you are restricting the program to the OS for which that native executable was made, just like removing the engine from a car restricts driving to downhill only. So like the I said, the principle remains the same, "Why would you want to?"
    I am asking you, truthfully, why do you feel the need to negate the largest advantage of using Java by creating a native executable from it?
    What is your rationale?
    I can pretty much guarantee there is a much better way of achieving your wish without "removing the engine".

  • Unwise.exe Files not run on Windows 8.1 SSSS

    So unwise.exe Files not run on Windows 8.1 I Tried too! much but when i run it , it will not open i also tried To run as Administor but not works i am downloaded GTA San Andreas Admin console for my GTA San Andreas that one was unwise.file its not opening
    what should i do?
    Reply Please!

    So unwise.exe Files not run on Windows 8.1 I Tried too! much but when i run it , it will not open i also tried To run as Administor but not works i am downloaded GTA San Andreas Admin console for my GTA San Andreas that one was unwise.file its not opening
    what should i do?
    Reply Please!

  • Authorware exe file to run in Moodle

    Can an authorware exe file run in Moodle, without the users having to download the AW player?  How is this done?

    No .exe file can run in any web-based product. If you provide an .exe via the web, it must be downloaded to the user's computer and played locally.
    Now, you can publish Authorware for the web, but then users must have the Authorware Web Player installed for it to work.
    So, to answer your question directly; No, and it isn't done. ;-)
    Erik

  • How can I convert an outlook pst file to mac mail without using a windows based computer

    I recently bought the new iMac as my older Windows based computer crashed with a bad motherboard.  I have been trying to find a way to convert Outlook 2007 pst files to Mac Mail without the need to use a Windows based computer since all I have now is a Mac.  I have the copies of the pst files on my Mac, so I am looking for the most efficient way to convert them to the format that I can then open them in the Mac Mail.  Any suggestions would be greatly appreciated.

    Hi - thanks for the instructions but where do you get the option for Quicktime. If I do File - Export I only get the options for File name, place and size but no option that allows to select quicktime:-(
    Have you got any more tips?

  • Help me. I don't know which exe file to run to be able to program

    when I downloaded java 1.3.1_02, i think, there are so many 'exe' files that auto-terminates. I do not know which one to run as to be able to go to the programming thing.

    To go to a command prompt:
    If you are in Windows, open up an MSDOS window
    On Unix/Linux, open up a new window.
    Write your code in a file called xxx.java (replace xxx by the name of your program, for example, calculator.java) and when you are done, just do:
    javac *.java
    to compile your code. This creates .class files for all your classes. If there are no errors, then run
    java xxx
    (assuming xxx is the name of the program, and is the "main")

  • Error:The specified network address is currently in use when exe file is run

    I get this error(above) when i run my executable files.My exe file is in directly in c:\codes\application.exe. After this, i also like to know how do i enter the URL in a web browser to access this exe file. I have created and change the labview.ini file to application.ini and put it in the same directory as my exe file already.
    Kindly provide me with a detailed solution to solve this problem. Thanks

    I am not sure what you are doing but I think this is the information you are looking for:
    Can I Make My LabVIEW 7.0 Executable Use Remote Front Panels?
    There are several other simmlar pages on the web. I went to Advanced Search and looked for executable remote front panel .

  • Ant tools: converter java card -  class file  not belonging to the package!

    Hi
    I have another problem with converter. Could you help me please again if you have the time?
    I have created a directory when I save the class files generated by javac. After That , I use convert in this way:
    <convert
    JCA="true"
    EXP="true"
    CAP="true"
    packagename="testUn/classes/testUn"
    packageaid="0x01:0x01:0x01:0x01:0x01:0x01:0x01:0x01:0x02:0x00"
    majorminorversion="1.0"
    verbose = "true">
    <AppletNameAID
    appletname="testUn.classes.testUn.PorteAppUn"
    aid="0x01:0x01:0x01:0x01:0x01:0x01:0x01:0x01:0x02:0x00:0x00"/>
    <classpath refid="classpath"/>
    </convert>
    Here is the answer of the computer:
    [echo] Generation of the CAP,JCA and EXP files...
    [convert] Java Card Ant Tasks, Version 1.0
    [convert] Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    [convert] Note: Usage of Java Card Ant Tasks is optional. Java Card Ant Tasks are not supported by Sun Microsystems, Inc.
    [convert] Java Card 2.2.2 Class File Converter, Version 1.3
    [convert] Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    [convert] parsing /home/ehoudart/app-manager/VersionZero/src/testUn/classes/testUn/PorteAppUn.class
    [convert] converting testUn.PorteAppUn
    [*convert] error: class PorteAppUn does not belong to package testUn.classes.testUn.*
    [convert] conversion completed with 1 errors and 0 warnings.
    I do not understand why this unique applet class file does not belong to its own package. Is someone an idea?
    Thanks very much in advance for your answer.

    Here is a complete example build.xml (I think I have posted this before).
    <?xml version="1.0" encoding="UTF-8" ?>
    <project default="convert" name="javacard-starter">
      <!-- Build specific properties -->
      <property name="target.classes" location="${basedir}/target/classes" />
      <property name="target.javacard" location="${basedir}/target/javacard" />
      <property name="source.java" location="${basedir}/src/main/java" />
      <!-- Must point to the folder containing the JAR files from the JCDK -->
      <property name="javacard.libs" location="${basedir}/lib" />
      <!-- Must point to the folder containing the JAR file from the JCDK ant task -->
      <property name="javacard.ant-task" location="${basedir}/lib" />
      <!-- Must point to the folder containing the API export files from the JCDK -->
      <property name="javacard.export" location="${basedir}/src/main/export" />
      <property name="verbose" value="true" />
      <property name="noverify" value="false" />
      <!-- Path for JC tasks -->
      <path id="classpath">
        <fileset dir="${javacard.ant-task}">
          <include name="*.jar" />
        </fileset>
        <fileset dir="${javacard.libs}">
          <include name="*.jar" />
        </fileset>
      </path>
      <!-- set the export path to the Java Card export files -->
      <path id="export" description="set the export file path">
        <fileset dir="${javacard.export}">
          <include name="**/*.exp" />
        </fileset>
        <pathelement path="${javacard.export}" />
        <pathelement path="${target.classes}" />
        <pathelement path="${target.javacard}" />
      </path>
      <!-- Definitions for tasks for Java Card tools -->
      <taskdef name="capgen" classname="com.sun.javacard.ant.tasks.CapgenTask" classpathref="classpath" />
      <taskdef name="deploycap" classname="com.sun.javacard.ant.tasks.DeployCapTask" classpathref="classpath" />
      <taskdef name="convert" classname="com.sun.javacard.ant.tasks.ConverterTask" classpathref="classpath" />
      <taskdef name="verifyexport" classname="com.sun.javacard.ant.tasks.VerifyExpTask" classpathref="classpath" />
      <taskdef name="verifycap" classname="com.sun.javacard.ant.tasks.VerifyCapTask" classpathref="classpath" />
      <taskdef name="verifyrevision" classname="com.sun.javacard.ant.tasks.VerifyRevTask" classpathref="classpath" />
      <typedef name="appletnameaid" classname="com.sun.javacard.ant.types.AppletNameAID" classpathref="classpath" />
      <typedef name="jcainputfile" classname="com.sun.javacard.ant.types.JCAInputFile" classpathref="classpath" />
      <target name="init">
        <mkdir dir="${target.classes}" />
        <mkdir dir="${target.javacard}" />
      </target>
      <target name="clean">
        <delete dir="${target.classes}" />
        <delete dir="${target.javacard}" />
        <delete dir="${javacard.eeprom}" />
      </target>
      <target name="compile" depends="init" description="Compile source code to class files">
        <!-- Compile the java code from ${src} to ${classes} -->
        <javac debug="yes" optimize="no" srcdir="${source.java}" destdir="${target.classes}" source="1.5" target="1.5">
          <classpath refid="classpath" />
        </javac>
      </target>
      <target name="convert" depends="compile" description="Convert class files to cap files">
              <convert packagename="chaining" packageaid="0xF0:0x00:0x00:0x01:0x00:0x01" majorminorversion="1.0" classdir="${target.classes}" outputdirectory="${target.classes}" jca="true" exp="true" cap="true" debug="true" verbose="${verbose}" noverify="${noverify}">
                   <appletnameaid aid="0xF0:0x00:0x00:0x01:0x00:0x01:0x00:0x01" appletname="chaining.ChainingApplet" />
                   <exportpath refid="export" />
                   <classpath refid="classpath" />
              </convert>
      </target>
      <target name="copy-debug">
        <mkdir dir="${target.debug}" />
        <echo>Copying cap files</echo>
        <copy flatten="true" todir="${target.debug}" verbose="true">
          <fileset dir="${target.classes}" includes="**/*.cap" />
          <fileset dir="${target.classes}" includes="**/*.exp" />
          <fileset dir="${target.classes}" includes="**/*.jca" />
        </copy>
      </target>
      <target name="all" depends="clean, convert" />
    </project>

  • How do I get the Adobe Presenter trial .exe file to run? I'm getting an error requiring placement into a designated folder,

    Getting an error trying to run the Adobe Presenter trial .exe file because it is requiring that the file be placed in a designated folder with the other downloaded file. How do I solve this problem?

    Thanks, the offset command worked well. I did have to modify the script some more, there was really no reason for the first repeat loop using the offset command. Also, I had set my text item delimiters to tab for another script, and that was causing problems running this script. I think I have everything fixed now. This is the final version.
    set my_folder to choose folder
    tell application "Finder"
    set myfolderstring to name of my_folder as string
    set myfolderlist to every character of myfolderstring
    end tell
    set mycolorlist to {"A_Green", "B_Teal", "C_Purple", "D_Pink", "E_Yellow", "F_Orange", "G_Blue", "H_Black"}
    set my_break to offset of "_" in myfolderstring
    set the_code to items 1 thru (my_break - 1) of myfolderlist
    set the_code to the_code as string
    repeat with i from 1 to number of items in mycolorlist
    set the_color to item i of mycolorlist
    tell application "Finder"
    make new folder at my_folder with properties {name:the_code & "_" & the_color}
    end tell
    end repeat

  • Making java project .exe file

    how can you make your java project an executable file
    I mean how can people execute a java project like they are executing programs that written in c++(.exe files)
    Thanks

    <--- SEARCH FORUMS

  • Two .exe files to run sequentially

    Inside a class, I am running two .exe files. But even before the first .exe gets terminated, the second .exe file is getting executed.
    Could someone please tell me how do I run these two .exe files sequentially.
    At present no error is thrown, but the necessary number of files are not created from both the .exe files.

    If I am right in understanding, is this what you meant for me to do. But still from the below code, before the execution of the first .exe, the second .exe is getting executed.
    Please tell me what updations to do in my code.
    public class Compile
         int flag=0;
         public Compile()
         void compileFile(File newFile, String renameSub, File outputfile, String fontName, String IntallPath) throws IOException
              String FirstParam = "C:\\Temp\\Installation\\test.tex";  
              String FirstParam2 = "C:\\Temp\\Installation";
              String SecondParam = "C:\\Temp\\Installation";  
              try
                   Process proc1 =Runtime.getRuntime().exec("cmd /c start /MIN tex " + FirstParam, (String[])null, new File(SecondParam));
                   InputStream stderr = proc1.getErrorStream();
                   InputStreamReader isr = new InputStreamReader(stderr);
                   BufferedReader br = new BufferedReader(isr);
                   String line = null;
                   proc1.waitFor();
                   if(proc1.exitValue()==0)
                        System.out.println("tex is executed successfully");
                        flag=1;
              catch (Throwable t)
                   t.printStackTrace();
              if(flag==1)
                   ... code for second .exe file ...
    }

  • Attempt to download an EXE file is first cancelled (without my consent), then, after restarting the downloaded file fails to appear on my computer.

    Just installed FF v.5 on Win XP. Now I am unable to download exe files. I have worked through suggestions on a FF-help page entitled "Unable to download or save files".
    I have turned off my firewall with no success. I use ESET NOD32 and SpyBot. I AM able to download image files (and I assume other types as well).
    I can download exe files with Chrome without difficulty.

    Yes it happens in Safe Mode also. And, again, this only starting happening recently and doesn't appear to be correlated with any system change that I am aware of.
    However, I found a solution on a rather old article. It seems that the problem is corrected by setting to "false" the following item in the about:config.
    browser.download.manager.scanWhenDone
    The kb article where I found the answer is at:
    http://kb.mozillazine.org/Browser.download.manager.scanWhenDone
    I still don't know why the "virus scan" and/or application of the "Windows security policy checks" causes this problem. However, I have now observed that the file appears while being downloaded. And, then, immediately after download, the file is removed - no idea what is triggering this deletion.
    Thank you for your help.

  • Help me to convert Java and Jsp Files into WAR File!!!!

    I need someone to help me to convert some java servlet files and jsp files into a WAR file. I need it URGENTLY and I'll be very grateful to anyone who is willing to help me! My email is [email protected] Thanks!!!!

    Are the Oracle JDBC drivers 11g used?
    oracle.jdbc.driver.OracleDriver is not supported in 11g drivers.
    Please replace with:
    oracle.jdbc.OracleDriver

  • Problems converting java to class file

    I copied a chat applet, but whenever i try to convert the chat.java to chat.class i get the following.
    C:\Program Files\Apache Group\Apache\htdocs>c:\jdk12~1.1\bin\javac chat.java
    chat.java:13: Public class Chat must be defined in a file called "Chat.java".
    public class Chat extends Applet implements Runnable {
    ^
    Note: chat.java uses or overrides a deprecated API. Recompile with "-deprecation" for details.
    1 error, 1 warning
    Any assistance will be greatly appreciated.

    Please check for the case in the file name.Check if you have saved the file as Chat.java and not as chat.java

Maybe you are looking for

  • How do you troubleshoot a scheduled snapshot

    Hello, I have a ton of reports that have a snapshot taken on the 2nd day of the month. Has worked fine until this past weekend when the snapshots did not happen. There is nothing I see in SSRS that explains it. The schedule is still there. Is there a

  • Can a loaded SWF call a function that lives in the parent?

    I'm building a pretty simple Flash site in AS3. There is a main movie (main.swf) that simply loads different swfs via buttons on a main nav bar. The user clicks on a MC in "main.swf" and a function is called, loadMyContent("section1.swf"), is called

  • The visual editor not work properly in JDeveloper 10.1.3.2

    Hi When I attempt to drag and drop the components of JSF into the visual editor, these components not appear properly. The visual editor just show the names of these components and put them in tree form. Could you please tell me how can I fix this pr

  • UnsatisfiedLinkError: Attempt to access invalid address

    If I try to run my JavaAppl, I always get the following message. Something seems to be wrong with the operation call uread() of the Library foxapi.lib. If I disable this operation (with //), I get the Defaultvalue=5 back. So the jni seems to work. Bu

  • Regarding Pro-C

    Hi, I have a file called login.pc. I compile it using pro-c compiler and I got a C file. Then I compiled C file and got a executable by the name login.o. When I try to run the file login.o as ./login.o, it tells me that it cannot execute. I checked f