Transcrypt 自动测试编译失败,显然是在缩小步骤
Transcrypt autotest compilation fails, apparently at minification step
刚刚安装了transcrypt。自动测试编译成功但在缩小时失败。我尝试更新到 JRE 8,但出现同样的错误。有什么让它发挥作用的建议吗?
谢谢!
$ uname -a
Darwin Michaels-Mac-mini 15.6.0 Darwin Kernel Version 15.6.0: Mon Jan 9 23:07:29 PST 2017; root:xnu-3248.60.11.2.1~1/RELEASE_X86_64 x86_64
$ python --version
Python 3.5.1 :: Anaconda 4.0.0 (x86_64)
$ transcrypt -h
Transcrypt (TM) Python to JavaScript Small Sane Subset Transpiler Version 3.6.24
Copyright (C) Geatec Engineering. License: Apache 2.0
$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468-11M4833)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)
$ transcrypt -b autotest.py
Transcrypt (TM) Python to JavaScript Small Sane Subset Transpiler Version 3.6.24
Copyright (C) Geatec Engineering. License: Apache 2.0
Saving result in: /Users/mellis/anaconda3/lib/python3.5/site-packages/transcrypt/development/automated_tests/transcrypt/__javascript__/autotest.js
Saving minified result in: /Users/mellis/anaconda3/lib/python3.5/site-packages/transcrypt/development/automated_tests/transcrypt/__javascript__/autotest.min.js
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/javascript/jscomp/CommandLineRunner : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access[=10=]0(URLClassLoader.java:58)
at java.net.URLClassLoader.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)
Ready
从您的控制台输出看来,虽然您安装了 JRE 8,但您的系统仍在使用 JRE 6:
$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468-11M4833)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)
由于您使用的是 Apple,因此应该有一个 "system preferences" 对话框。一旦您的机器上有多个版本的 JRE,此对话框中应该有一个项目允许您更改 Java 的设置,包括它将默认为哪个版本。
另请参阅:
java.lang.UnsupportedClassVersionError
您也可以通过命令行更改这些设置,请参阅:
How to set or change the default Java (JDK) version on OS X?
刚刚安装了transcrypt。自动测试编译成功但在缩小时失败。我尝试更新到 JRE 8,但出现同样的错误。有什么让它发挥作用的建议吗?
谢谢!
$ uname -a
Darwin Michaels-Mac-mini 15.6.0 Darwin Kernel Version 15.6.0: Mon Jan 9 23:07:29 PST 2017; root:xnu-3248.60.11.2.1~1/RELEASE_X86_64 x86_64
$ python --version
Python 3.5.1 :: Anaconda 4.0.0 (x86_64)
$ transcrypt -h
Transcrypt (TM) Python to JavaScript Small Sane Subset Transpiler Version 3.6.24
Copyright (C) Geatec Engineering. License: Apache 2.0
$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468-11M4833)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)
$ transcrypt -b autotest.py
Transcrypt (TM) Python to JavaScript Small Sane Subset Transpiler Version 3.6.24
Copyright (C) Geatec Engineering. License: Apache 2.0
Saving result in: /Users/mellis/anaconda3/lib/python3.5/site-packages/transcrypt/development/automated_tests/transcrypt/__javascript__/autotest.js
Saving minified result in: /Users/mellis/anaconda3/lib/python3.5/site-packages/transcrypt/development/automated_tests/transcrypt/__javascript__/autotest.min.js
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/javascript/jscomp/CommandLineRunner : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access[=10=]0(URLClassLoader.java:58)
at java.net.URLClassLoader.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)
Ready
从您的控制台输出看来,虽然您安装了 JRE 8,但您的系统仍在使用 JRE 6:
$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468-11M4833)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)
由于您使用的是 Apple,因此应该有一个 "system preferences" 对话框。一旦您的机器上有多个版本的 JRE,此对话框中应该有一个项目允许您更改 Java 的设置,包括它将默认为哪个版本。
另请参阅:
java.lang.UnsupportedClassVersionError
您也可以通过命令行更改这些设置,请参阅:
How to set or change the default Java (JDK) version on OS X?