• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Jar crash without error

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a jar file that i can run it with a double click and from a bat file using this command:
Java -jar CiliniSys.jar.
But it crashed when i called the bat file from anothor application using :
Process = runTime.exec(new String[] {"...\\Viewer3D.bat"});
It just start running and crash with no error.
Is their is a way to debug or to fix this probleme?
 
author
Posts: 23928
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The exit code, the standard output, and the standard error streams are piped to the Process class... so, when you say that there was "no error", are you saying that you got those streams, and there was nothing? Or were you expecting something to be printed to the screen?


Anyway, hint ... can you run a batch file without a command shell? ...

Henry
 
Marshal
Posts: 76876
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
nihel turki
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can run the batch file with cmd using: start file.bat or with double clik.
I'm calling the batch file from weasis viewer. This viewer oppen a java console with no error when calling my bat file.
 
Bartender
Posts: 2908
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had a similar requirement where I had to run a bat file and monitor its output:
Here is my approach to the same using process builder

 
Saloon Keeper
Posts: 14502
325
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, but then you're running your batch file from the explorer process, or from the cmd process.

In your code, you're telling the runtime to execute the "Viewer3D.bat" process, but it's not a process, it's a batch file. You need to run a process which can interpret batch files.
 
nihel turki
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for your help i tried your code with the ProcessBuilder and it work
 
Whatever. Here's a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic