• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Class Won't Execute At Command Line

 
Preston Thornton
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 208
9
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Preston Thornton
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! I will make the adjustment and give it a try.

L Thornton
 
Randall Twede
Ranch Hand
Posts: 4444
3
Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rob Spoor
Sheriff
Pie
Posts: 20559
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Randall Twede wrote:type java cmdLine/RuntimeExec

java cmdLine.RuntimeExec of course.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic