Launching applications from java code

Advertisement
November 30

I have found a solution to launch applications from java.I thought this will be useful for programmers who want to open a
1. Browser
2. Player
3. Files etc.
There are 2 solutions :
I)To use a known application :
eg: to open windows media player
String[] cmd = new String[3];
cmd[0] = "cmd.exe";
cmd[1] = "/C";
cmd[2] = "START MPLAYER2.exe "+mediaURL+" /PLAY /CLOSE /FULLSCREEN";
//eg: mediaURL = "\"D:/project/songs/track1.mp3\""
// /PLAY /CLOSE /FULLSCREEN this option can be used only for windows media player
// for any other application use cmd[2] as START apl.exe //apl can be any windows application
Process p = Runtime.getRuntime().exec(cmd);
II) To use a default application:
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
// url can be any url
ref: [http://forums.sun.com/thread.jspa?threadID=5203313|http://forums.sun.com/thread.jspa?threadID=5203313]
[http://www.ericphelps.com/batch/rundll/|http://www.ericphelps.com/batch/rundll/]
Edited by: veda_sishta on ? ?????, ???? ??:?? ???????
Edited by: veda_sishta on ? ?????, ???? ??:?? ???????

Advertisement

Replay

To post code, use the code tags -- [code]Your Code[/code] will display asYour CodeOr use the code button above the editing area and paste your code between the {code}{code} tags it generates.
And make up your mind what file type you're having a problem with. Maybe .asx doesn't have a file association on your computer.
This works just fine for .m3u:import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
public class Playlist {
   public static void main(String[] args) {
      try {
         Desktop.getDesktop().
               open(new File("E:/Music/Playlists/test.m3u"));
      } catch (IOException ex) {
         ex.printStackTrace();
}db
edit Did you try searching the net for the error you got? ("Invalid menu handle")
Edited by: Darryl.Burke

View 7 Replies

Executing jar from java code, then kill parent java code

November 30

Please suggest if there is any best way around on executing jar from java code then killing parent java code. a) I have desktop based java application say "Monitor.java" which runs every 5 minutes. b) How can I START external java application sa

View All Replies

Executing system commands like cd on Linux from Java Code

November 30

Hi, I need to execute a few system commands (like cd, ls, tar, etc.,) on RedHat Linux 7.1 from Java code. Any ideas plz. best wishes, IssacSince this thread mentioned using the DOS START command from an exec(), I was wondering whether anyone else is

View All Replies

Ask from Java code if service runs

November 30

Hi, i have a service,  com.business.company.navigation.connector running as ear on sap portal server. Is there a way to ask from Java code if this service is running or not!? I found following code which shows how access the portal runtime to get def

View All Replies

How i can set dropDown item to 6th item from java code ?

October 11

Hi Thank you for reading my post. how i can set dropDown item to 6th item from java code ? i have the value field of database and i can use it to set selected item of DropDown. so : can i use value field to set the selected item ? Thank u.Hi, Please

View All Replies

How to call a VB application from Java

October 11

Hi, does anybody know how to call a VB application from java. Would appreciate if you can provide me with an example. thankstry exec()ing the cad program with the name of the file as a command line parameter... Runtime.getRuntime().exec("CADProg.exe

View All Replies

Generation of xml file from java code

October 11

hi, I want to manipulate data in a xml file with java code.I have read data from xml file and also changed it. But i am unable to covert it again in xml file from java code. Can you please tell me how i can do this?Let me know which parser are you us

View All Replies

Invoking Microsoft Word from Java code

November 30

I want to invoke Microsoft word from Java code. How can i do this plz ............... Helpdo something along these lines.... here is an example with notepad create a .bat file with the commmand in to run notepad for example notpad c:\test.txtthis com

View All Replies

Ttrigger Event Sub-Process from Java code.

November 30

Hi All, Is there any way to trigger Event Sub-Process from Java code. My requirement is to trigger an Event SubProcess when a Approver clicks on REJECT button in HUMAN TASK. One way of achieving this is by placing a gateway after the human task and b

View All Replies

ADF CoreTree API is missing the ability to expand collapse from Java code?

November 30

ADF-faces-10_1_3_0_4 CoreTree API: How do I expand and collapse a tree from Java code? Thanks, --Todd                                                                                                                                                     

View All Replies

Close a running application from java........

October 11

Hi all I have opened an application say MSWORD from my java class using Runtime.getRuntime(), Now on close button i need to close the application and on the save button of the application i even want to save the application from java command The ques

View All Replies

Launching applications from within a Java program,

November 30

Hi all, I wish to launch an application from a menubutton. I exactly wish to launch adobe acrobat reader and a specific file. Do I need to run a system command to do this, or more specifically, how is this done in Java? Thanks, JavaRobwhat if you hav

View All Replies

'Unable to Launch Application Error' - Java Web Start Running Under MS IIS.

October 11

I am attempting to render the following .jnlp in MS IE: <?xml version="1.0" encoding="utf-8"?> <!-- JNLP File for LottoMadness Application --> <jnlp    codebase="http://localhost/LottoMadness/"    href="Lo

View All Replies

How to run report from java code

November 30

I am a begginner in Oracle Reports. We have no AS installed, so we run reports either from Reports Builder or by calling rwrun. I would like to know how to embed report calling into java code , let's say into simple swing application. Some example co

View All Replies

Launch application from midlet

October 11

Hi, I would like to know if there is anyway to start/launch non java application from MIDlet, something similar to Runtimer.exec. Have tried with platformRequest method. It can only launch the browser and make voice call. Thanks in advance MamathaNo,

View All Replies

How to execute another application from java ?

November 30

I want to execute another application ( not java ) from my java application. Is it possible ? How can we do it ? Please guide me... thanxHi littlestuart, Yes it's possible. Your question is frequently asked, please search the forum or google for an a

View All Replies

Invoking Acrobat PDF compare from Java code

November 30

Need to invoke the Adobe Acrobat XI's PDF compare feature using Java code. Description: ======== We are exploring the possibilities of passing 2 PDF's from Java to Adobe Acrobat XI SDK to get the compared results in new PDF. If anyone has explored wi

View All Replies

Running .jar files from Java code

November 30

Hi. I am designing a sort of platform to run some games which are saved in .jar files. Basically this platform is a menu from which the user can select the game which he/she wants to run. It also has the feature of adding new games. Is is possible to

View All Replies

Update USR table from Java Code outside OIM

November 30

Hi, I want to update a particular field in the USR table using the update query specifically from the java code. I dont want use updateUser api. I have written the code which works fine for some userids. But for some user ids it gets the tcUtility ob

View All Replies

Invoking beautiful widgets from Java Code

November 30

Hi experts, I have the code given below which I obtained from www.gigya.com website. If I add the code given below in an html, I can view the widget inside the html as shown in the attached image in [http://docs.google.com/Doc?id=dfzrknk_31gxvz9nd8|h

View All Replies

Tags:

  1. reset dw fabrica iphone modelo a1418?
  2. ifroget my icloud id n pasword
  3. error: err_wis_30270 how to restore file
  4. 0056 error code sccm
  5. hp g60 diskpart uefi
  6. segment e1idku4
  7. how to include fcaregul in idoc
  8. change a miro document on hold
  9. 4Z1A
  10. tonightyeq
Copyrights 2019 Fcffair BigData Resource, All rights reserved