I've been encountering a problem with cygwin where I cannot run a jar file with an error that the file cannot be found.
If it were easier i would "translate" the java source in bash, but unfortunately, due to the functionality implemented, there are some quite significant obstacles to achieve this, so I'd have to use the jar file.
Now, I've done a fair amount of research on my part to figure out how to do this, however, I couldn't succeed, and it is mandatory that i use cygwin.
Here's what I'm trying to essentially do:
lockfile="$specialfolder/$passedargument.lock
java -jar `cygpath -w ./cygdrive/driveletter/folder/folder/javafile.jar -joption cygpath -w $lockfile`
i also tried with double back-ticks, as follows:
pathtooutfile="${some_other_vars}/${that}_${work}.out"
java -jar `cygpath -w ./cygdrive/driveletter/folder/folder/javafile.jar` -joption `cygpath -w $lockfile`
i also tried using the $JAVA_HOME env var but that did not work as well. It is important to mention that the variables being called in lockfile var are defined as follows:
homedir= "/cygdrive/driveletter/folder/folder"
specialfolder= "$homedir/foler/$passedargument"
passedargument= $1 ###argument passed with execution of bash script
lockfile= "$specialfolder/$passedargument"
The error i keep getting is this: Error: Unable to access jarfile I have modified usage rights to 777 and that didn't work either. It might also be important to mention that -joption is either -aquire or -release corresponding to the lockfile since one of the things the jar does is manage multiple script executions through a lock file. I'm somewhat stuck so, any suggestions will be greatly appreciated. I think that this might be more of a cygwin issue.
cygpath -w ./cygdrive/driveletter/folder/folder/javafile.jar
return if you run it on its own. (Please add the output to your question, not as a comment).cygpath -w ./cygdrive/driveletter/folder/folder/javafile.jar
on its own, with nothing else, gives you that error? Can you copy and paste you typing that command in and the output? In the question. You are usingc
ord
(or something) in place ofdriveletter
, rather than the worddriveletter
?cygpath
myself in plenty of situations, but since we don't know what it's outputting in your instance, we can't help).