Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOException:cannot run program:CreateProcess error=193,%1 is not a valid Win32 application

I am trying to run a shell script that runs in MinGW32. Then I get the following error:

Caused by:

java.io.IOException: Cannot run program "./myJooqGeneratorDB.sh", (in directory "C:\Users\admin\desktop\workspace\myProject") CreateProcess error = 193, %1 is not a valid win32 application.

My build.gradle:

task createDb(type:Exec) {
workingDir("${project.projectDir}");
commandLine './jooq/myJooqGeneratorDb.sh'
}  

My myJooqGeneratorDb.sh:

#!/bin/bash
rm build/project.db
mkdir build
sqlite3 build/project.db < res/raw/project_create.sql

Does someone know what it's wrong in my code?. Thanks in advance!

like image 456
IrApp Avatar asked Oct 19 '22 22:10

IrApp


1 Answers

I just fixed the problem. Instead of :

commandLine './jooq/myJooqGeneratorDb.sh'

is

commandLine 'sh' , './jooq/myJooqGeneratorDb.sh'
like image 56
IrApp Avatar answered Oct 27 '22 17:10

IrApp