class MRectanglePoint not public for WindowsXP compile

User 953c0d67b0

01-12-2006 20:46:27

We are currently using jchem 3.2.1 (file: jchem_3_2_1.tar.gz) on


our Linux machine. I downloaded/unzipped this file on a Windows


machine and tried to compile with javac, and am now getting


this error:





chemaxon.struc.graphics.MRectanglePoint is not public in


chemaxon.struc.graphics: can not be accessed from outside


package


[occurs on: import chemaxon.struc.graphics.MRectanglePoint; ]








This is one of the new classes we requested be added to JChem.





Should I use a different jchem.jar on a Windows machine?


Not sure why it compiles on Linux but not Windows. Any


suggestions??





Thanks,


Kevin at Univ of Kentucky

ChemAxon 7c2d26e5cf

01-12-2006 21:24:10

The "zip" package is dedicated to Windows. But the same files are available in the tar.gz version. Thus, it should not cause problem.


How did you try to compile? Probably, there is a conflict in CLASSPATH.

User 953c0d67b0

02-12-2006 18:30:35

I compile via command line ("DOS" batch file):





javac -cp "../../../../..;c:/class/java/jchem/lib/jchem.jar" -d "../../../../.." source.java





All the ../../... in the Paths are needed for my LOCAL directory structure:


..../java/com/prenhall/epoch/mechanisms/source is the directory of


my source, and the directory from which I compile. The .class files


end up one level up, in the .../epoch/mechanisms/*.class





Interestingly enough, the new and related class MMidPoint does NOT


get this error.





Normally this error means the keyword PUBLIC is missing from the


class definition. I confirmed this with one of my own local classes, from


a different package:





package com.prenhall.epoch.chem;


class MEFlowTool {


}





This gets the same error (MEFlowTool is not public in package, can not


be accessed from outside the package), but if I add PUBLIC:





package com.prenhall.epoch.chem;


public class MEFlowTool {


}





Then all is well.





Can you confirm that your source for the class MRectanglePoint has the


PUBLIC keyword?? I suspect MMidPoint has PUBLIC, but MRectanglePoint


does not, but I'm not sure.





Thanks,


Kevin

ChemAxon 7c2d26e5cf

04-12-2006 16:04:58

Yes, chemaxon.struc.graphics.MRectanglePoint is "public". You can also check it if you see its apidoc:


http://www.chemaxon.com/jchem/doc/api/chemaxon/struc/graphics/MRectanglePoint.html


Before Marvin 4.1 (/JChem 3.2), this class was "protected".


Probably an old MarvinBeans.jar or jchem.jar is in your system CLASSPATH.


Your compiler might import the old version instead of new one.

User 953c0d67b0

04-12-2006 17:13:14

OK, it is fixed!





I removed all old jchem.jar files from my machine (though I didn't


do anything to the classpath) and now it works. Still not sure where


it was picking up an old .jar, but that seems to have been the problem.





Thanks for the tip!





Kevin