1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

how to call java program from shell script

Discussion in 'Oracle Apps Technical' started by kcp_pavan, Mar 16, 2009.

  1. kcp_pavan

    kcp_pavan Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    I have a java program to validate a XML file. I want to call this java program in a shell script which will be registered as concurrent program in oracle apps.

    Can anyone please let me know the step by step appraoch required to call java program in shell script like ....intial steps or.........setting up any path for java class in shell script ... how to call a java program with parameters ....etc


    tons of thanks
    pavan
     
  2. tyro

    tyro Forum Genius

    Messages:
    368
    Likes Received:
    20
    Trophy Points:
    260
    Location:
    India
    hmmm u seem to be in the wrong forum buddy

    I can give u some guidelines. What you want is to execute a Java program from a shell script. Now a shell script is nothing but a text file which has to be executed. To take it step by step

    1> You need a java executable JAR file. Since you say you already have a java program can u run it from command line? Look up the following link for basics of JAR files:
    Using JAR Files: The Basics (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files).

    I believe the command is java -jar app.jar

    2> Now you need to incorporate this command in a text file and save it as a shell script. Look up this guide for : How to write a shell script

    So if you run your shell script your java program should run.
     
  3. kcp_pavan

    kcp_pavan Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    Thanks to tyro for his valuable guidance. It worked effectively

    pavan
     
  4. tyro

    tyro Forum Genius

    Messages:
    368
    Likes Received:
    20
    Trophy Points:
    260
    Location:
    India
    U r most welcome!
     
  5. Neo

    Neo Guest

    All,
    i have the same query as that of Pavan...i.e....Can anyone please let me know the step by step appraoch required to call java program in shell script like ....intial steps or.........setting up any path for java class in shell script ... how to call a java program with parameters ....etc

    but llink 'How to write a shell script' seems to be absurd now... please help and send the appropriate link for this...

    Pavan,
    do you have the code which worked for you...