cxcalc command line--"syntax is incorrect" problem

User 6d44f00e00

09-01-2009 16:24:27


I just got the academic license for Chemaxon and I have been using Charge Plugin to calculate some partial charge. I can use the plugin through MarvinView GUI interface: Tools>Charge>Charge.

But when I tried using via command line, I got the following message.


C:\Program Files\ChemAxon\JChem\bin>cxcalc cpd1.sdf charge

The syntax of the command is incorrect.


Why is the syntax incorrect? I am using the same format that was

described. The cpd1.sdf file is in the folder, i.e., *\bin folder.

Did I miss setting up some config file for command line use?

My purpose of using command line is to get the partial charge of each atoms in a text file so that I can write a program to read through these charges and store them. Is it possible to do that?

Thank you very much,

Kyaw Myint

ChemAxon fa971619eb

09-01-2009 16:28:36

I just moved this topic from the IJC forum to the Structure based prediction & Chemical Terms forum as you should get the best answer there.


User 677b9c22ff

10-01-2009 02:20:43


same here using commandline with Marvin 5.1.4 using the

Windows Installer.exe and also calling setup.bat and later

added JCHEMHome and JAVA path.

cxcalc - works fine shows command


C:\chemistry\work>cxcalc C8H16O2.smi name

The syntax of the command is incorrect.



User 677b9c22ff

10-01-2009 20:41:54


the error is due to the new parameter checks in the bat file (please see also cxcacl and molconvert and others).


Use batch file from 5.1.3 or older versions.

or edit the batch file in the erroneous part:

REM check first two characters of the parameter

set pam=%1

set hpam=%pam:~0,2%

Somehow I lost my ability to debug DOS Batch files so I don't know

the answer to the second solution.


User 6d44f00e00

10-01-2009 22:18:22

I found a quick and dirty way to at least get the function to work.

Open the cxcalc.bat and replace with the following code in that file. Then save that file as a different bat file and then run it via commandline. You can replace with whatever function you'd like to use instead of 'charge'.

rem #---------------- END OF HEADER ------------------------------------

"%JVMPATH%" %JAVA_OPTS% chemaxon.marvin.Calculator cpd1.sdf charge

rem #--------------- BEGIN OF FOOTER ------------------------------------

ChemAxon 7c2d26e5cf

12-01-2009 13:48:07

Are you sure that you run that cxcalc.bat instance which is located in C:\Program Files\ChemAxon\MarvinBeans\bin directory?

The content of cxcalc.bat is a bit differ in the JChem package than the Marvin version. The quoted part presents in a JChem batch file, not in Marvin. Probably, the C:\Program Files\ChemAxon\JChem\bin folder is in the PATH and it causes the conflict. In this case, the JChem version of cxcalc will be launched in all cases. Please rename "cxcalc.bat" in the C:\Program Files\MarvinBeans\bin folder and try to run cxcalc again. If the system does not clain that it is an unknown command, it means that there is an other instance on your machine.

There is a bug in the batch files of JCham package that is similar to the reported problem. But this problem occurs only that case when -Xmx parameter is given in command line.

A quote is missing from the line 85 of each batch file (only in JChem) is:

 if "%hhpam%=="-XMX" (

(Double quatation is missing)

It should be

 if "%hhpam%"=="-XMX" (

We have fixed the mentioned bug and the next release will include the bugfix.

If you are sure that "C:\Program Files\ChemAxon\MarvinBeans\bin\cxcalc.bat" drops the error, please send your cxcalc.bat file  (in attachment) to us to be able to check it.

User 6d44f00e00

13-01-2009 00:49:17

Thanks a lot. Actually, the cxcalc in the MarvinBeans\bin folder works fine as you mentioned. I was using the one from JChem\bin folder.