glencoesoftware / bioformats2raw

Bio-Formats image file format to raw format converter
GNU General Public License v2.0
81 stars 35 forks source link

The input line is too long. The syntax of the command is incorrect. #14

Closed camlloyd closed 1 year ago

camlloyd commented 4 years ago

Trying to run bioformats2raw on Windows 10 produces the following error:

The input line is too long.
The syntax of the command is incorrect.

Without digging into Gradle, a workaround is to change the long CLASSPATH variable after building the bioformats2raw.bat file from:

set CLASSPATH=%APP_HOME%\lib\bioformats2raw-0.2.0-SNAPSHOT.jar;%APP_HOME%\lib\formats-gpl-6.2.1.jar;%APP_HOME%\lib\picocli-3.9.6.jar;%APP_HOME%\lib\n5-blosc-1.0.0.jar;%APP_HOME%\lib\n5-2.1.2.jar;%APP_HOME%\lib\formats-bsd-6.2.1.jar;%APP_HOME%\lib\formats-api-6.2.1.jar;%APP_HOME%\lib\ome-xml-6.0.1.jar;%APP_HOME%\lib\metakit-5.3.2.jar;%APP_HOME%\lib\ome-poi-5.3.3.jar;%APP_HOME%\lib\ome-codecs-0.2.5.jar;%APP_HOME%\lib\ome-common-6.0.3.jar;%APP_HOME%\lib\ome-mdbtools-5.3.2.jar;%APP_HOME%\lib\jxrlib-all-0.2.1.jar;%APP_HOME%\lib\cdm-4.6.13.jar;%APP_HOME%\lib\logback-classic-1.1.1.jar;%APP_HOME%\lib\native-lib-loader-2.1.4.jar;%APP_HOME%\lib\httpservices-4.6.13.jar;%APP_HOME%\lib\slf4j-api-1.7.22.jar;%APP_HOME%\lib\JWlz-1.4.0.jar;%APP_HOME%\lib\minio-5.0.2.jar;%APP_HOME%\lib\joda-time-2.8.1.jar;%APP_HOME%\lib\kryo-2.24.0.jar;%APP_HOME%\lib\jhdf5-14.12.6.jar;%APP_HOME%\lib\json-20090211.jar;%APP_HOME%\lib\xz-1.8.jar;%APP_HOME%\lib\lz4-java-1.5.0.jar;%APP_HOME%\lib\gson-2.8.5.jar;%APP_HOME%\lib\scijava-common-2.77.0.jar;%APP_HOME%\lib\commons-compress-1.18.jar;%APP_HOME%\lib\jblosc-1.0.1.jar;%APP_HOME%\lib\commons-io-2.6.jar;%APP_HOME%\lib\guava-27.1-jre.jar;%APP_HOME%\lib\logback-core-1.1.1.jar;%APP_HOME%\lib\xalan-2.7.2.jar;%APP_HOME%\lib\serializer-2.7.2.jar;%APP_HOME%\lib\specification-6.0.1.jar;%APP_HOME%\lib\turbojpeg-6.2.1.jar;%APP_HOME%\lib\jgoodies-forms-1.7.2.jar;%APP_HOME%\lib\perf4j-0.9.16.jar;%APP_HOME%\lib\metadata-extractor-2.11.0.jar;%APP_HOME%\lib\xercesImpl-2.8.1.jar;%APP_HOME%\lib\httpmime-4.5.1.jar;%APP_HOME%\lib\google-http-client-xml-1.20.0.jar;%APP_HOME%\lib\google-http-client-1.20.0.jar;%APP_HOME%\lib\httpclient-4.5.1.jar;%APP_HOME%\lib\commons-logging-1.2.jar;%APP_HOME%\lib\c3p0-0.9.5.3.jar;%APP_HOME%\lib\jackson-databind-2.9.8.jar;%APP_HOME%\lib\jackson-core-2.9.8.jar;%APP_HOME%\lib\jackson-annotations-2.9.8.jar;%APP_HOME%\lib\minlog-1.2.jar;%APP_HOME%\lib\objenesis-2.1.jar;%APP_HOME%\lib\commons-lang-2.4.jar;%APP_HOME%\lib\parsington-1.0.3.jar;%APP_HOME%\lib\eventbus-1.4.jar;%APP_HOME%\lib\junit-4.12.jar;%APP_HOME%\lib\jna-4.2.2.jar;%APP_HOME%\lib\okhttp-3.7.0.jar;%APP_HOME%\lib\okio-1.12.0.jar;%APP_HOME%\lib\failureaccess-1.0.1.jar;%APP_HOME%\lib\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;%APP_HOME%\lib\jsr305-3.0.2.jar;%APP_HOME%\lib\checker-qual-2.5.2.jar;%APP_HOME%\lib\error_prone_annotations-2.2.0.jar;%APP_HOME%\lib\j2objc-annotations-1.1.jar;%APP_HOME%\lib\animal-sniffer-annotations-1.17.jar;%APP_HOME%\lib\xml-apis-1.3.04.jar;%APP_HOME%\lib\ome-jai-0.1.0.jar;%APP_HOME%\lib\jgoodies-common-1.7.0.jar;%APP_HOME%\lib\xmpcore-5.1.3.jar;%APP_HOME%\lib\mchange-commons-java-0.2.15.jar;%APP_HOME%\lib\hamcrest-core-1.3.jar;%APP_HOME%\lib\xpp3-1.1.4c.jar;%APP_HOME%\lib\commons-codec-1.9.jar;%APP_HOME%\lib\httpcore-4.4.3.jar

to a wildcard, since it exceeds the limit of 2047 characters for Windows NT(?):

set CLASSPATH=%APP_HOME%\lib\*
melissalinkert commented 4 years ago

Thanks for reporting this, @camlloyd. The CLASSPATH length does seem to be a known issue with Gradle, see https://github.com/gradle/gradle/issues/1989.

The length of the APP_HOME folder name is important. I couldn't immediately reproduce the issue when running .\bin\bioformats2raw.bat from a folder with a 70 character name. Switching to a folder with an 82 character name results in the The input line is too long error.

If renaming/shortening the path name is an option, that's probably the easier immediate work-around since it won't require changing bioformats2raw.bat after every build.

camlloyd commented 4 years ago

Thanks @melissalinkert!

jburel commented 1 year ago

See https://github.com/ome/conda-raw2ometiff/pull/9 for conda (similar for bioformats2raw)

sbesson commented 1 year ago

From a quick search, it looks like a workaround currently used elsewhere is to patch these lines within the startScripts section of the Gradle build script https://github.com/search?q=CLASSPATH+winFileText&type=code

Possibly something worth trying out for an upcoming bioformats2raw/raw2ometiff release