• 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

what could be the possible reason?

 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what could be the possible reason if program running in eclipse not running in command prompt
 
Ranch Hand
Posts: 265
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Kaleeswaran Karuppusamy
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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").
reply
    Bookmark Topic Watch Topic
  • New Topic