| Author |
Java Class Won't Execute At Command Line
|
Preston Thornton
Ranch Hand
Joined: Jun 24, 2008
Posts: 80
|
|
Hi, everyone,
I am working to sew together a two java programs, and I need to have them execute at the command (DOS prompt, for example) so that I can integrate it into HP Openview Operations as a Monitor program. I was able to test and run the program in Eclipse fine, and not at the command prompt. Here is the code and class files.
Class Files:
03/11/2012 11:30 AM 1,493 RuntimeExec$StreamWrapper.class
03/11/2012 11:30 AM 2,124 RuntimeExec.class
Windows CMD prompt:
I know its something I am over looking.
Thanks for your help in advance.
L Thornton
|
 |
Tina Smith
Ranch Hand
Joined: Jul 21, 2011
Posts: 152
|
|
The full package name should be included in the name of the class where main() is located.
In your case you want to run "java Cmdline.RuntimeExec"
You may also want to consider adding java to your PATH environment variable, and not capitalizing any part of your package name.
|
Everything is theoretically impossible, until it is done. ~Robert A. Heinlein
|
 |
Preston Thornton
Ranch Hand
Joined: Jun 24, 2008
Posts: 80
|
|
Thanks! I will make the adjustment and give it a try.
L Thornton
|
 |
Randall Twede
Ranch Hand
Joined: Oct 21, 2000
Posts: 4092
|
|
i dont use package statements much but what i remember is you have to cd to the folder one up from the package folder.
for example if the files are in myStuff\cmdLine, you need to cd to myStuff then type java cmdLine/RuntimeExec
|
SCJP
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
Randall Twede wrote:type java cmdLine/RuntimeExec
java cmdLine.RuntimeExec of course.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: Java Class Won't Execute At Command Line
|
|
|