source: trunk/tools/ijview.bat @ 6192

Revision 6192, 1.4 KB checked in by curtis, 10 years ago (diff)

Fix classpath problem with Windows batch files.

Line 
1@echo off
2
3rem ijview.bat: a batch file for displaying an image file in ImageJ
4rem             using the Bio-Formats Importer plugin
5
6rem Required JARs: loci_tools.jar, ij.jar
7
8rem JAR libraries must be in the same directory as this
9rem command line script for the command to function.
10
11rem If you are a developer working from source and have
12rem the LOCI classes in your CLASSPATH, you can set the
13rem LOCI_DEVEL environment variable to use them instead.
14
15set PROG=loci.plugins.importer.Importer
16set DIR=%~dp0
17if "%DIR:~1%" == ":\" (
18  set DIR1=%DIR%
19) else (
20  rem Remove trailing backslash
21  set DIR1=%DIR:~0,-1%
22)
23
24if "%LOCI_DEVEL%" == "" (
25  rem Developer environment variable unset; look for proper libraries
26  if not exist "%DIR%ij.jar" goto missing
27  if exist "%DIR%loci_tools.jar" goto found
28  if exist "%DIR%bio-formats.jar" goto found
29  goto missing
30) else (
31  rem Developer environment variable set; try to launch
32  java -mx512m %PROG% %*
33  goto end
34)
35
36:found
37rem Library found; try to launch
38java -mx512m -cp "%DIR1%";"%DIR%bio-formats.jar";"%DIR%loci_tools.jar";"%DIR%ij.jar" %PROG% %*
39goto end
40
41:missing
42echo Required JAR libraries not found. Please download:
43echo   loci_tools.jar
44echo from:
45echo   http://www.loci.wisc.edu/bio-formats/downloads
46echo and:
47echo   ij.jar
48echo from:
49echo   http://rsb.info.nih.gov/ij/upgrade/
50echo and place in the same directory as the command line tools.
51
52:end
Note: See TracBrowser for help on using the repository browser.