• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Java Class Won't Execute At Command Line

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

L Thornton
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22656
126
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Randall Twede wrote:type java cmdLine/RuntimeExec


java cmdLine.RuntimeExec of course.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic