I want to be able to execute a swing program from my  desktop

i want to be able to execute a swing program from my desktop but i dont know how to go about it. Till now to run the programs i used command prompt. please can you guys help me cross this huddle. I need step by step solution to do this

In Windows, you associate a .jar file with javaw. YOu can do this with a right-click on the system icon, if I recall correctly.
Another option is to wrap the jar file in an executable wrapper so it looks like an .exe. I have used JSmooth to good effect for this.
Good luck. It is only modestly tricky

Similar Messages

  • Not able to execute one Java program from another one via. exec()

    Hi,
    I am new to this forum, so I might be asking a very trivial quetion.
    My program Ap1 is :
    class Ap1
    public static void main(String a[]) throws Exception
    Runtime rt=Runtime.getRuntime();
    Process p=null;
    p=rt.exec("javac,Pr.java");
    Runtime.getRuntime().exec("javac,Pr.java");
    When I run the above program, I get below error at the line 7(bold one):
    D:\batchwe>javac Ap1.java
    D:\batchwe>java Ap1
    Exception in thread "main" java.io.IOException: CreateProcess: javac,Pr.java err
    or=2
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
    at java.lang.ProcessImpl.start(ProcessImpl.java:30)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
    at java.lang.Runtime.exec(Runtime.java:591)
    at java.lang.Runtime.exec(Runtime.java:429)
    at java.lang.Runtime.exec(Runtime.java:326)
    at Ap1.main(Ap1.java:7)
    Path is set as below(which seems correct):
    D:\batchwe>path
    PATH=C:\Program Files\Java\jdk1.5.0_05\bin
    I am just wondering how to call one Java program from another one?!
    Please help.
    thanks
    Rashmi

    Hi diptaPB,
    Thanks for your suggestion.
    Here is how I tried it again, but not getting the desired output:
    Class Pr looks like below -->
    class Pr
    public static void main(String a[])
    System.out.println("hi from process");
    When I run 'Pr' from command prompt, i get the desired output:
    D:\batchwe>java Pr
    hi from process
    However, when I call 'Pr' from another program Ap2.java, it seems that it does not call 'Pr':
    class Ap2
    public static void main(String a[]) throws Exception
    Runtime rt=Runtime.getRuntime();
    Process p=null;
    String[] cmd=new String[2];
    cmd[0]="javac";
    cmd[1]="Pr.java";
    p=rt.exec("cmd");
    D:\batchwe>javac Ap2.java
    D:\batchwe>java Ap2
    ************* no output appears here***********************
    Looking forward for your help.
    regards
    Rashmi

  • HT204380 I am new to Facetime.  I want to be able to talk to my iMac from my Macbook.  When I try to connect via email I get a message that says the person being called "is not available for Face Time".

    I am new to Facetime.  I want to be able to talk to my iMac from my Macbook.  When I try to connect via email I get a message that says the person being called "is not available for Face Time".

    Hi PhiDor,
    Thanks for visiting Apple Support Communities.
    See this article for some information that can help:
    FaceTime for Mac: Troubleshooting FaceTime
    http://support.apple.com/kb/ts4185
    Regards,
    Jeremy

  • I want to be able to open up a file (from an app or mobile website) to show a customer, then be able to send it to them.

    I want to be able to open up a file (from an app or mobile website) to show a customer, then be able to send it to them. So add a 'Email this file to Client' link that opens up an email with file attached. Is this possible in any of the Adobe Creative Cloud Applications?

    Thank you for the feature request.
    Besides attaching the file to an email yourself, you can use file syncing and the Send Link feature to email a link to your customer.
    File syncing is built into the Creative Cloud desktop application that you use to download and install Adobe desktop applications. Files saved to the Creative Cloud Files folder on your computer are synced up to a cloud file storage. From the Files page in a browser at https://creative.adobe.com/files you can used the Send Link feature.
    The email will be sent and received more quickly since no file is attached, and your customer can download the file from the url you share.

  • How to execute a Perl program from within a Java prog

    How do I execute a Perl program from within a Java program.
    Lets say the Perl program that I want to execute is 'abc'. Now, 'abc' requires some input that I want to give it from within the Java program. How do I do it?
    And finally, how do I execute that Perl program from within the Java program.
    If I execute the Perl program alone then I do it in the following way -
    perl abc inp1 inp2 inp3
    where inp1, inp2, inp3 are inputs to the Perl program. I will not be able to change or modify the coding of the Perl program - 'abc' as I do not have access to its code. Its a kind of an application whose usual method of execution is in the above shown way. So, how do I execute 'abc' from within a Java program.

    what part of don't crosspost, don't you understand?
    http://forum.java.sun.com/thread.jsp?forum=4&thread=427193

  • JCO.Server Error while trying to execute a RFC program from SAP

    Hi,
    We are connecting to an external registered server program from SAP via Web Methods.
    The external server program is registered with the SAP Gateway. We have created a TCP/IP RFC destination and are able to connect to the destination successfully via SM59.
    An RFC function is created in SAP and is called using the syntax CALL FUNCTION "/NGN/BAPI_STRE_SEARCH_PROCESS" DESTINATION 'PRDB2B'. We have also handled the COMM_FALIURE and SYSTEM_FALIURE exceptions in the function call.
    We are monitoring the gateway via SMGW and see a connection log to the RFC destination as below
    Number - 10
    LUname - dev01
    TPName - sapgw00
    User - KRAORANE
    Status - CONNECTED
    Symbolic - PRDB2B
    Conversation - 86520353
    Prot - REG
    SAP return code - 0
    CPIC rtn code - 0
    The external program returns results as expected.
    However sometimes the RFC fails and returns the message “JCO.Server could not create server function /NGN/BAPI_STRE_SEARCH_PROCESS”.
    We are not able to figure what exactly is causing this error. Any help will be highly appreciated.
    -Kiran

    Hi,
    Please see the below links..
    JCO.Server Error while trying to execute a RFC program from SAP
    Re: JCO.Servcer could not find server function
    Re: JCO.Server could not find server function 'SET_SLD_DATA'
    /people/kathirvel.balakrishnan2/blog/2005/07/26/remote-enable-your-rfchosttoip-to-return-host-ip-to-jco
    Re: interfacing SAP with an existing java applications
    http://help.sap.com/saphelp_nw04/helpdata/en/47/80f671ee6e4b41b63c0fe46bd6e4f8/content.htm
    http://www.sapgenie.com/faq/jco.htm
    Regards
    Chilla..

  • Executing a Perl program from within a Java prog

    How do I execute a Perl program from within a Java program.
    Lets say that the Perl program that I want to execute is 'abc'.'abc' requires some input that I want to give from within the java program. How do I do that? Then I want to execute the Perl program from within the Java prog. How do I do it?

    don't crosspost.
    http://forum.java.sun.com/thread.jsp?forum=31&thread=427211&tstart=0&trange=100

  • I have always been able to sync my IE bookmarks from my desktop to Safari on my iPhone.  Suddenly they are gone from my phone and they won't sync any longer.  What am I doing wrong?

    I have always been able to sync my IE bookmarks from my desktop to Safari on my iPhone.  Suddenly they are gone from my phone and they won't sync any longer.  What am I doing wrong?

    I have done this on numerous occasions but I think that my Iphone has a defect. After many tries, reinstalls, deletion of content, changing content to be stored on external hard drive, deleting itunes and cleaning computer I managed to get all of the songs on and things seemed okay for a while.
    The problem returned about a week ago after downloading a new album from Itunes. I now have 12.5k of songs leaving 10gb spare on Iphone which should be more than enough room to operate properly. Last night it seemed to be dowloading ok (after doing all of the above again for the umpteenth time) this morning it revealed that it had just synched 2.5k of songs and 18gb of "other" on the contents bar. it wont synch now as it says its over capacity. So the 18gb of "other" would probably be corrupted data that means it must corrupt each song as it tries to synch it.
    The 2.5k of songs it did synch are working on the Iphone as is every song in the library on Itunes. I did completely delete the new album I bought and redownloaded it from the store then tried to synch just that album and it worked fine.
    Just about time to dump apple I think!

  • How to execute a Java program from ODI

    Hi All,
    I am new to ODI. I would like to know whether its possible to execute a java program from ODI.
    Reason for this is, I would like to write information in error tables into a file. And after that another program will mail that error log to concerned person.
    Could anyone please help me with this?
    Thank you in advance
    Regards,
    Srini

    if you have the java code then u can create a procedure with Java BeanShell as the Technology and write your java code in the procedure

  • How can I execute an external program from within a button's event handler?

    I am using Tomcat ApacheTomcat 6.0.16 with Netbeans 6.1 (with the latest JDK/J2EE)
    I need to execute external programs from an event handler for a button on a JSF page (the program is compiled, and extremely fast compared both to plain java and especially stored procedures written in SQL).
    I tried what I'd do in a standalone program (as shown in the appended code), but it didn't work. Instead I received text saying the program couldn't be found. This error message comes even if I try the Windows command "dir". I thought with 'dir' I'd at least get the contents of the current working directory. :-(
    I can probably get by with cgi on Apache's httpd server (or, I understand tomcat supports cgi, but I have yet to get that to work either), but whatever I do I need to be able to do it from within the button's event handler. And if I resort to cgi, I must be able to maintain session jumping from one server to the other and back.
    So, then, how can I do this?
    Thanks
    Ted
    NB: The programs that I need to run do NOT take input from the user. Rather, my code in the web application processes user selections from selection controls, and a couple field controls, sanitizes the inoputs and places clean, safe data in a MySQL database, and then the external program I need to run gets safe data from the database, does some heavy duty number crunching, and puts the output data into the database. They are well insulated from mischeif.
    NB: In the following array_function_test.pl was placed in the same folder as the web application's jsp pages, (and I'd tried WEB-INF - with the same result), and I DID see the file in the application's war file.
            try {
                java.lang.ProcessBuilder pn = new java.lang.ProcessBuilder("array_function_test.pl");
                //pn.directory(new java.io.File("K:\\work"));
                java.lang.Process pr = pn.start();
                java.io.BufferedInputStream bis = (java.io.BufferedInputStream)pr.getInputStream();
                String tmp = new String("");
                byte b[] = new byte[1000];
                int i = 0;
                while (i != -1) {
                    bis.read(b);
                    tmp += new String(b);
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + tmp);
            } catch (java.io.IOException ex) {
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + ex.getMessage());
            }

    Hi Fonsi!
    One way to execute an external program is to use the System Exec.vi. You find it in the functions pallet under Communication.
    /Thomas

  • Why I am not able to copy and paste photos from my desktop to my Itouch?

    I am not able to copy and paste photos from my computer to my Itouch. I use to be able to do it. Now there is an error message that says my device is wither disconnected or stopped responding.
    But when I plugged in the Itouch, it still shows on my computer, still able to see my existing pictures in it. Just not able to paste/drag any new pictures into the folder.
    Anyone has this problem and able to solve it?
    Thank you.

    Hi BobRz
    Thanks for you suggestion but it didn't work - are there other ways for solving this problem? Or is it because my files that I want to copy and paste onto my hard disk etc are too big? (However there is space on my hard disk and it works on a PC)

  • How Can I execute an external program from my vi?

    Hi guys,
    I want to execute a external program to use it when i called with a bottom. I want push a bottom and execute the program, like acess direct icon or so.
    Any help?.

    Hi Fonsi!
    One way to execute an external program is to use the System Exec.vi. You find it in the functions pallet under Communication.
    /Thomas

  • Execute a java program from an another program

    Like we can compile a code from wihin a java file by using the following :
    Tool javac = ToolProvider.getSystemJavaCompiler();
    Similarly,can we execute i.e. run a java program from within a java file i.e. running d java command from within the java file ??If yes then please tell me how??

    suppose on the Unix box or from a Unix script ( korn, perl, bourne, bash) you can run the following java program
    java ${JAVA_OPTS} -jar ${GMR_APPS_DIR}/risk.jar -I -c ${COB} -r ${BATCH} -o ${XML_DIR}
    in java you can do the following :
    Runtime rt = Runtime.getRuntime();
              try {
                   Process process = rt.exec("java ${JAVA_OPTS} -jar ${GMR_APPS_DIR}/risk.jar -I -c ${COB} -r ${BATCH} -o ${XML_DIR}
    // OR
                   Process process = rt.exec("/export/apps/Tools/apache-tomcat-5.5.17/bin/startup.sh");
                   // process.destroy(); if you want to kill the process
                   process.waitFor();
                   int RC = process.exitValue();      
                   System.out.println(returnOutput(process.getErrorStream()));
                   System.out.println(returnOutput(process.getInputStream()));
              } catch (Exception ex) {
                   ex.printStackTrace();
    empty the output stream from the script
    private String returnOutput(InputStream is) throws Exception {
                   String s;
                   StringBuffer strBuff = new StringBuffer();
                   BufferedReader br = new BufferedReader(new InputStreamReader(is));
                   while ((s = br.readLine()) != null) {
                        strBuff.append(s);
                   return strBuff.toString();
              }You need to relace the ${} by the appropriate values.
    Regards,
    Alan Mehio
    London, UK
    Edited by: alan_mehio on Jan 16, 2008 4:21 PM

  • Can't execute a DOS program from a Java one

    Hi everyone !
    I'm a student, working as an apprentice in a company, and I have to make a program to execute faster some daily routine.
    Here's my problem : I'm trying to execute a DOS program (mkisofs.exe) whick takes numerous arguments and enables me to create an ISO file.
    But, for now, I can't manage to make it work. I've used both Process and ProcessBuilder, but in vain (I'm a student, and not really a JavaProgrammingStar).
    If I would manually execute the command, I'll have to type under DOS the following command :
    "C:\Documents and Settings\myName\Desktop\Current\Local\mkisofs.exe"   -r -J -l -L -b "isolinux/isolinux.bin" -c "isolinux/isolinux.cat" -no-emul-boot -boot-load-size 4 -boot-info -table -graft-points -o D:\ISO\toto.iso "C:\Documents and Settings\myName\Desktop\Current\Local\Clonezilla"or (without spaces)
    C:\docume~1\myName\Desktop\Current\Local\mkisofs.exe   -r -J -l -L -b "isolinux/isolinux.bin" -c "isolinux/isolinux.cat" -no-emul-boot -boot-load-size 4 -boot-info -table -graft-points -o D:\ISO\toto.iso C:\docume~1\myName\Desktop\Current\Local\ClonezillaTill now, I've only managed to execute windowed program such as MsPaint.exe or DOS program from System32 directory such as taskkill.exe, but I couldn't execute, for example, tasklist.exe, or at least, I couldn't see the result of this command.
    Can anyone help me ?
    If some code is needed, jsut tell me.
    Thanks by advance !
    Hubert

    Ok guys, I'm French, so excuse me if I didn't use the correct terminology, but I'm quite sure you understood that I was talking about MS-DOS command prompt in Windows XP.
    Then, of course I've STFW, but none on my tries was successful. So a little help would be appreciated.
    I've first tried this :
    ProcessBuilder pb = new ProcessBuilder("cmd.exe", "/K", "mspaint.exe");
                      pb.redirectErrorStream(true);
                      try {
                          Process p = pb.start();
                          BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
                          try {
                              String rep = in.readLine();
                              System.out.println(rep);
                          } finally {
                              in.close();
                      } catch (IOException e) {
                          e.printStackTrace();//repTF.setText("erreur");
                      }It worked.
    But this :
    String CMD = "C:\\docume~1\\myName\\Bureau\\Current\\Local\\mkisofs.exe";
    String arg1 = "-r -J -l -L -b \"isolinux/isolinux.bin\" -c \"isolinux/isolinux.cat\" -no-emul-boot -boot-load-size 4";
    String arg2 = "-boot-info -table -graft-points -o D:\\ISO\\toto.iso C:\\docume~1\\myName\\Bureau\\Current\\Local\\Clonezilla";
    ProcessBuilder pb = new ProcessBuilder(CMD, arg1, arg2);
                      pb.redirectErrorStream(true);
                      try {
                          Process p = pb.start();
                          BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
                          try {
                              String rep = in.readLine();
                              System.out.println(rep);
                          } finally {
                              in.close();
                      } catch (IOException e) {
                          e.printStackTrace();//repTF.setText("erreur");
                      }does'nt.
    What's wrong ? I should use a String table for args ?

  • Executing a Java Program from within a Java Program

    I need to execute the following Java Program from withing another Java Program. The office toolbar command line is
    D:\WINDOWS\system32\java.exe -cp E:\Development\Eclipse\UpdateServer\Classes -server -showversion UpdateServer
    I can find no combination of ProcessBuilder commands, including those that include "Cmd.exe /c" that will make this program run from within another Java Program. All the examples I can find only show how to run Windows *.exe programs. I keep getting error 123 from ProcessBuilder.start(), but I can find no documentation for error 123.

    Assuming your code didn't get mangled by the forum
    (it's missing one "), it may be that your "-cp
    E:\\Develop.." argument is getting quoted as it has a
    space in it; try passing "-cp" and "E:\\Develop..."
    as two arguments.That worked; specifically the following tested OK:
    ProcessBuilder pb = new ProcessBuilder("D:\\WINDOWS\\System32\\Java.exe", "-cp", "E:\\Development\\Eclipse\\UpdateServer\\Classes\\", "-server", "-showversion", "UpdateServer" );
    pb.directory(new File("E:\\Development\\Eclipse\\UpdateServer\\Classes\\"));
    try{
         Process p = pb.start();
         InputStream is = p.getErrorStream();
         InputStreamReader isr = new InputStreamReader(is);
         BufferedReader br = new BufferedReader(isr);
         String line;
         while ((line = br.readLine()) != null)
              System.out.println(line);
         p.waitFor();
    }catch(IOException ioe){
    I was sure I tried that exact same code before, and it did not work, but now it does, at least at the top level (when it is in main of a test program). I will have to wait to try it until later when it is buried deep in a subroutine.

Maybe you are looking for

  • Dropbox attachment sync with yahoo mail works in Chrome but not firefox.

    In the beginning on April 2013, Yahoo mail added the feature of attaching a files straight from dropbox. This feature works fine when I select it in Google Chrome. When I select the option in Firefox it opens up the little window and has the loading

  • Exchange rate type in BW

    Hi, I have an issue on Exchange rate type in BW. A new exchange rate type was created in R3, now I want to use the same in BW. For this, I have done the Global settings in BW on R3 source system and updated the exchange rate. After this, I could able

  • Quarterly return of tds

    Hi,        while i am executing the quarterly return for tds through the t.code J1INQEFILE system gives a message of enter a valid withholding tax section still after giving the tds section. so can anybody suggest me for the solution also prior to J1

  • Unknown administrator password ?!

    Hi I have just install Mac OS 10.7.3 and I did not set up administrator password. I am trying to download and install some programs but when I am trying to installing programs the system asking to entire  administrator password to allow this for exam

  • Mac OS X : ORA-09925: Unable to create audit trail file

    I have followed the instuctions on Oracle's site: http://www.oracle.com/technology/tech/macos/index.html specifically the Blog pages by Sergio and Anthony and have encountered a couple problems: 1) I got this error when running the db config assitant