Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: how to run any installed application through my java application??

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to run any installed application through my java application??

    hello programmers,

    can you please let me know how to run any installed application in my computer through my java application?? ( say for example, i need open notepad, recording audio application etc., through my java application )


    please help me by answering or guiding....


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: how to run any installed application through my java application??

    Hello sgsamanthjain. Welcome to the Java Programming Forums.
    In future, please make sure you post in the correct forum. I have moved this thread to - Java Theory & Questions

    You can open Notepad and other applications like this:

    import java.io.IOException;
     
    public class OpenApplication {
     
    	/**
    	 * JavaProgrammingForums.com
    	 */
    	public static void main(String[] args) throws IOException {
     
    		// Opens Notepad
    		Process p1 = Runtime.getRuntime().exec("notepad");
     
    		// Opens Windows Calculator
    		Process p2 = Runtime.getRuntime().exec("C:\\WINDOWS\\system32\\calc.exe");
     
    	}
    }

    Runtime (Java Platform SE 6)

    Execute an external program - Real's Java How-to
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  3. The Following User Says Thank You to JavaPF For This Useful Post:

    Mr.777 (April 4th, 2011)

Similar Threads

  1. Replies: 2
    Last Post: March 23rd, 2011, 08:51 AM
  2. Replies: 1
    Last Post: January 12th, 2011, 05:55 AM
  3. [SOLVED] [help] the application file (.jad) for application does not appear to be the ....
    By ordinarypeople in forum Java ME (Mobile Edition)
    Replies: 0
    Last Post: April 4th, 2010, 03:50 AM
  4. Java Application Help...
    By Brian in forum Java ME (Mobile Edition)
    Replies: 0
    Last Post: March 25th, 2010, 07:38 AM
  5. Replies: 0
    Last Post: December 3rd, 2009, 04:43 PM