JChemPaint / jchempaint

Chemical 2D structure editor application/applet based on the Chemistry Development Kit
http://jchempaint.github.com
110 stars 34 forks source link

copy/paste not working on MacOS #194

Closed mkrompiec closed 2 years ago

mkrompiec commented 2 years ago

Copy/paste isn't working for me, even within the same JChemPaint window. I get an InvalidSmilesException, regardless of what I'm trying to copy/paste. I'm using openjdk 17 2021-09-14 on MacOS 11.6. jchempaint_error .

johnmay commented 2 years ago

What did you try and copy-paste?

Note this project is not currently maintained so if it is an error is unlikely to be fixed.

mkrompiec commented 2 years ago

Simple chemical structures: benzene, ethane... Tried a few different molecules to make sure the error is not caused by a specific one.

johnmay commented 2 years ago

Yes but from SMILES, MOLfile or just in the GUI between programs?

mkrompiec commented 2 years ago

In the JChemPaint GUI window. I drew a molecule, selected it, then Edit-Copy and Edit-Paste. Pasting of SMILES (copied from a text editor) works fine, though. But a closer inspection shows that Copy from the GUI throws an exception: "Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError: superclass access check failed: class nu.xom.JDK15XML1_0Parser (in unnamed module @0xef9296d) cannot access class com.sun.org.apache.xerces.internal.parsers.SAXParser (in module java.xml) because module java.xml does not export com.sun.org.apache.xerces.internal.parsers to unnamed module @0xef9296d " I'd be grateful for any suggestions on how to fix this...

mkrompiec commented 2 years ago

Solved: java --add-opens java.xml/com.sun.org.apache.xerces.internal.parsers=ALL-UNNAMED --add-opens java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED -jar jchempaint-3.3-1210.jar

johnmay commented 2 years ago

Where you using JDK 15? JDK 8, 11, and now 17 are the stable. More recent java versions are removing older APIs and restrict reflective access. Rebuilding with the target JVM would work but using JDK 8 it should function fine.

mkrompiec commented 2 years ago

I’m using OpenJDK 17

johnmay commented 2 years ago

OK. Be warned other bits might randomly not work

edit: we -> be