running the java utility from unix shell script

Hi experts,
               i have an issue with running a java file from a unix shell script. The java file i am running is part of a jar file. The java file takes 2 args. The windows equivalent to what i wud like to achieve is the following :


C:\Program Files\Java\jre1.5.0_13\bin\java.exe  -cp C:\Util.jar; com/util/Deploy Arg1 Arg2

Where C:\Utill.jar is the jar file which contains the class Deploy which takes 2 args.

Please help me achieve the same in shell script on unix ..

thanks in advance
               
royalcyberAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oleberCommented:

The command is +- the some

java  -cp /path/Util.jar com/util/Deploy Arg1 Arg2

in my pc the Java is in:
/usr/bin/java
0
jmlonCommented:
Three observations:

1). Under Unix/Linux the semi-colon is and end-of-command marker. To separate multiple paths in the classpath use colon.

2). Both previous examples have a syntax error if the class is named Deploy and is in the package com.util. The correct unix command line is:

java  -cp /path/Util.jar com.util.Deploy Arg1 Arg2

3). If you define Deploy as the main class within the manifest file, you can simplify things even more:

java  -jar /path/Util.jar Arg1 Arg2
0
bhaskar20001Commented:
windows:: java  -cp c:\Util.jar com.util.Deploy %1 %2
Unix/Linux:: java  -cp /path/Util.jar com.util.Deploy $1 $2
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.