Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calabash in directory with spaces in path #11

Closed
mabromuela88 opened this issue Nov 9, 2021 · 10 comments
Closed

Calabash in directory with spaces in path #11

mabromuela88 opened this issue Nov 9, 2021 · 10 comments

Comments

@mabromuela88
Copy link

mabromuela88 commented Nov 9, 2021

Why do calabash fails when there is a space in its directory path where it resides? It throws 'Could not find or load main class' and ClassNotFoundException.

@gimsieke
Copy link
Contributor

gimsieke commented Nov 9, 2021

How do you invoke it? There are some related issues, for example transpect/docx2tex#81, but they seem to be solved already.

@mabromuela88
Copy link
Author

I invoke it through an automating script written in Java. I use Windows OS hence run the calabash.bat file. Here is the code snippet:

ProcessBuilder pb1 = new ProcessBuilder("cmd.exe", "/c", "calabash\\calabash.bat -o result=\"/" + outputTexPath + ".tex\" -i source=\"/" + inputFile + ".xml\" -i conf=\"/" + confFile + ".xml\" xml2tex/xpl/xml2tex.xpl");
pb1.redirectErrorStream(true);

@gimsieke
Copy link
Contributor

gimsieke commented Nov 9, 2021

I can reproduce it with calabash.bat in a space-containing directory

@gimsieke
Copy link
Contributor

gimsieke commented Nov 9, 2021

Which branch of https://github.com/transpect/calabash-frontend/ are you using? I see that the necessary fix, that is, quotation marks around %classpath%, is already present in https://github.com/transpect/calabash-frontend/blob/master/calabash.bat#L42

@mabromuela88
Copy link
Author

I am using calabash.bat from the one I cloned from xml2tex repo

@gimsieke
Copy link
Contributor

gimsieke commented Nov 9, 2021

xml2tex doesn’t ship with calabash, docx2tex does. Well, you can edit whatever calabash.bat that you have there and replace %classpath% with "%classpath%".

@mabromuela88
Copy link
Author

If I change %classpath% with "%classpath%" I get

Only options can occur on the command line after the pipeline document.
Usage: com.xmlcalabash.drivers.Main [switches/options] [pipeline.xpl] [options]
   or: com.xmlcalabash.drivers.Main [switches/options] { [inputs/parameters] ste
p [options] }+

@gimsieke
Copy link
Contributor

Hmm. Maybe you need to insert more " characters. Try it in the following line (line 31 in the calabash.bat that I’m looking at):

@set config="%scriptdir%extensions/transpect/transpect-config.xml"

gimsieke added a commit to transpect/calabash-frontend that referenced this issue Nov 11, 2021
gimsieke added a commit to transpect/calabash-frontend that referenced this issue Nov 11, 2021
@mabromuela88
Copy link
Author

It worked!!!

@gimsieke
Copy link
Contributor

Excellent. Thank you for reporting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants