This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
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: 11
    
    1
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: 4523
    
    5

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: 11152
    
  16

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.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

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
Rancher

Joined: May 22, 2012
Posts: 866
    
    5
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://aspose.com/file-tools
 
subject: problem with running a shell script from Java program
 
Similar Threads
Compile and create instance of a new java program from existing java program
Set environment variable of UNIX by java program
Executing a .bat file using Java
Help needed with in executing a UNIX script from Java
getRuntime question