Easier to launch using bat files?

Isn't it really easy to launch Java using a bat file? There seems to be alot of discussion regarding exe files etc. but it seem to me that it works well using a bat file. That way you can use the -cp to set the classpath too if needed.
Would it be possible to write code that checks the JVM and prompts the user to download the version required? Or possible to write a bat to launch a Java file, or even an applet to do the same thing.
I need to distribute an application at work, but the install can't be any harder than a couple of clicks!
Thanks,

On the subject of jar files; I am having trouble
running my app through a jar file because are probs
with the manifest file. I know that I have to edit my
manifest file to name, I believe, the method of my
main class.
howover , I did edit this file ( checked via textpad)
and it had the two entries - one the default spiel
about version and
2) the line Main-Class: my methodyou have to enter the class name (without fileextension), not a method name.
Main-Class: MyOwnClass

Similar Messages

  • Launch a .bat file??

    How do I get a button to launch a .bat file when clicked??
    Thank you

    The Open command should launch a bat file.

  • Using .bat file to run java application

    I want to be able to trigger Java class from SQL command. SQL statement will execute batch file, which contains all information about my java class and about CLASSPATH variable.
    Unfortunately, it does not work as planed. I get this message in Query Analyzer:
    output Compile first.
    RUN COMPILED FILE NOW
    java.lang.NoClassDefFoundError: \\finkelsteine\autotest\CommandLineTest
    Exception in thread "main"
    (4 row(s) affected)
    Here is SQL I use:
    DECLARE @cmd varchar(1000),
    @result int
    SET @cmd = '\\mycomputer\autotest\autotest.bat'
    EXEC @result = master..xp_cmdshell @cmd
    select @result
    Here is the autotest.bat file:
    @ECHO OFF
    SET PATH=%PATH%;C:\jdk1.2.2\bin;C:\jdk1.2.2\jre;C:\jdk1.2.2\lib
    SET CLASSPATH=c:\autotest;%CLASSPATH%
    ECHO Compile first.
    javac c:\autotest\CommandLineTest.java
    ECHO RUN COMPILED FILE NOW
    java c:\autotest\CommandLineTest
    Here is my CommandLineTest.java file
    import java.io.*;
    public class CommandLineTest
    public CommandLineTest() {
    super();
    public static void main(java.lang.String[] args)
    File file = null;
    PrintWriter out = null;
    file = new File("c:\\autotest\\test.txt");
    try
    // Create an output stream
    out = new PrintWriter(new BufferedWriter new FileWriter(file)));
    out.println("Hello there");
    out.flush();
    out.close();
    catch(IOException ioex)
    ioex.printStackTrace();
    System.out.println("IO exception");
    please help.

    The argument to the java command is the name of the class to run, not a path to the class file. You must have the classpath environmental variable set up properly for the class to run.

  • How to get the erroe message, if i run java program using .bat file

    Hi,
    I have a java file which accepts two inputs as command line argument. I want to make this pgm a tool. So have created a *.bat file which has the following command
    java myprogram arg1 arg2
    I'm gonna share this program with others. So i'll keep the class file and the .bat file in a commaon folder. All the users have to do is, edit the .bat file to give his/her args and run the .bat file. The pbm is, if the user input is not valid, I have put displays in the pgm to show it.
    But if i run thru .bat, I'm not getting the error message or I don't know where it is getting displayed.
    Can anyone help me with this ?
    Thanks,
    Mary

    When i run from the console, I can see the output.
    But, when i double click on the .bat file from the
    folder, it runs fine and i couldn't see the output.
    nullThat's because the error message is printed, and then the console is closed. The message is there but you need to read really really fast :)

  • How to format the spaces in a text file using bat file scripting

    Currently the records in my text file are like this:
    100239 0000015.00 
    QRP
    I want them to be like this:
    100266 0000015.00 QRP
    There should be 6 spaces before the first column and 8 spaces after that. There should be 1 space between the second and third columns.
    Generally this file contains approx 1000 records.
    Any help is highly appreciated.
    Thank you.

    So far it's like this:
    for /f "skip=2 delims=*" %%a in (C:\Bonus_File_Export.txt) do (
    echo %%a >>C:\newfile.txt    
    xcopy C:\newfile.txt C:\Bonus_File_Export.txt /y
    del C:\newfile.txt /f /q
    I've to format a text file generated by the tool Microstrategy and it feed it to another system in a specific format. Ihave removed the headers with the above script but was unable to remove the spaces between those columns.
    You can use this code as a basis for your script:
    @echo off
    set Line=
    if exist d:\temp\newfile.txt del d:\temp\newfile.txt
    for /F "skip=2 tokens=1-2" %%a in (d:\temp\test.txt) do call :Sub %%a %%b
    goto :eof
    :Sub
    if not "%2"=="" (
      set Line=      %1        %2
    ) else (
      echo %Line% %1>>d:\temp\newfile.txt
    It works provided that your input file uses this format:
    Header line
    Header line
    100239 0000015.00  
    QRP
    100240 0000016.00  
    QRR
    100241 0000017.00  
    QRS
    100242 0000018.00  
    QRT
    100243 0000019.00  
    QRU
    100244 0000020.00  
    QRV

  • Executing oracle form using .BAT file

    I have written one batch file to run oracle form
    FILE START.BAT :
    ifrun60 D:\DEPLOY\USER_INPUT.fmx scott/tiger@HOSTDB
    when I give command on DOS prompt.
    D:\deploy>start and press ENTER
    it doesn't work. Would you please suggest any solution to this?
    Thanks in advance.
    Shailesh

    hi dear
    user this code ur batch file
    @echo off
    :: COMPILE_FRM.BAT
    cls
    ECHO Compiling forms
    FOR %%f IN (*.fmb) DO ifcmp60 userid=scott/tiger@db module=%%f
    ECHO Finished compiling
    M Rizwan

  • Can not run business rule with bat file

    Hi all,
    I've problem with using *.bat file to run business rule. My Essbase version is 11.1.1.3 and the syntax within
    *.bat is simple, but I always got the Usage message and can not execute the rule.
    The error result as blow(I already execute the syntax in command panel directly):
    C:\Hyperion\products\Essbase\eas\console\bin>CmdLnLauncher -SWILSON -Usynadmin -P111111 -r0004_COPYDATA
    Usage: CmdLineLauncher [-p:<passwordFile>] -Sservername -Uusername [-rBusiness R
    ule Name | -sSequence Name] [-fRun Time Prompts file] [-validate]
    My *.bat file content as below:
    cd c:\Hyperion\products\Essbase\eas\console\bin
    call CmdLnLauncher -SWILSON -Usynadmin -P1111111 -r0004_COPYDATA
    Is there something wrong? If anyone know about this problem, please help,thanks!!

    Hi,
    Here is a brief overview on how to use the command line launcher.
    You can create a file and put the following information into it filling in the servername,app name and db name
    ExecDB::"Planning/servername/appname/dbname"
    Save it as .xml file (don’t think it has to be an xml, could be .txt), so something like connect.xml
    Then when you run your command line do exactly like before Cmdlnlauncher -Sservername -Uusername -p:password.txt -rrule -fconnect.xml
    If you have variables in your rule you can
    In EAS right click over the rule and select "Automate Launch Variables", fill in the details and then save it is as an xml.
    You just need to reference the xml in the batch script as described above using the -f parameter, for sequences remove -rrule and use –sSequence
    update password.txt to the name of your password file.
    Cheers
    John
    http://john-goodwin.blogspot.com/
    Edited by: JohnGoodwin on Apr 30, 2010 8:17 AM

  • Running bat-files from Java

    Hello,
    I have been trying to launch a bat-file from my Java code, running under windows, but with no success.
    Here is my simple code:
    Runtime.getRuntime().exec(new String[] {
             "C:\\temp\\test.bat"
          });This does nothing at all and generates no exception. Any suggestions?

    It seems java has a real problem with this... if you
    want to run another java program, for instance, you
    cannot do that either with String cmd="cmd.exe /C
    java myProgram"
    I need to pass parameters from one program into the
    program I'm going to open using java, that is why I
    need to call it from my first program. It can open
    executables and shortcuts, but has a real big problem
    doing things with the command line.No it doesn't have a problem with it. You just must be doing something wrong. By the way, since "java(.exe)" is already an executable, there's little value in wrapping that by the "cmd.exe" shell (unless you want to use the command shell for some reason such as passing the redirector (>) symbols to it to let it redirect stdout / stderr to a file)

  • Convert .bat file to .msi

    Hi everyone!
    Please help....
    The case is that I first have to run a batch file (which takes about 2
    minutes, because it removes an application) and then AFTER it has run, I
    need to run an application packet. I know that it should be possible to
    just write the batch script into the "launch before" script of the app.
    packet. But it doesnt work. So therefore I will try to convert the .bat
    file into a .msi packet. In that way I can use the "depend on another
    app.packet"-function.
    So please does anyone know how to convert from .bat to .msi?
    Or maybe another solution?
    THANKS!!!
    Chrisitan

    Yes I´m deleting directories. Actually it´s uninstalling one anti virus,
    so it can install another vendors anti virus.
    But I solved the problem. I put an # before launching the .bat file in
    the login script.
    And after that I used Zenworks to distribute the app. packet.
    Since the .bat file takes about 2 minutes to run I added a copy of a
    simply file from the
    server to the computers harddrive. Then I use a "if exist....else goto
    exit" script. In that
    way it won´t run the .bat file on every login.
    But I still don´t understand why the "launch before" can´t read the .bat
    file script.
    But anyway....thanks for your reply....this case is solved.
    Marcus Breiden wrote:
    > Christian wrote:
    >
    >> Hi everyone!
    >> Please help....
    >>
    >> The case is that I first have to run a batch file (which takes about 2
    >> minutes, because it removes an application) and then AFTER it has run, I
    >> need to run an application packet. I know that it should be possible to
    >> just write the batch script into the "launch before" script of the app.
    >> packet. But it doesn?t work. So therefore I will try to convert the .bat
    >> file into a .msi packet. In that way I can use the "depend on another
    >> app.packet"-function.
    >
    > hmm... are you deleting directories? I would really try to get that batch to
    > run.. could you post it?
    >
    >> So please does anyone know how to convert from .bat to .msi?
    >> Or maybe another solution?
    >>
    > Software Packing which is part of the suite would allow that, but it would
    > only remove existing files... so if you delete a dir with 4 files during
    > creating of the msi it would afterwards only delete that dir with those 4
    > files... no other files..
    >
    > not a good approach IMHO..

  • How to generate a PDF output using batch file in 10G

    Hello,
    I am using .bat file to generate a report PDF output. I have done this many times in 6i but for 10G I am unable to do the same.
    Can someone please look at the syntax below and let me know where I am going wrong.
    I understand that reports are different for 6i and 10G specially .rep file but I am sure we should be able to generate a PDF file using 10G. Please let me know.
    Thanks
    IQ
    Contents of .bat file follow
    ECHO Opening parameter form. Please do not close this window.
    C:\
    FOR /F "tokens=1 " %%I IN ('time /t') DO (SET _TIME=%%I)
    FOR /F "tokens=2 " %%I IN ('date /t') DO (SET _DATE=%%I)
    SET EXP_DATE=%_DATE:~6,4%%_DATE:~0,2%%_DATE:~3,2%_%_TIME:~0,2%%_TIME:~3,2%
    SET FILENAME=SEND_EMAIL_%EXP_DATE%_%USERNAME%.PDF
    CD C:\Users\Documents
    RWCONVERTER REPORT=C:\Users\Documents\send_email.rep USERID=scott/tiger@ORCL1 ORIENTATION=LANDSCAPE DESFORMAT=PDF DESTYPE=FILE
    DESNAME=C:\Users\\%FILENAME% PRINTJOB =NO

    Rwconverter is not used to run reports:
    rwconverter (Reports Converter) enables you to convert one or more report definitions or PL/SQL libraries from one storage format to another.
    I think you mean rwrun:
    rwrun (Reports Runtime) runs a report by starting its own in-process server (not to be confused with the default in-process Reports Server), which runs in the same JVM as the rwrun process.
    This bat file has to run on the server. There is no Reports installation on the client anymore.
    If you want to run a report from a client, you can make a bat file that calls the report url
    See: http://download.oracle.com/docs/cd/E14571_01/bi.1111/b32121/pbr_cla002.htm#i634710

  • Bat File Trace

    Hi
    I use bat files scheduled to execute batch script late night.
    at the end of the execution i have no clue that now many statements in batch process successful and how many statements fail to execute.
    Is there anyway i can make a log of my bat file execution to see success and fail of all statements after execution?
    Wishes

    Redirecting Output to a File in Windows Batch Scripts
    http://blog.crankybit.com/redirecting-output-to-a-file-in-windows-batch-scripts/
    Regards,
    Sabdar Syed.

  • 11g - how to clear cache by bat file

    hi, experts,
    in 10g, it is able to clear the cache using bat file.
    by bat file, I can set a windows schedule to clear the cache
    for 11g, how to do this?

    Please look into these two blog posts to create the batch file you need:
    http://shivabizint.wordpress.com/2010/12/22/purge-bi-server-cache-in-obiee11g/
    http://www.skurabigroup.com/blog/?p=659
    Hope this helps.
    Thanks,
    -Amith.

  • Using XML Files for Message Bundles

    Hi There,
    does anybody knows if there is an easy way to use xml files instead of property files for the strings stored in MessageBundles (Locale)?
    Cheers Lars

    Oki,
    found XMLResourceBundle. No more action on your side is required, Thanx anyway...
    Bye

  • Run java in bat file

    hi
    i used .bat file to run my java program, here's what i put inside the run.bat
    java testbut it seems that i can only run java classes which are in the same folder as the .bat file
    when i tried
    java d:\folder\testan error will occur. how should i do it here? thanks

    You can creating a jar file. After taht you can execute the java program like
    java -cp Example.jar com.examples.MainClass
    MainClass included main method. You can write an manifest.mf file.In the manifest file, you can describe the main class.

  • How to create bat file

    I want to know how to create a bat file...plz

    Use a simple text editor
    Type in DOS commands just like you would on the command line
    You can do a google search for bat commands to find a bunch of useful things to use to close the DOS window or other neat things you might want to do.
    (assumes you are using windows, can you use bat files in Unix? )

Maybe you are looking for

  • Two iTunes Folders on one PC (My mistake). Please help!

    Sorry, I had this in another post that was too long and could not edit. Please don't punish me, mods... https://discussions.apple.com/message/12497755#12497755 Edited: My old computer crashed and I couldn't recover the most recent iTunes folder on th

  • Disk too slow- logic & macbook pro

    Hi I have recently bought logic studio 8 and i own a macbook pro. Whenever i try to record audio in logic, i get about a minute in to recording then a message appears saying 'disk too slow error 00001' although the music carries on, recording stop. I

  • How do I rearrange sections of a pdf portfolio?

    I am putting together a PDF portfolio from 7 different pdf files, but when loaded in they were in the wrong order. Now I want to move them around before publishin it. How do I do that??? Adobe 9 Pro

  • NetBeans - Reloadable web application

    Hi can someone tell how can I make a web application reloadable. I am using Netbeans 3.6 and its embedded tomcat 5.0 server and I do not want recompile and execute my application everytime I make changes and compile a single servler/jsp. Can someone

  • File synchronisation between several devices

    Good afternoon I have a MacBook Pro and currently use FreeFileSync to backup/synchronise files between my Mac and an external hard drive and a NAS drive. Whilst this works OK I was wondering if there was anything out there that may be a little slicke