How do I build and run a java application?

I wrote my java swing application in jbuilder where I run it from a test class.
Now I want to send it out to others, so they can run it from their computers, how do I do that? Is it possible to create an *.exe file with icon for them to click on? How do I do that?
Thanks in advance!

You should try InstallAnywhere 4.5 from ZeroG:
http://www.zerog.com/products_ia_01.html
It creates an exe for your application which can include the JVM necessary to run it.

Similar Messages

  • How can I compile and run other java classes from within an application?

    Hello there everyone! I really hope that someone can help me. I am writing a program that must be able to compile and run other java classes that are in different files, much like development environments like Kawa or Forte allow you to do.
    There has to be a way of doing this ( I hope!! ), but i can't seem to find it!!
    I have tried using this command to compile:
    Runtime.getRuntime().exec ("c:\\programs\\javac className.java");
    ...and this one to run:
    Runtime.getRuntime().exec ("c:\\programs\\java className");
    ...but neither works!!! I can compile and run classes that are in the same file as my application, but I can't get it to work at all for files in different directories or files.
    PLEASE, PLEASE, PLEASE help me - i've run out of ideas, and i need this to be working in 3 days!!!
    Thank you very much for any help anyone can give me, I really appreciate it!! Thanks again!!
    Adrian ( ...in distress!! )

    public class JavaCompiler{
       public static void main(String[] args)throws Exception{ //sorry bout the laziness
          if(args == null || args.length != 1){
             System.out.println("Usage: java JavaCompiler MyClass.java");
             System.exit(0);
          String className = args[0];
          Runtime rt = Runtime.getRuntime();
          Process p = rt.exec("javac " + className); //consider setting cpath for this
          p.waitFor();
          //now try to run after it is done.
          p = rt.exec("java " + className.substring(0, (className.length() - ".java".length()));
          p.waitFor();
          //do some other stuff
    }This should get you going. You may consider looking into the System.getProperty() method in order to determine the type of OS it is running on in order to findo out what command to run. I know that the sun tool listed above is nice, but by my understanding the sun tools provided are not guaranteed to stay the same. I'm no expert on this matter, but that is one of the reasons there is no API documentation for those tools. Also, I don't believe those tools come packaged with the JRE. (Of course if you are making an IDE it will be expected that the user has an sdk installed. Good luck with figuring this thing out.

  • How can I build and run CDC in Red Hat Linux?

    I downloaded the CDC and CVM(j2me_cdc_fp-1_0_2-src.zip), and wanted to build a VM in Red Hat Linux. But I can't find the Makefile in the "build" directory. How can I build it?

    You should be able to run a J2SE VM with the CDC jar as the bootclasspath, I think.

  • How should I compile and run my jdbc application ?

    I need help about how is the correct way for compile and run my application conecta.java using a driver postgresql-8.3-603.jdbc3.jar for connect to my database under Postgresql 8.1.4, . I have compiled as follow :
    javac -cp postgresql-8.3-603.jdbc3.jar conecta.java
    and I have compiled with sucessful obtaining conecta.class
    but when I try using :
    java conecta
    a message display an error :
    java.lang.ClassNotFoundException: org.postgresql.Driver
    I didn find the cause , I try modifing the classpath onto .bash_profile :
    # User specific environment and startup programs
    JDK_HOME=/usr/local/jdk1.5.0_01
    JAVA_HOME=/usr/local/jdk1.5.0_01
    PATH=$JAVA_HOME/bin:/usr/lib/pgsql/bin:$HOME/bin:$PATH:.
    CLASSPATH=$JAVA_HOME/lib/postgresql-8.3-603.jdbc.jar:$CLASSPATH.
    export PATH CLASSPATH JAVA_HOME JDK_HOME
    unset USERNAME
    but the message is the same . I have downloaded the driver into the same directory where is sited concecta.class and conecta.java . I don't understand why netbeans works fine runnning my application. I will be glad if anybody help to me.
    Thanks

    Miguel231152 wrote:
    I need help about how is the correct way for compile and run my application conecta.java using a driver postgresql-8.3-603.jdbc3.jar for connect to my database under Postgresql 8.1.4, . I have compiled as follow :
    javac -cp postgresql-8.3-603.jdbc3.jar conecta.javaActually, you probably don't need the JAR in the CLASSPATH to compile. You shouldn't refer to PostgreSQL classes in your code, just java.sql interfaces.
    and I have compiled with sucessful obtaining conecta.class
    but when I try using :
    java conectaGotta have the JAR in the CLASSPATH at runtime. That's why you get that exception, and that's always what it means.
    a message display an error :
    java.lang.ClassNotFoundException: org.postgresql.Driver
    I didn find the cause , I try modifing the classpath onto .bash_profile :
    # User specific environment and startup programs
    JDK_HOME=/usr/local/jdk1.5.0_01
    JAVA_HOME=/usr/local/jdk1.5.0_01
    PATH=$JAVA_HOME/bin:/usr/lib/pgsql/bin:$HOME/bin:$PATH:.
    CLASSPATH=$JAVA_HOME/lib/postgresql-8.3-603.jdbc.jar:$CLASSPATH.Useless. Java ignores CLASSPATH environment variable.
    export PATH CLASSPATH JAVA_HOME JDK_HOME
    unset USERNAME
    but the message is the same . I have downloaded the driver into the same directory where is sited concecta.class and conecta.java . I don't understand why netbeans works fine runnning my application. I will be glad if anybody help to me.
    ThanksUse the -classpath option at runtime. That'll fix it.
    %

  • How can I install and run the Java Telephony API

    Hello!
    I have downloaded the Java Telephony API but I couldn't find the installation notes for installing it on my PC (Win2000).
    Can anyone help me?

    Since the package is downloaded as just .class files just set your classpath like you normally would if you were creating your own package...I personally would install the class file version...run a sample program and see if this works...

  • How to build and run enterprise client application in SJS

    Hello
    I need to create client application (not web component) for some Entity Beans in SJS, but I don't know how. In projects menu, when I choose Enterprise Application I can add only EJB, when I choose Application - I don't have access to Bean objects. What should I do? Thanks for any help.

    I think you've posted this question to the wrong forum. This is the Sun Studio forum, which deals with C, C++, Fortran, and related tools.
    Better check with http://developers.sun.com/forums/ to find the right forum for your question.

  • How to build and run sample extensions?

    I spend quite a while in trying to get the sample extensions to run, provided at
    Adobe-CEP/CEP-Resources · GitHub  or also in the Adobe Illustrator CC 2014 SDK for the Plugins that have a GUI.
    So far i did not succeed.
    System Windows 7 x64. Illustrator CC
    First try:
    Package one of the samples using the Adobe package manager. Added the whole folder of "CEP_HTML_Test_Extension" or as well the "TutorialUI" from the SDK samples.
    and then install the resulting zxp file it using the "Extension manager". No errors reported. Extension managers lists the Extension as active for AI CC. Started Illustrator.
    But i dont see anything in illustrator. There is no entry "Extensions" in the Windows menu of Illustrator.
    The menus of the Tutorial PlugIn are shown, but the Dialog of the sample does not show up. In the debugger i noticed that the call to pFnLoadExtension fails.
    Second try:
    Following the pdf "USING THE ADOBE EXTENSION SDK" (http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/creativesuite/pdfs/CC14_Extension_S DK.pdf)
    Package done as before
    Activated PlayerDebugMode in HKEY_CURRENT_USER\Software\Adobe\CSXS.5
    copied the zxp file to C:\Program Files\Common Files\Adobe\CEP\extensions
    Same result. I do not see anything of a extension.
    I had no problems building and running the Sample Plugins though.
    What am i doing Wrong?
    How can i build and run a simple sample extension?
    Any help appreciated.

    Help About Illustrator shows:
    Version 2014 1.0
    18.1.0 (64 Bit)
    From Samples-master\UI_Showcase\CSXS\manifest.xml i see:
    <HostList>
    <Host Name="ILST" Version="[17.0,17.9]" />
    <Host Name="PHSP" Version="[14.0,14.9]"/>
    <Host Name="PHXS" Version="[14.0,14.9]"/>
    <Host Name="PPRO" Version="[7.0,7.9]" />
    </HostList>

  • OPM "build and run" error

    Hi
    I have a problem with OPM when I use "build and run".
    I only get a message "The system cannot find the file specified" and nothing more. It has worked, but it used to open Google Chrome browser. Since I did not want this behaviour I uninstalled Google Chrome. But then I got this error instead.
    I can run "build and debug" prefectly fine.
    The problem is not related to a specific project.
    I have also tried to reinstall OPM but the problem remains.
    What file is it the system cannot find? Is there a way of finding this in a log somewhere?
    How does the "build and run" command work? Is there a way of checking why it can not open the browser?
    kind regards,
    Michael

    Hi Andrew
    Just to add some more observations.
    It seems that OPM doesn't look directly to the default browser setting. If I change the default browser, OPM does not directly recognize the new setting. OPM opens the previous selected default browser anyway.
    I dont know if the setting is unique per project or if it is per OPM installation.
    OPM seems to pick up the default browser, but then OPM caches this somewhere. Which caused problem for me when I uninstalled Google Chrome. OPM insisted on trying to start Google Chrome anyway.
    When I now got Firefox working as default browser the problem solved it self. But when I selected IE as default browser, then when I ran OPM it still opened Firefox, and Firefox gave me the warning that it was not default browser.
    So OPM does not always look at the default browser setting.
    kind regards,
    Michael

  • How to compile and run a .java file from another java program

    hello,
    can any one tell me how to compile and run a *.java* file from another java program which is not in same directory?

    Well a smarter way of implementing this is by using a solution provided by Java Itself.
    If you are using J2SE 6.0+ there is an in built solution provided along with JDK itself and inorder to go ahead with solution the below are set of API which you;d be using it for compiling Java Programs (Files)
    http://java.sun.com/javase/6/docs/api/javax/tools/package-summary.html
    How do i do that ??
    Check out the below articles which would help you of how to do that
    http://www.ibm.com/developerworks/java/library/j-jcomp/index.html
    http://www.javabeat.net/javabeat/java6/articles/java_6_0_compiler_api_1.php
    http://books.google.com/books?id=WVbpv8SQpkEC&pg=PA155&lpg=PA155&dq=%22javax+tools%22+compiling+java+file&source=web&ots=XOt0siYe-f&sig=HH27ovuwvJgklIf8omTykUmy-eM
    Now once we are done with compilation.In order to run a Specific class all you ought to do is create an object and its specific methods of a specified class included in the CLASSPATH which you can manage it easily by usage little bit reflections.
    Hope that might help :)
    REGARDS,
    RaHuL

  • How to compile and run a java program?

    I am getting this error message, what to do?
    Exception in thread "main" java.lang.NoClassDefFoundError:
    Thanks for you help.
    Ajay

    Hello,
    I believe that this error is caused because when you
    compile and run a java program, you have to use the
    same name that is next to public class. For example,
    the program name is next to the word public class.
    For example, if a program began like this:
    public class Concat
    then the name of the program in this case is Concat
    and when you compile it you type: javac Concat.java
    when you run it type: java Concat
    depending on the name of your program.and depending on whether the class is in a package. And depending on what directory you are currently in.
    Also depending on if you set your class path you might
    have to type the above like this: jdk1.2.1\bin\javac
    Concat.java to compile, and to run you would have to
    type jdk1.2.1\bin\java Concat where you would replace
    Concat with the name of your program and replace
    jdk1.2.1 with the name of your version of java, that
    is again if you do not have your classpath set. Hope
    this helps.Your examples have nothing to do with whether the CLASSPATH is set--only with whether the PATH is set. And, it may not be jdkXXX\bin. The path to the JDK (in this case, to javac and java executables) could be anything. Classpath should be set on the command line. The OP probably did NOT set a classpath on the command line (preferred), or in the environment variables.
    Also, make sure you did not forget to put:
    public static void main(String[ ] args)
    on the line underneath the line where it says "public
    class Concat" where Concat is the name of your
    program. Again, I hope this helps.Irrelevant (with the info we have from the OP so far). The error says that the JVM can't even find the class--not that the class doesn't have a main. The "main" referred to in the error message is within the JVM itself.
    OP: Did you fix your problem? If not, what directory are your files in? Are they in a package? What command are you typing to get that error? That is, please tell us your entire command line.

  • How to change the application status back to build and run

    hi ,
    i changed my applications status to run only .. and now system is not allowing me to change the status of my application back to "build and run"
    any help is appriciated..
    Thanks

    I found the solution for my problem as go on below track and change the setting.
    Home-->Application Builder-->Cross Application Reports-->Build Status and Application Status

  • Build and run Sun's PetStore1.3.1_02 application with BEA WebLogic Server 8.1.

    build and run Sun's PetStore
    1.3.1_02 application with BEA WebLogic Server 8.1.
    5) In the same Command Prompt, compile PetStore using the commands:
    cd c:\bea\user_projects\domains\petstore
    setPetStoreEnv.cmd
    cd c:\petstore1.3.1_02\src
    ant
    buildfile:build.xml does not exist!
    build failed
    could you tell me how ?
    thank you

    What we, BEA, provides is a patch to allow you to compile Pet Store for
    WebLogic Server. It does not contain the source code.
    Sun's Pet Store source code can be found at
    http://developer.java.sun.com/developer/releases/petstore/petstore1_3_1_02.h
    tml. See the requirements section of README.TXT
    You need both in order to make it work.
    "Ankur" <[email protected]> wrote in message
    news:3fa9f2d9$[email protected]..
    Hi Nick,
    I tried building the petstore1.3.1_02 application following theinstructions in the readme. But I got an error as the buil.xml file is
    missing in the directory.....\petstore1.3.1_02\src.
    >
    I tried unzipping the downloaded again and for a petstore.domain.jar alongwith the readme. This jar does not contain the build.xml file.
    >
    Then I tried compiling one by one the component folder and found that the../xmldocuments/src folder has only a build.xml file but no source file...
    >
    Kinldy suggest what to do? Can you send me the zip via email?
    P.S: I have checked the zip and the files are missing.

  • How can I run a java-application on starting of Windows 2000

    How can I run a java-application without any user on starting of Windows 2000?
    For example, if the computer is restarted and nobody enter into it yet, my java-application should run anyway.
    How can I do that?

    Hi, you have to put it in a Windows service.
    To do this you have a program, Srvany.exe that allow to insert a .exe or .bat program in a Windows service.
    For example, i develop a program, TomcatGuardian and i put it in a service because i need to run it in a server without Administrator logged in.
    Regards,
    Ivan.

  • HOw to create a Batch file for java application and whats the use of this ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    First of all, you're OT.
    Second, you can find this everywhere in the net.
    If you got a manifest declaring main class (an classpath if needed), just create a file named whatever.bat, within same directory of jar file, containing:
    javaw -jar ./WhateverTheNameOfYourJarIs.jar %*By the way, assuming a Windows OS, you can just double click the jar file (no batch is needed).
    Otherwise use:
    javaw -cp listOfJarsAndDirectoriesSeparedBySemiColon country/company/application/package/className %*Where 'country/company/application/package/' just stands for a package path using '/' as separator instead of '.'
    Don't specify the .class extension.
    Javaw only works on Windows (you asked for batch, I assumed .BAT, no .sh), in Linux please use java.exe (path may be needed, Windows doesn't need it 'cause java's executables are copied to system32 folder in order to be always available, see PATH environment variable if you don't know what I'm talking about) and use ':' as classpath (cp) separator.
    The '%***' tail is there in order to pass all parameters, it only works on Windows, refer to your shell docs for other OSs (something like $* may work).
    This way you have a command you can call to launch your code (instead of opening NetBeans just to see your app working). You could schedule tasks on it or just call it in any command prompt (hope you know what it is 'cause there have been people in this very same forum with no clue about it, if not just hold the 'Windows button' and press 'R', then type 'cmd' and run it).
    Finally add dukes and give 'hem away.
    Bye.

  • Unable to build and run Javapetstore using  Sun SDK

    Hi,
    There is a problem I�ve come across building and running JavaPetstore from Command Line using Ant.
    It shows that Build is successful but there is an error message in very beginning:
    �Unable to locate tools. jar. Expected to find it in C:\Program Files\Java\jre 1.5.0_11\lib\tools.jar�
    But there is no such a file in jre-1.5.0_11 or previous versions.
    The only place where the file with such name can be found is jdk\lib.All attempts to run end up with:
    � BUILD FAILED.
    C:\<PETSTORE_HOME>\bp-project\command-line-ant-task.xml:77;unable to find javac compiler;com.sun.tools.javac.Main is not on the class path.
    Perhaps JAVA_HOME does not point to JDK.
    Directories C:\Sun\SDK\bin and C:\Sun\SDK\jdk are in the PATH.
    JAVA_HOME as a System variable is set up to C:\Sun\SDK\jdk.
    Building and running other applications like a BluePrints or Samples brings to same result.
    What can I do? I will post more information if needed.
    Thank you in advance for help.

    Multiply duplicated

Maybe you are looking for

  • Creating a report in EP portal using Web Dynpro

    Hi all,         Can anyone guide me how to create a Report in EP portal using Web Dynpro. Regards, R.V.Easter

  • [JS CS3] Variable Function Name

    Hello everyone, Does anyone know if you can put a variable into a function name? Bellow is a function that I am working on to avoid using an if statement with 33 possiblilites. It does work but I get a "undefined is not an object error". function myF

  • Please Help:  Solaris 8 Installation Failure

    Hi Everyone. I have a brand new Dell PowerEdge 500SC, Ram= 1G, and there is no operating system on it. I tried to install from both the Installation CD or the Software CD 1, 2, but I get the same warnings and the installation fails and the system reb

  • Any issues with file sharing between Windows and latest Mac client?

    We're running Lync 2013. My Windows client is 15.0.4551.1005. Mac client is version 14.0.8. I open a conversation with a coworker on his Mac. I then try to share a png file. He clicks accept but then my client says the attempt timed out, and his clie

  • What is taking my new subscription so long to process?

    I paid my subscription today with new credit card and right as the other was ending.  I have received my receipt and money has come out of my account. It's saying that my order is pending.  How long does this usually last? I'm completely shut down--c