0

Possible Duplicate:
Python: How can execute a jar file through a python script

I have already made a executable jar file in java - Blender.jar, but I don't understand why it doesn't run. I am thinking that the problem is the VM argument that I should add. I tried to do this

import os
        if __name__ == "__main__":
    os.system("java -jar Blender.jar [-Djava.ext.dirs=lib:lib/macosx]")

or

import subprocess
subprocess.call(['java', '-jar', 'Blender.jar'])

although in the second I don't know where I should place the VM arguments.

Could anyone be very kind and help me? Is there any site that I could look at?

Although, the code has no mistakes, when I try to execute it from terminal it gives me this answer

Exception in thread "main" java.lang.SecurityException: sealing violation: package javax.media.j3d is sealed
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:234)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at com.eteks.sweethome3d.j3d.Component3DManager.setRenderingErrorObserver(Component3DManager.java:104)
    at com.eteks.sweethome3d.SweetHome3D.addComponent3DRenderingErrorObserver(SweetHome3D.java:491)
    at com.eteks.sweethome3d.SweetHome3D.init(SweetHome3D.java:383)
    at com.eteks.sweethome3d.Blender.main(Blender.java:181)
Community
  • 1
  • 1
Dimitra Micha
  • 2,089
  • 8
  • 27
  • 31
  • Why the [] brackets? Those aren't right. – bmargulies Sep 11 '11 at 15:40
  • Thanks, but it still doesn't run. Should I keep the "-" before Djava.ext (etc)? As for the second way, do you know where I should write the arguments? – Dimitra Micha Sep 11 '11 at 15:50
  • Does it work outside of python? – bmargulies Sep 11 '11 at 16:28
  • I thought that it would be executed from command line, but when I tried it, It gave me this mistakes. You were right, there is smth wrong with the jar file, although it runs through eclipse. – Dimitra Micha Sep 11 '11 at 16:36
  • OK, so, you're trying to add code to a package that someone has gone to a lot of trouble to prevent you from adding code to (javax.media.j3d). I think perhaps you should close down this question and write up another one that carefully presents the situation with Blender.jar. – bmargulies Sep 11 '11 at 18:30

0 Answers0