Using Popen() in Python 3.6.2 to open a JAVA class is failing -
this question has answer here:
this line of code in python file seems return error:
could not find or load main class testclass
testclass.java
in same folder .py
file. not sure going wrong. ideas?
process = popen(['java', 'testclass'], stdout=pipe)
edit: compiling java file worked, getting following error when trying run it. tested java file directly , worked fine, seems issue python java versions? running java 8 latest build now, , latest build of python...
exception in thread "main" java.lang.unsupportedclassversionerror: testclass : unsupported major.minor version 52.0 @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(unknown source) @ java.security.secureclassloader.defineclass(unknown source) @ java.net.urlclassloader.defineclass(unknown source) @ java.net.urlclassloader.access$100(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ sun.misc.launcher$appclassloader.loadclass(unknown source) @ java.lang.classloa`enter code here`der.loadclass(unknown source) @ sun.launcher.launcherhelper.checkandloadmain(unknown source)
your python script looking compiled .class
file, while have uncompiled .java
file.
Comments
Post a Comment