Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Beginning Java
call java program from script?
david lightman
Ranch Hand
Posts: 82
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I am a linux newbie but I want to call
java
program from a shell script
it is a bash shell and is it also possible to pass variables to the java program when it is called?
thanks
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
I like...
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Sure., Just run the program as "java ClassName arg1 arg2 ...", where ClassName is the name of the main class, and arg1, etc, are the command-line arguments to the program. There are, of course, class path issues, etc, but this is the basic idea.
[Jess in Action]
[AskingGoodQuestions]
Dale Seng
Ranch Hand
Posts: 275
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You can also launch a jar file, provided it has a manifest that points to the class where the main method is:
java -jar myJarToLaunch
--Dale--
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Callling a Script from a java program
How to call Java program main method from shell script
how to execute shell script from java class
Linux script to call a java program
ftp files to a different server
More...