How can i execute a .jar or .jad through  java?

I want to execute a .jar like i do in SE using the class RunTime in ME does anybody know how can i do it? There is no method exec in MIDP Runtime API

I have a MIDlet that receives a jar file from another PDA using DatragramConection and FileConnection. It's working well. When i'm running my application i'll send the jar file to another aplication and this application should receive, execute and return the result. For example, if i have a simple program that prints Hello World. I'll send the program the other PDA will execute and then return a String. I have to call the jr file through java because my MIDlet wil be already running.
Could you understand my problem?

Similar Messages

  • How can i execute excelsheet without giving path in java

    Hi,
    How can i execute excelsheet without giving path in java, through this code, you can open the notepad but
    I want whereever the excel is installed in your machine , fine and open excelsheet without given absolute path.
    class ExecuteCommand{
    public static void main(String d[]){
         Runtime r = Runtime.getRuntime();
         Process p= null;
         try{
         p = r.exec("notepad");
              catch(Exception e){
                   System.out.println("error");
    If you know please send me your idea and code samples.
    regards
    Mohan kumar

    just execute the exelfile with the Windows "start" command:
    Runtime.exec("cmd /c start "+excelFileName);But this requires that Excel is the default application for the Excel file type (*.xls). You can test this by simply typing "start myTestExcel.xls" in a dos box.

  • How can I execute a batch file from my java program

    Hi,
    Can someone help me or direct me to a link,
    How can I execute a DOS batch file from my java program?
    Thanks

    You will need to grab a handle to the process's
    outputstream so u can see its output.The OP didn't mention any output from any batch file;
    nor any input for that
    matter,so lets not complicate matters here for now
    ok?Actually I think this is essential to see whether it works or not. It's either that or do some manual check to see whether it ran, which is not exactly elegant, and in some cases this may not be easier than simply writing the output stream code, or in fact it may be impossible to check manually.
    I'm sure it wasn't intentional that your post appeared to be bristling with attitude.

  • How can i rename a jar file using only java code

    i have tried everything i can think of to accomplish this but nothing works.

    ghostbust555 wrote:
    In case you geniuses haven't realized I said I tried everything I can think of not that I tried everything. So help or shut up I realize that I didn't try everything but if you can't figure it out either DO NOT POST.
    And the question is how can i rename a jar file using java code? As it says in the title. Read.I would tell you to use the File.renameTo method, but surely that would have been obvious, and you would have tried it already? But maybe you didn't. You were kind of lacking in details in what you tried.
    And yes, I am a genius. Just don't confuse "genius" with "mind-reader".

  • How can I execute command passwd in solaris with Java (ProcessBuilder)

    Hi all, my problem is that I want to change the user password in solaris 10, but from a Java programm, I was trying with ProcessBuilder but I don't know how insert the new password, Who can help me?

    I'm not sure, but I think passwd is one of those programs that only lets itself be run interactively from a terminal.

  • How do you execute a JAR file?

    I'm sorry this is so basic, but I honestly do not know how to do this nor can I find anything online here or anywhere via Google to help me with this one.
    I have a JAR file that I created on another machine using JDK 1.6.0 and NetBeans 5.5 on WinXP.
    I copied and pasted that JAR file over to my machine at home also using JDK 1.6.0 and NetBeans 5.5 on WinXP
    I put the exact directory name where the JAR file resides, "C:\Program Files\Java\jdk1.6.0\classes", in CLASSPATH and rebooted my machine.
    However, upon CD'ing to that directory and doing "java -classpath . GUI.jar", I get a "NoClassDefFoundError" when trying to do so.
    Furthermore, I was not sure how to use NetBeans to run the JAR file to execute the classes within.
    What did I do wrong? I'm so sorry this is so basic.
    Thanx
    Phil

    You are using netbeans to build your jar. Go to your project properties (right click on the project name and choose properties). Then select "Run" from the tree. You will find a text box "Main Class" there, put the name of the class in there that has your main() method, including full package if you have one. That is WITHOUT the .class extension.
    Build your jar, it will be placed in the dist directory of your netbeans project. You can now run it from netbeans itself if you want. If ever you want to run the jar from the command line on your home machine, just navigate to the directory with the jar file and execute this:
    java -jar yourjar.jarand you're off. If your runtime environment is propertly setup you can even execute the jar by simply double clicking on it from the windows explorer. No need to change the CLASSPATH variable at all, in fact it is ignored when executing a jarred application.
    Also a note: you do not need to reboot your machine when you change an environment property. Simply change them using my computer -> properties -> advanced tab -> environmental variables. If you have any command prompts open, close and reopen them so the properties are updated properly.

  • How can I create a jar file

    Hello!
    How can a create a jar file?
    I want to run an application just clicking in a icon.
    How can I do this?
    Thanks a lot.
    K�tia.

    Get to the command prompt
    change directories to the directory where the main class resides.
    Open your text editor and type the following in it:
    Manifest-Version: 1.0
    Main-Class: NameOfMainClass //Just name without ".class"!!!
    Created-By: Your Name Here
    Save this file as whatever you want to name it with ".mf" as the extension.
    Then go back into the command prompt and type the following:
    jar cfm "NameOfJarFile".jar "NameOfManifestFile".mf *.class
    (without the quote marks of course)
    Hit "Enter"
    This will jar it up and make it executable.
    If you have any images associated with the program you can add them in the same way as above. Just add *.gif or *.jpg after the *.class portion.
    Good luck!
    LEEMAX I. T.

  • How can i run a jar file as EXE on mouse click..

    *{color:#0000ff}how can i run a jar file as EXE on mouse click..is it possible in any way?????????{color}*

    amrit_j2ee wrote:
    *{color:#0000ff}how can i run a jar file as EXE on mouse click..is it possible in any way?????????{color}*Do you mean converting it from a jar file to an EXE file or do you mean that you would like to run the application by just double clicking it?
    If it's the latter then you need to make the jar file including a manifest.
    The manifest can be just a txt file with its content to be something like this:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    Created-By: Somebody
    Main-Class: NameOfTheMainClass
    Class-Path:
    X-COMMENT: Main-Class will be added automatically by buildTo make the jar file including the manifest, use something like this in your command prompt (of course you must have compiled your java file(s) first):
    jar cfm test.jar MANIFEST.txt NameOfTheMainClass.classAfter that you'd be able to run your application just by double clicking it.
    If you're a NetBeans user, you can build your standalone application by right-clicking your project and then going to properties => run => and choosing a Main class. After that right click on that project and "Clean and Build", locate the jar file in the "dist" folder and double click it =]
    Hope it helps,
    LD

  • How can I execute a Procedure with OUT variable is %ROWTYPE on SQL Prompt

    Hi,
    I have a procedure with OUT variable is %ROWTYPE
    How can I execute the following procedure on SQL prompt.
    (without creating anonymous block)
    CREATE OR REPLACE PROCEDURE zz_sp_EMP(VEMPNO IN EMP.EMPNO%TYPE,
    V_REC IN OUT EMP%ROWTYPE)
    AS
    BEGIN
    SELECT * INTO V_REC FROM EMP WHERE EMPNO = VEMPNO;
    END;
    Thanks & Regards,
    Naresh

    as previous posters said: it's not possible to do this without declaring a variable in the anonymous block.
    With anonymous block it would look like this (had to change it a bit, since i'm using hr-schema on oracle XE):
    declare
    l_rec EMPLOYEES%ROWTYPE;
    begin
    zz_sp_EMP(VEMPNO => 100, V_REC => l_rec);
    DBMS_OUTPUT.PUT_LINE ( 'first_name = ' || l_rec.first_name );
    DBMS_OUTPUT.PUT_LINE ( 'last_name = ' || l_rec.last_name );
    end;
    first_name = Steven
    last_name = King

  • How can i execute vb scripts in java program

    hi
    how can i execute any batch files or any other exe files (vb scripts) from java programs
    thanks

    Hi,
    You use Runtime.exec to execute commands / exe-files. See the documentation (and remember that it will only work on windows):
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html
    /Kaj

  • How can I execute Stored Procedures in PARALLEL and DYNAMICALLY ?

    Hi 
    I have a stored procedure. It can be executed like this
    exec test @p = 1;
    exec test @p = 2
    exec test @p = n;
    n can be hundred.
    I want the sp being executed in parallel, not sequence. It means the 3 examples above can be run at the same time.
    If I know the number in advance, say 3, I can create 3 different Execution SQL Tasks. They can be run in parallel.
    However, the n is not static. It is coming from a table. 
    How can I execute Stored Procedures in PARALLEL and DYNAMICALLY ?
    I think about using script task. In the script, I get the value of n, and the list of p, from the table, then running a loop with. In the loop, I create a threat and in the threat, I execute the sp like : exec test @p = p. So the exec test may
    be run parallel. But I am not sure if it works.
    Any idea is really appreciated.

    Hi nam_man,
    According to your description, you want to call stored procedures in parallel, right?
    In SSIS, we can create separate jobs with different stored procedures, then set the same schedule to kick the jobs off at the same time. In this way, we should be careful to monitor blocking and deadlocking depending on what the jobs are doing.
    We can also put all stored procedures in SSIS Sequence container, then they will be run in parallel.
    For more information about SSIS job and Sequence container, please refer to the following documents:
    http://www.mssqltips.com/sqlservertutorial/220/scheduling-ssis-packages-with-sql-server-agent/
    https://msdn.microsoft.com/en-us/library/ms139855(v=sql.110).aspx
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • How can I execute program after using F4_Filename function?

    Hi all,
    I'm a new user on the forum. I've been working with ABAP and SAP for a few weeks. I wrote a program for importing data from excel file to SAP using BDC. During searching this forum I found information about F4_Filename function which allows users to browse the disc for a file. I'd like to add this function to my program. I have a parameter for a file name but this is an ordinary static string field. When I added the code which I found in the message on this forum the rest of program doesn't execute.
    This is simple program for example:
    REPORT  Z_TEST8_AB.
    DATA f_name TYPE STRING.
    PARAMETERS p_file like rlgrap-filename DEFAULT 'c:\test.xls'.
    f_name = p_file.
    write:/ f_name.
    This program works correctly. There is a field for parameter. I can change the default name for a file.
    After all, I can run the program (F8) and rest of the code is executed. The field for parameter dissapears from the screen and the file name is displayed. ( command write)
    Now I added a function F4_Filename
    REPORT  Z_TEST8_AB.
    DATA f_name TYPE STRING.
    PARAMETERS p_file like rlgrap-filename DEFAULT 'c:\test.xls'.
    at selection-screen on value-request for p_file.
      call function 'F4_FILENAME'
           exporting
                program_name  = syst-repid
                dynpro_number = syst-dynnr
                field_name    = 'p_file'
           importing
                file_name     = p_file.
    f_name = p_file.
    write:/ f_name.
    I can browse a computer for a file now but after selecting the file I can't run the rest of the code. When I click on the icon or press key F8 the field for parameter doesn't dissapier and the command write is not executed.
    What do I do wrong?
    Could anyone suggest me a solution? How can I executed the code after using this function?
    Thanks in advance.
    Regards,
    Arek.

    Hi arkadiusz,
    1. simple
    2.
    <b>start-of-selection.</b>
    f_name = p_file.
    write:/ f_name.
    regards,
    amit m.

  • How can I execute external application?

    Hi friends I want printing my barcodes a laser printer (Kyocera) it isn't a barcode printer. So I think (and I look kyocera web page my model doesn't support barcode printing in sap) print my barcodes using an external system. Before SAP we are using JollyPrint application for printing barcodes. It is using an Excel file.
    I can create a excel file for this application. I must execute this (JollyPrint-it is a label application) application when I press a button. How can I execute this application?
    Thanks
    Mehmet
    P.S. I have been writing this message with details may be somebody can give me a simple way for this

    Well, I can suggest you following steps. May be it works for you .
    -Create an external OS command in SM69
    -Test OS command in SM49 ( <u><i>about OS command if you search in SDN you’ll get lot of material</i></u> )
    -Create a Script at your OS level, I’m assuming you might have some UNIX flavor or Sun solaria’s.
    -Create a Shell script , which execute the printer job from OS .
    -Shell script will have parameters . ( e.g. printer name, destination etc )
    -set the path of shell script directory in SM69 ( the command you just created )
    -Execute shell script using your ABAP program ( use FM "SXPG_COMMAND_EXECUTE" )
    In the ABAP  program you can pass the parameters and execute the command from ABAP as a result your job will start printing on the required destination. Moreover, you can also capture the spool at OS level .
    FYI
    For UNIX script, if you search in www.google.com ( UNIX forums) . you’ll get shell script .
    Hope this’ll give you idea!!
    <b>P.S award the points.</b>
    Good luck
    Thanks
    Saquib Khan
    "Some are wise and some are otherwise"

  • How can I execute an .app remotely in a server via internet?

    Hi,
    Using PHP, or something like it,  how can I execute a MAC OSX app but have it run remotely in the server?
    I know this may sound like a simple question but I have almost no experience with Web apps.
    Thanks,
    Juan Dent

    All you need is a trigger that starts the execution. A simple HTML link to the file will do.

  • How can I execute a statement before a VO is running

    JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660
    I use ADF BC
    how can I execute a statement before a VO is running

    thanks for the answer
    i use a logon function before I run a VO
    after a certain time will be disconnected
    and I have to call the function again
    sorry for my English
    public String logon(String username, String password){
    CallableStatement st = null;
    this.username = username;
    this.password = password;
    try {
    st = getDBTransaction().createCallableStatement("begin ep_security.LogOn(?,?); end;",0);
    st.setObject(1, username);
    st.setObject(2, password);
    st.executeUpdate();
    this.getDBTransaction().commit();
    } catch (SQLException e) {
    System.out.println("ERROR "+e.getMessage());
    this.addWarning(new JboWarning("Quote retrieved successfully"));
    System.out.println("...RETURN ERROR");
    return "error";
    } finally {
    if (st != null) {
    try {
    // 7. Close the statement
    st.close();
    } catch (SQLException e) {
    e.printStackTrace();
    }

Maybe you are looking for

  • How can i organize apps on one home page?

    I have four folders of apps sprawled across four home pages with all that space in between.     How can I move them all to the front home page?    Can't find this in the manual---is there a secret? Thanks for whatever help you can provide!  

  • Third party sales MM config

    Hi, We have a third party sales requirement and i need  to configure the MM part from when the sales order triggers a PR to Invoice recept which will update the billing document for the customer. Would be really grateful if someone can guide preferra

  • Can't open a .psd file.

    I don't know what Adobe product to download to open the file. Can you tell me? I'm running Windows 7.

  • I have installed two dictionaries. I want to delete one of them. How can I do this?

    I have found instructions for deleting words from the dictionaries, but not an entire dictionary. I have installed the ''English (US)'' dictionary and the ''English (British)'' dictionary. I want to only see the ''English (British)'' dictionary when

  • Making a component focusable

    I made a class extending JPanel and I want it to be selectable/focusable. I've been looking through the source code of many other classes (like AbstractButton) that have this function, but I still don't really understand what I need to implement or c