wood burning stoves 2.0*
The moose likes IDEs, Version Control and other tools and the fly likes what could be the possible reason? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "what could be the possible reason?" Watch "what could be the possible reason?" New topic
Author

what could be the possible reason?

Kaleeswaran Karuppasamy
Ranch Hand

Joined: Jul 19, 2007
Posts: 153
what could be the possible reason if program running in eclipse not running in command prompt


Judge a man by his questions rather than his answers --Voltaire
SCJP 1.5 97%
Stevi Deter
Ranch Hand

Joined: Mar 22, 2008
Posts: 265

There could be many reasons. What error message are you getting when you try to run from the command line?

The most common reason, in my personal experience, is not having the correct classpath configured, but it really depends.


There will always be people who are ahead of the curve, and people who are behind the curve. But knowledge moves the curve. --Bill James
Kaleeswaran Karuppasamy
Ranch Hand

Joined: Jul 19, 2007
Posts: 153
this is my error i set path and classpath properly

java.lang.Exception:
java.io.IOException: Cannot run program "\soffice": CreateProcess error=2, The system cannot find the file specified
java.io.IOException: Cannot run program "\soffice": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at com.sun.star.comp.beans.LocalOfficeConnection$OfficeService.startupService(LocalOfficeConnection.java:793)
at com.sun.star.comp.beans.LocalOfficeConnection.connect(LocalOfficeConnection.java:344)
at com.sun.star.comp.beans.LocalOfficeConnection.getComponentContext(LocalOfficeConnection.java:248)
at com.sun.star.comp.beans.OOoBean.setOOoConnection(OOoBean.java:188)
at com.sun.star.comp.beans.OOoBean.getOOoConnection(OOoBean.java:288)
at com.sun.star.comp.beans.OOoBean.getMultiServiceFactory(OOoBean.java:308)
at com.sun.star.comp.beans.OOoBean.loadFromURL(OOoBean.java:578)
at com.officebean.OOoBeanViewer.createBlankDoc(OOoBeanViewer.java:286)
at com.officebean.OOoBeanViewer.access$1(OOoBeanViewer.java:278)
at com.officebean.OOoBeanViewer$1.actionPerformed(OOoBeanViewer.java:70)


when i run my program in eclipse IDE working fine and also "soffice.bin" and "soffice.exe" process created in windows task manager once process created i can run in command prompt without error message
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13884
    
  10

The error message should give you a hint: Cannot run program "\soffice": CreateProcess error=2, The system cannot find the file specified

Where is the soffice.exe file located and how are you referring to it in your program? It looks like your program can't find soffice.exe if you run it from the command line. Try using the absolute path to the executable instead of a relative path (for example "C:\\Program Files\\Something\\soffice.exe" instead of "\\soffice").


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what could be the possible reason?
 
Similar Threads
optimation of resources plz help
why is a applet not running in some Browser
String Class
problem in JVM
java lang NoClassDefFoundError