Blob Blame History Raw
diff -up src/sage/interfaces/jmoldata.py.orig src/sage/interfaces/jmoldata.py
--- src/sage/interfaces/jmoldata.py.orig	2022-05-15 16:11:11.000000000 -0600
+++ src/sage/interfaces/jmoldata.py	2022-07-06 11:03:43.155375965 -0600
@@ -148,8 +148,6 @@ class JmolData(SageObject):
             sage: print(os.path.exists(testfile)) # optional -- java
             True
         """
-        # Set up paths, file names and scripts
-        jmolpath = os.path.join(JMOL_DIR, "JmolData.jar")
         target_native = targetfile
 
         if sys.platform == 'cygwin':
@@ -171,12 +169,14 @@ class JmolData(SageObject):
         with open(scratchout, 'w') as jout:
             # Now call the java application and write the file.
             env = dict(os.environ)
-            env['LC_ALL'] = 'C'
-            env['LANG'] = 'C'
-            subprocess.call(["java", "-Xmx512m", "-Djava.awt.headless=true",
-                "-jar", jmolpath, "-iox", "-g", size_arg,
-                "-J", launchscript, "-j", imagescript],
-                stdout=jout, stderr=jout, env=env)
+            env['LC_ALL'] = 'C.UTF-8'
+            env['LANG'] = 'C.UTF-8'
+            try:
+                subprocess.call(["jmol", "-n", "-g", size_arg,
+                    "-J", launchscript, "-j", imagescript],
+                    timeout=300, stdout=jout, stderr=jout, env=env)
+            except:
+                pass
         if not os.path.isfile(targetfile):
             raise RuntimeError(f"Jmol failed to create file {targetfile}: {Path(scratchout).read_text()}")
         os.unlink(scratchout)