How to write run.bat files

Can anyone tell me how to write run.bat files to run java classes. Currently my run.bat file has the following two lines,
c:\j2sdk1.4.1_02\bin\javac.exe *.java
c:\j2sdk1.4.1_02\bin\java.exe questionnair
But the class is not executed. Thanks in advance.

you'll have to provide more details.
Firstly, which package is the class a part of? and secondly, where on the filesystem is the root of the package?
You might also benifit from placing the c:\j2sdk1.4.1_02\bin\ into the classpath.
On a rainy day, check out the ANT tool, it will take care of all that crapola for you.
newio

Similar Messages

  • How to call a .bat file from java code?

    How to call a .bat file from java code? and how can i pass parameters to that .bat file?
    Thanks in advance

    thanks for ur reply
    but still i am getting the same error.
    I am trying to run a .bat file of together tool, my code looks like below
    import java.lang.Runtime;
    import java.lang.Process;
    import java.io.File;
    class SysCall{
         public static void main(String args[]){
              String cmd="D://Borland//Together6.2//bin//Together.bat -script:com.togethersoft.modules.qa.QA -metrics out:D://MySamples//Metrics// -fmt:html D://Borland//Together6.2//samples//java//CashSales//CashSales.tpr";
              //String path="D://Borland//Together6.2//bin//Together.bat ";
              Runtime r= Runtime.getRuntime(); //Declare the system call
              try{
                   System.out.println("Before batch is called");
                   Process p=r.exec(cmd);
                   System.out.println(" Exit value =" + p.exitValue());
                   System.out.println("After batch is called");
              /*can produce errors which must be caught*/
              catch(Exception e) {
                   e.printStackTrace();
                   System.out.println (e.toString());
    I am getting the below exception
    Before batch is called
    java.lang.IllegalThreadStateException: process has not exited
    at java.lang.Win32Process.exitValue(Native Method)
    at SysCall.main(SysCall.java:17)
    java.lang.IllegalThreadStateException: process has not exited

  • Running bat files in java code

    Hi,
    I am trying to run a .bat file within java code like this.
    Runtime.getRuntime().exec("c:\\Test.bat");
    but no success. Could you please suggest how to run .bat file or simply a
    DOS command from java code.
    thanx in advance
    Deepak Garg.

    try this...
    n reply whether it worked or not......
    import java.util.*;
    import java.io.*;
    import java.net.*;
    try
    Runtime runtime = Runtime.getRuntime();
    Process process ;
    process= runtime.exec("./temp_install");
    //code to print command line replies
    InputStream stderr = process.getInputStream();
    InputStreamReader isr = new InputStreamReader(stderr);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    while((line=br.readLine())!=null)
    System.out.println(line);
    catch(Throwable t)
    t.printStackTrace();
    }

  • How to create a bat file by abap?

    hi~
    i ask a elementary question.how to create a bat file in my local pc?how to write some message in this bat file ?thank you !

    execute bat-files
    Reward Points if it is helpful
    Thanks
    Seshu

  • HELP!!!!!! - How to write into a file?

    How to write into a file?
    I want to make a script that will connect(not enter) to my website[for example, www.vasa.com] every time i connect to the internet.
    Now i have 3 problems:
    1. i dont know how to write into a file
    2. i dont know how to make it connect to my 'server' without entering the website
    3. i dont know what file to write it to
    so if someone can help me, please do.

    Well, how about RTFM?? In this case that can be found here:
    http://developer.java.sun.com/developer/onlineTraining/
    BTW - these things have been asked azillion times, search the forum.

  • How to write a CSV file in OSB

    Hi All,
    can any one tell me How to write a CSV file in OSB?
    Thanks.

    Hey, I couldnot find any xsl usage inside pipeline pair in the links given by you. Do you have any links that gives a sample example.I could not find any links with examples. I will send you a simple config jar demonstrating the use of XSLT resources/transformations.
    secondly should MFL doc replicate the name(s)of the nodes of the source xsd:I'm not sure If I understood your question.Can you please explain?
    Ex: My database schema looks like:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <xs:schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/AssetsPoll" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/AssetsPoll" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="CountriesCollection" type="CountriesCollection"/>
    <xs:complexType name="CountriesCollection">
    <xs:sequence>
    <xs:element name="Countries" type="Countries" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Countries">
    <xs:sequence>
    <xs:element name="countryId">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="countryName" minOccurs="0" nillable="true">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="40"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="regionId" type="xs:decimal" minOccurs="0" nillable="true"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    and the corresponding MFL that I have created gives this output
    <?xml version="1.0" encoding="windows-1252"?>
    <countriesCollection1>
    <Countries>
    <counrtyId>counrtyId</counrtyId>
    <country_name>country_name</country_name>
    <regionId>regionId</regionId>
    </Countries>
    <Countries>
    <counrtyId>counrtyId</counrtyId>
    <country_name>country_name</country_name>
    <regionId>regionId</regionId>
    </Countries>
    </countriesCollection1>
    Why I am asking this beacuse there is an error that i am getting:
    Jun 19, 2009 5:50:50 PM IST> <Error> <JCATransport> <BEA-381951> <JCA inbound r
    quest only invocation failed, exception: java.security.PrivilegedActionExceptio
    : com.bea.wli.sb.transports.TransportException: Binary to XML mfl transformatio
    failed for the MFL Resource Database-Jms-File/Database-File/MFLSample : null
    ava.security.PrivilegedActionException: com.bea.wli.sb.transports.TransportExce
    tion: Binary to XML mfl transformation failed for the MFL Resource Database-Jms
    File/Database-File/MFLSample : null..................................................
    Any help?
    Regards
    PS

  • Running Bat file in Minimized Mode

    Hai All,
    I need to run bat file using Runtime, Bat file should run in minimized
    mode ...
    any one help me
    Regards
    Yuva

    Assuming it's windows...
    start /min mybatchfile.batOpen a command prompt and type "start /?" to see the params available.
    regards,
    Owen

  • SOMEBODY AWNSER PLEASE....(HOW TO EXECUTE/RUN XML FILES IN WLS6?)

    Hi all,
    Please help me out on my XML question as my Cocoon is no longer working.
    The question is titled HOW TO EXECUTE/RUN XML FILES IN WLS6.
    Thanks in advance.
    snodx

    look at the samples bea\wlserver6.0sp1\samples\examples\xml
    ~
    Namaste - I bow to the divine in you
    ~
    Filip Hanik
    Software Architect
    [email protected]
    www.filip.net
    "snodx" <[email protected]> wrote in message
    news:3b4e83dd$[email protected]..
    >
    Hi all,
    Please help me out on my XML question as my Cocoon is no longerworking.
    >
    The question is titled HOW TO EXECUTE/RUN XML FILES IN WLS6.
    Thanks in advance.
    snodx

  • Can any one tell me how to write the properites files and how to acces

    can any one tell me how to write the properites files and how to acces thoose files
    plz let me no
    thanks in advance

    http://www.exampledepot.com/egs/java.util/Props.html

  • Help! problem running .bat files in browser

    HI! Hope you can help me!
    I have a simple applet that runs .bat files and retrieves the resulting information into a text box.
    To run those files I use:
    Runtime rt = Runtime.getRuntime();
    Process processo=rt.exec("C:/po2PrtMonitor.bat 04600105 ope >C:/infoPrt.txt");
    in wich "04600105","ope" and ">C:/infoPrt.txt" are parameters that the .bat file is expecting. When the file is ran it saves the resulting information on a simple .txt file, that I later read by using:
    fichResposta = new FileInputStream(fichRespostaPath[0]);
    When I run my applet on JDeveolper 9.0.2.822 is works perfectly, the problem is when run it on the browser.
    On the browser the applet executes the file by opening a MS-DOS prompt and when it finishes executing the file, the prompt closes automatically and doesn't send the information into the .txt file.
    My .bat file is something like:
    jre -cp PrtSrv20.jar sibs.deswin.prt.PrtMonGateway 10.46.1.22 5003 %1 %2 %3
    where %1,2%,3% are the above parameters given by the applet when the file is ran.
    If I run it on JDeveloper I get:
    C:\>jre -cp PrtSrv20.jar sibs.deswin.prt.PrtMonGateway 10.46.1.22 5003 04600105 ope
    PRTSES=04600105 HDR=0460010000000005 STA=OPENED TRF=ACTIVE TRP=CONN ILTS=15 Long postings are being truncated to ~1 kB at this time.

    Here is what is missing:
    ILT=0 MSQ=388 HDR=04.60.01.00.00.00.00.05.41.00.01.84. CMD=STRT-TRF
    When the applet is run on the IE broser what I get is simply:
    jre -cp PrtSrv20.jar sibs.deswin.prt.PrtMonGateway 10.46.1.22 5003 04601005 ope
    I have no idea as to what the problem might be! Do native methods work differently on the browser?! Could it be a problem on the deployment? A library not included on the deployment profile? Suggestions are very welcome.
    Hugo Rosas

  • How to Execute a BAT file

    Hi,
    I have to  execute .bat file , for this i writen the code as below,  i tried with 3 FM's.
    but am unable to run bat file, missing anything ?
      *data : begin of i_command occurs 0,
            txt(255),
           end of i_command,
           rbuff(10).
    *CONCATENATE 'rename' 'hari.txt' 'kris.txt'
                  into  I_COMMAND-txt  SEPARATED BY SPACE.
    APPEND I_COMMAND.
    CALL FUNCTION 'WS_DOWNLOAD'
          EXPORTING
               FILENAME = 'c:\ren.bat'
          TABLES
               DATA_TAB = I_COMMAND.
    CALL FUNCTION 'WS_EXECUTE'
          EXPORTING
               PROGRAM = 'c:\ren.bat'
          IMPORTING
               RBUFF   = RBUFF.
    *CALL FUNCTION 'GUI_EXEC'
          EXPORTING
           COMMAND  = 'CMD /C '
           PARAMETER = 'c:\ren.bat'.
    CALL FUNCTION 'GUI_RUN'
           EXPORTING
            COMMAND  = 'C:\ren.bat '.
    Thanks in advance,
    hari

    Hi,
    CALL METHOD cl_gui_frontend_services=>execute
      EXPORTING
        application            = 'cmd'
        parameter              = ' '   " here pass the required parameter
      EXCEPTIONS
        cntl_error             = 1
        error_no_gui           = 2
        bad_parameter          = 3
        file_not_found         = 4
        path_not_found         = 5
        file_extension_unknown = 6
        error_execute_failed   = 7
        synchronous_failed     = 8
        not_supported_by_gui   = 9
        OTHERS                 = 10.
    If useful, please reward
    Regards,
    Vijay

  • How to create a .bat file to run *.class files?

    Hello.
    I have compiled java *.class files.
    I would like to make a shortcut on my desktop to run my Java programs.
    How to write a shortcut (.bat file or something else) to run Java programs?
    Thanks

    1) Make it into an executable jar file (internet search for "java executable jar" will give you lots of help)
    2) Write a batch file. If you do not know how to do this, a Java forum is not the place to find out. Do an internet search or find a windows support site.

  • How to use a bat file to change plug-in control panel settings?

    Hi,
    The company I work at has old applications that rely on the MS JVM shipped with IE so we cannot activate the Sun Java plug-in for all users.
    The applet we are developing has to write to disk and thus has to be signed. We do therefore need to run a modern Java version for our users. We have about 5000-7000 users so we would need to create a bat file that would automatically be run for our users. That bat would set that the Sun Java plug-in will be used for Intenet Explorer.
    Does anyone know which (registry-?) setting it is that is changed when the Internet Explorer box is checked in the Java plug-in control panel?
    All help is greatly apprechiated.
    Best regards,
    Helena

    Try this one:
    HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Plug-in\1.5.0_06
    Where the 1.5.0_06 might be a different version.
    There is a value named UseJava2IExplorer. 1 is enabled (Sun's), 0 is disabled.

  • Running bat files from JDeveloper

    hi
    Sometimes it could be convenient to run a bat file directly from JDeveloper.
    For example, the application in SQLAuthenticatorApp-v0.02.zip (see also forum thread "how to disable (or lock) users") has an Ant file BuildStuff/build-wlst.xml which has targets like "wlst.create-domain" and "create.wls-start-stop-bat-files", the last one resulting in some bat files which I have been able to configure to run from JDeveloper,
    see http://www.consideringred.com/files/oracle/img/2011/run-using-cmd-20110529.png
    The External Tool cmd configuration I use is shown in the screenshot
    at http://www.consideringred.com/files/oracle/img/2011/external-tool-cmd-20110529.png
    See also the blog post by John 'JB' Brock
    at http://blogs.oracle.com/jdevextensions/entry/how_to_extend_jdeveloper_without_writing_code
    - (q1) How can I configure the External Tool cmd to run in its own cmd (command) window outside JDeveloper?
    many thanks
    Jan Vervecken

    Hi Jan,
    It looks like this is going to be a bug from what I can see. After looking at it a little more this morning, not only does it not display the cmd window, but if you use the /k argument, it leaves the script running in memory. Look at your Task Manager after running a few times with /k
    I'll file a bug, and see if anyone has a work around or something that I missed.
    For now, it would appear this is not possible, and you will just have to see the result in the log window. I would not use /k as well. Stick with /c for now.
    Sorry for the inconvenience.
    --jb                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Where is the run.bat file?

    Hi,
    I have downloaded beanbuilder-0_6-alpha from https://bean-builder.dev.java.net/
    I am trying to install the bean builder going thru the readme file. I have extracted all the file but I cannot find "run.bat". Can anyone help me find this file.
    If this is not how I should go about installing the bean builder. Please guide me.
    Thanks,
    tick_tick

    Hi,
    You probably have the wrong classpath on your line:
    java -cp ... javafilename xml ruleset_nameSince the DocumentBuilderFactory can't be found.
    It is most likely included in one of the jar-files in the lib directory.
    /Kaj

Maybe you are looking for

  • How can I access my balance from a redeemed iTunes card that I input on my pc on my iPad?

    I redeemed an iTunes card on my pc.  It has a bal of 30 dollars.  Why can't I access that on my iPad?

  • FRM-92102 error when accessing Forms and Peoplesoft simultaneously

    We are receiving an FRM-92102 error when we access Peoplesoft and then our web forms application simultaneously. Here is the error message: Java Plug-in 1.6.0_11 Using JRE version 1.6.0_11 Java HotSpot(TM) Client VM User home directory = C:\Documents

  • Dimming screen...

    Hey everybody, I have called Apple to ask them if they have heard anything or have a policy on how to deal with this problem and have gotten no real answer. So, I thought I would Post because my questions have been answered so quickly on here recentl

  • I'm guessing no cure for crashing Safari?

    I've tried everything! If anyone can help, this is my latest report. I get one EVERY time Safari closes, and a lot more times Safari just plain crashes for no reason. It's way pas the point of a PC. This is embarrassing... Process: Safari [4390] Path

  • Resource costed flag to be checked.

    Hi, the issue started when we started seeing some transactions lying in receiving account but not getting costed against the WIP jobs..what I found was that the OSP resource used against that job was setup as non-costed.. As once the resource is defi