User 02c7249dc6
05-01-2010 17:50:02
Using the windows installer, I think the batch files have a typo that results in them ingnoring the JCHEMHOME environment variable if set. This results in class not found exceptions.
I'm on windows and use cygwin, if I don't use the windows installer and instead install the cross platform zip, the bash scrips work fine. The issue showed up when used the windows installer which only installs the bat files.
after using the windows installer, I followed the instructions on file:///C:/Program%20Files/ChemAxon/JChem/doc/admin/prepscripts.html
and set up a JCHEMHOME variable
however, the bat files were failing with class not found exceptions.
Exception in thread "main" java.lang.NoClassDefFoundError: chemaxon/marvin/View
Caused by: java.lang.ClassNotFoundException: chemaxon.marvin.View
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: chemaxon.marvin.View. Program will exit.
I looked at the bat files and they all have a fragment like:
set INSTALLDIR="@JCHEMHOM@"
if exist %INSTALLDIR%. (
set SETUPBAT="@JCHEMHOME@"
set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
GOTO AFTER_CLASSPATH
)
here, INSTALLDIR is actually set to '@JCHEMHOME@' which doesn't exist so the if block is never entered.
Instead, I updated one of the batch files to the following:
set INSTALLDIR="%JCHEMHOME%"
if exist %INSTALLDIR%. (
set SETUPBAT="%INSTALLDIR%\bin\setup.bat"
set JCHEMCLASSPATH="%INSTALLDIR%\lib\jchem.jar;%CLASSPATH%"
GOTO AFTER_CLASSPATH
)
changes:
1) use % instead of @ to resolve the variable
2) if the install dir exists setup the the SETUPBAT and JCHEMCLASSPATH relative to it.
This worked for the one batch file I tried.
I grepped the other batch files and most seemed broken
egrep -B1 -A4 'INSTALLDIR%' *
bm.bat-set INSTALLDIR="@JCHEMHOM@"
bm.bat:if exist %INSTALLDIR%. (
bm.bat- set SETUPBAT="@JCHEMHOME@"
bm.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
bm.bat- GOTO AFTER_CLASSPATH
bm.bat-)
--
compr.bat-set INSTALLDIR="@JCHEMHOM@"
compr.bat:if exist %INSTALLDIR%. (
compr.bat- set SETUPBAT="@JCHEMHOME@"
compr.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
compr.bat- GOTO AFTER_CLASSPATH
compr.bat-)
--
config.bat-set INSTALLDIR="@JCHEMHOM@"
config.bat:if exist %INSTALLDIR%. (
config.bat- set SETUPBAT="@JCHEMHOME@"
config.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
config.bat- GOTO AFTER_CLASSPATH
config.bat-)
--
count.bat-set INSTALLDIR="@JCHEMHOM@"
count.bat:if exist %INSTALLDIR%. (
count.bat- set SETUPBAT="@JCHEMHOME@"
count.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
count.bat- GOTO AFTER_CLASSPATH
count.bat-)
--
crview.bat-set INSTALLDIR="@JCHEMHOM@"
crview.bat:if exist %INSTALLDIR%. (
crview.bat- set SETUPBAT="@JCHEMHOME@"
crview.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
crview.bat- GOTO AFTER_CLASSPATH
crview.bat-)
--
cxcalc.bat-set INSTALLDIR="@JCHEMHOM@"
cxcalc.bat:if exist %INSTALLDIR%. (
cxcalc.bat- set SETUPBAT="@JCHEMHOME@"
cxcalc.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
cxcalc.bat- GOTO AFTER_CLASSPATH
cxcalc.bat-)
--
enumerate.bat-set INSTALLDIR="@JCHEMHOM@"
enumerate.bat:if exist %INSTALLDIR%. (
enumerate.bat- set SETUPBAT="@JCHEMHOME@"
enumerate.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
enumerate.bat- GOTO AFTER_CLASSPATH
enumerate.bat-)
--
evaluate.bat-set INSTALLDIR="@JCHEMHOM@"
evaluate.bat:if exist %INSTALLDIR%. (
evaluate.bat- set SETUPBAT="@JCHEMHOME@"
evaluate.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
evaluate.bat- GOTO AFTER_CLASSPATH
evaluate.bat-)
--
exampleCount.bat-set INSTALLDIR="@JCHEMHOM@"
exampleCount.bat:if exist %INSTALLDIR%. (
exampleCount.bat- set SETUPBAT="@JCHEMHOME@"
exampleCount.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
exampleCount.bat- GOTO AFTER_CLASSPATH
exampleCount.bat-)
--
fragment.bat-set INSTALLDIR="@JCHEMHOM@"
fragment.bat:if exist %INSTALLDIR%. (
fragment.bat- set SETUPBAT="@JCHEMHOME@"
fragment.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
fragment.bat- GOTO AFTER_CLASSPATH
fragment.bat-)
--
fragstat.bat-set INSTALLDIR="@JCHEMHOM@"
fragstat.bat:if exist %INSTALLDIR%. (
fragstat.bat- set SETUPBAT="@JCHEMHOME@"
fragstat.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
fragstat.bat- GOTO AFTER_CLASSPATH
fragstat.bat-)
--
generatemd.bat-set INSTALLDIR="@JCHEMHOM@"
generatemd.bat:if exist %INSTALLDIR%. (
generatemd.bat- set SETUPBAT="@JCHEMHOME@"
generatemd.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
generatemd.bat- GOTO AFTER_CLASSPATH
generatemd.bat-)
--
generfp.bat-set INSTALLDIR="@JCHEMHOM@"
generfp.bat:if exist %INSTALLDIR%. (
generfp.bat- set SETUPBAT="@JCHEMHOME@"
generfp.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
generfp.bat- GOTO AFTER_CLASSPATH
generfp.bat-)
--
hitstatistics.bat-set INSTALLDIR="@JCHEMHOM@"
hitstatistics.bat:if exist %INSTALLDIR%. (
hitstatistics.bat- set SETUPBAT="@JCHEMHOME@"
hitstatistics.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
hitstatistics.bat- GOTO AFTER_CLASSPATH
hitstatistics.bat-)
--
jarp.bat-set INSTALLDIR="@JCHEMHOM@"
jarp.bat:if exist %INSTALLDIR%. (
jarp.bat- set SETUPBAT="@JCHEMHOME@"
jarp.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
jarp.bat- GOTO AFTER_CLASSPATH
jarp.bat-)
--
jcman.bat-set INSTALLDIR="@JCHEMHOM@"
jcman.bat:if exist %INSTALLDIR%. (
jcman.bat- set SETUPBAT="@JCHEMHOME@"
jcman.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
jcman.bat- GOTO AFTER_CLASSPATH
jcman.bat-)
--
jcsearch.bat-set INSTALLDIR="@JCHEMHOM@"
jcsearch.bat:if exist %INSTALLDIR%. (
jcsearch.bat- set SETUPBAT="@JCHEMHOME@"
jcsearch.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
jcsearch.bat- GOTO AFTER_CLASSPATH
jcsearch.bat-)
--
libmcs.bat-set INSTALLDIR="@JCHEMHOM@"
libmcs.bat:if exist %INSTALLDIR%. (
libmcs.bat- set SETUPBAT="@JCHEMHOME@"
libmcs.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
libmcs.bat- GOTO AFTER_CLASSPATH
libmcs.bat-)
--
license.bat-set INSTALLDIR="@JCHEMHOM@"
license.bat:if exist %INSTALLDIR%. (
license.bat- set SETUPBAT="@JCHEMHOME@"
license.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
license.bat- GOTO AFTER_CLASSPATH
license.bat-)
--
mcs.bat-set INSTALLDIR="@JCHEMHOM@"
mcs.bat:if exist %INSTALLDIR%. (
mcs.bat- set SETUPBAT="@JCHEMHOME@"
mcs.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
mcs.bat- GOTO AFTER_CLASSPATH
mcs.bat-)
--
metabolize.bat-set INSTALLDIR="@JCHEMHOM@"
metabolize.bat:if exist %INSTALLDIR%. (
metabolize.bat- set SETUPBAT="@JCHEMHOME@"
metabolize.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
metabolize.bat- GOTO AFTER_CLASSPATH
metabolize.bat-)
--
molconvert.bat-set INSTALLDIR="@JCHEMHOM@"
molconvert.bat:if exist %INSTALLDIR%. (
molconvert.bat- set SETUPBAT="@JCHEMHOME@"
molconvert.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
molconvert.bat- GOTO AFTER_CLASSPATH
molconvert.bat-)
--
moledit.bat-set INSTALLDIR="@JCHEMHOM@"
moledit.bat:if exist %INSTALLDIR%. (
moledit.bat- set SETUPBAT="@JCHEMHOME@"
moledit.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
moledit.bat- GOTO AFTER_CLASSPATH
moledit.bat-)
--
molfragment.bat-set INSTALLDIR="@JCHEMHOM@"
molfragment.bat:if exist %INSTALLDIR%. (
molfragment.bat- set SETUPBAT="@JCHEMHOME@"
molfragment.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
molfragment.bat- GOTO AFTER_CLASSPATH
molfragment.bat-)
--
msketch.bat-set INSTALLDIR="@JCHEMHOM@"
msketch.bat:if exist %INSTALLDIR%. (
msketch.bat- set SETUPBAT="@JCHEMHOME@"
msketch.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
msketch.bat- GOTO AFTER_CLASSPATH
msketch.bat-)
--
mspace.bat-set INSTALLDIR="@JCHEMHOM@"
mspace.bat:if exist %INSTALLDIR%. (
mspace.bat- set SETUPBAT="@JCHEMHOME@"
mspace.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
mspace.bat- GOTO AFTER_CLASSPATH
mspace.bat-)
--
mview.bat-set INSTALLDIR="%JCHEMHOME%"
mview.bat:if exist %INSTALLDIR%. (
mview.bat: set SETUPBAT="%INSTALLDIR%\bin\setup.bat"
mview.bat: set JCHEMCLASSPATH="%INSTALLDIR%\lib\jchem.jar;%CLASSPATH%"
mview.bat- GOTO AFTER_CLASSPATH
mview.bat-)
mview.bat-
mview.bat-set SETUPBAT="..\bin\setup.bat"
--
nneib.bat-set INSTALLDIR="@JCHEMHOM@"
nneib.bat:if exist %INSTALLDIR%. (
nneib.bat- set SETUPBAT="@JCHEMHOME@"
nneib.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
nneib.bat- GOTO AFTER_CLASSPATH
nneib.bat-)
--
optimizemetrics.bat-set INSTALLDIR="@JCHEMHOM@"
optimizemetrics.bat:if exist %INSTALLDIR%. (
optimizemetrics.bat- set SETUPBAT="@JCHEMHOME@"
optimizemetrics.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
optimizemetrics.bat- GOTO AFTER_CLASSPATH
optimizemetrics.bat-)
--
pmapper.bat-set INSTALLDIR="@JCHEMHOM@"
pmapper.bat:if exist %INSTALLDIR%. (
pmapper.bat- set SETUPBAT="@JCHEMHOME@"
pmapper.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
pmapper.bat- GOTO AFTER_CLASSPATH
pmapper.bat-)
--
react.bat-set INSTALLDIR="@JCHEMHOM@"
react.bat:if exist %INSTALLDIR%. (
react.bat- set SETUPBAT="@JCHEMHOME@"
react.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
react.bat- GOTO AFTER_CLASSPATH
react.bat-)
--
reactionTester.bat-set INSTALLDIR="@JCHEMHOM@"
reactionTester.bat:if exist %INSTALLDIR%. (
reactionTester.bat- set SETUPBAT="@JCHEMHOME@"
reactionTester.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
reactionTester.bat- GOTO AFTER_CLASSPATH
reactionTester.bat-)
--
rgdecomp.bat-set INSTALLDIR="@JCHEMHOM@"
rgdecomp.bat:if exist %INSTALLDIR%. (
rgdecomp.bat- set SETUPBAT="@JCHEMHOME@"
rgdecomp.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
rgdecomp.bat- GOTO AFTER_CLASSPATH
rgdecomp.bat-)
--
rmap.bat-set INSTALLDIR="@JCHEMHOM@"
rmap.bat:if exist %INSTALLDIR%. (
rmap.bat- set SETUPBAT="@JCHEMHOME@"
rmap.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
rmap.bat- GOTO AFTER_CLASSPATH
rmap.bat-)
--
rtest.bat-set INSTALLDIR="@JCHEMHOM@"
rtest.bat:if exist %INSTALLDIR%. (
rtest.bat- set SETUPBAT="@JCHEMHOME@"
rtest.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
rtest.bat- GOTO AFTER_CLASSPATH
rtest.bat-)
--
screeningoptimizer.bat-set INSTALLDIR="@JCHEMHOM@"
screeningoptimizer.bat:if exist %INSTALLDIR%. (
screeningoptimizer.bat- set SETUPBAT="@JCHEMHOME@"
screeningoptimizer.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
screeningoptimizer.bat- GOTO AFTER_CLASSPATH
screeningoptimizer.bat-)
--
screenmd.bat-set INSTALLDIR="@JCHEMHOM@"
screenmd.bat:if exist %INSTALLDIR%. (
screenmd.bat- set SETUPBAT="@JCHEMHOME@"
screenmd.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
screenmd.bat- GOTO AFTER_CLASSPATH
screenmd.bat-)
--
standardize.bat-set INSTALLDIR="@JCHEMHOM@"
standardize.bat:if exist %INSTALLDIR%. (
standardize.bat- set SETUPBAT="@JCHEMHOME@"
standardize.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
standardize.bat- GOTO AFTER_CLASSPATH
standardize.bat-)
--
standedit.bat-set INSTALLDIR="@JCHEMHOM@"
standedit.bat:if exist %INSTALLDIR%. (
standedit.bat- set SETUPBAT="@JCHEMHOME@"
standedit.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
standedit.bat- GOTO AFTER_CLASSPATH
standedit.bat-)
--
toxic.bat-set INSTALLDIR="@JCHEMHOM@"
toxic.bat:if exist %INSTALLDIR%. (
toxic.bat- set SETUPBAT="@JCHEMHOME@"
toxic.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
toxic.bat- GOTO AFTER_CLASSPATH
toxic.bat-)
--
toxicView.bat-set INSTALLDIR="@JCHEMHOM@"
toxicView.bat:if exist %INSTALLDIR%. (
toxicView.bat- set SETUPBAT="@JCHEMHOME@"
toxicView.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
toxicView.bat- GOTO AFTER_CLASSPATH
toxicView.bat-)
--
toxiccalc.bat-set INSTALLDIR="@JCHEMHOM@"
toxiccalc.bat:if exist %INSTALLDIR%. (
toxiccalc.bat- set SETUPBAT="@JCHEMHOME@"
toxiccalc.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
toxiccalc.bat- GOTO AFTER_CLASSPATH
toxiccalc.bat-)
--
toxicophore.bat-set INSTALLDIR="@JCHEMHOM@"
toxicophore.bat:if exist %INSTALLDIR%. (
toxicophore.bat- set SETUPBAT="@JCHEMHOME@"
toxicophore.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
toxicophore.bat- GOTO AFTER_CLASSPATH
toxicophore.bat-)
--
ward.bat-set INSTALLDIR="@JCHEMHOM@"
ward.bat:if exist %INSTALLDIR%. (
ward.bat- set SETUPBAT="@JCHEMHOME@"
ward.bat- set JCHEMCLASSPATH="@JCHEMHOME@\lib\jchem.jar;%CLASSPATH%"
ward.bat- GOTO AFTER_CLASSPATH
ward.bat-)
Hope this is helpful.
Dan