aspose file tools
The moose likes Java in General and the fly likes problem with running a shell script from Java program Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "problem with running a shell script from Java program" Watch "problem with running a shell script from Java program" New topic
Author

problem with running a shell script from Java program

minhdung tran
Greenhorn

Joined: Dec 19, 2007
Posts: 9
Hello,

I have a question regarding to running shell script from my java program , and I wish to get your advice.

I am eclipse and I have my shell script located at /HelloSoapServer/runwsgen.sh . The root of my project is at /HelloSoapServer.

I am running a java program to execute the shell script and the java program is




However, when I ran this java program , I got error message saying :


java.io.IOException: Cannot run program "./runwsgen.sh": CreateProcess error=193, %1 is not a valid Win32 application


I would like to ask how to get rid of the error , and secondly I am running from a window 7 environment so I guess I am running from a 64 bits machine, not win32 application as it stated.

Thanks so much in advance.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4163
    
    3

Aren't .sh files Linux shell scripts?

edit This may help: How to write a wsgen script for Windows


luck, db
There are no new questions, but there may be new answers.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 9939
    
    6

Darryl Burke wrote:Aren't .sh files Linux shell scripts?

not necessarily Linux...I believe this is the extension commonly used by any bash shell - Linux or Unix.


Never ascribe to malice that which can be adequately explained by stupidity.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4163
    
    3

fred rosenberger wrote:
Darryl Burke wrote:Aren't .sh files Linux shell scripts?

not necessarily Linux...I believe this is the extension commonly used by any bash shell - Linux or Unix.

Ah right ... I should have spelled that *n?x.

But minhdung tran reports the error as (emphasis added)
%1 is not a valid Win32 application
Ivan Jozsef Balazs
Ranch Hand

Joined: May 22, 2012
Posts: 380
A shell script is an executable under neither Windows nor Unix/Linux.
It can be used along with the interpreting shell:


 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: problem with running a shell script from Java program
 
Similar Threads
Set environment variable of UNIX by java program
Help needed with in executing a UNIX script from Java
Executing a .bat file using Java
getRuntime question
Compile and create instance of a new java program from existing java program