Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what could be the possible reason?

 
Kaleeswaran Karuppusamy
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what could be the possible reason if program running in eclipse not running in command prompt
 
Stevi Deter
Ranch Hand
Posts: 265
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15369
40
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • 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").
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic