cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amol Khanolkar (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Deleted] (CASSANDRA-7430) generate-eclipse-files target on JDK 8 causes ReferenceError: "importClass" is not defined
Date Tue, 05 Aug 2014 23:01:13 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-7430?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Amol Khanolkar updated CASSANDRA-7430:
--------------------------------------

    Comment: was deleted

(was: Added fix So that source code builds and imports into eclipse java 8 onwards)

> generate-eclipse-files target on JDK 8 causes ReferenceError: "importClass" is not defined
> ------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-7430
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7430
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: java version "1.8.0_05"
> Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
> Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
>            Reporter: Kirk True
>            Priority: Trivial
>             Fix For: 2.1.1, 3.0
>
>         Attachments: 7430-v2.txt, 7430.txt
>
>
> If I run {{ant generate-eclipse-files}} under JDK 8, I get this error:
> {noformat}
> BUILD FAILED
> /Users/kirk/dev/cassandra/build.xml:1449: javax.script.ScriptException: ReferenceError:
"importClass" is not defined in <eval> at line number 2
> 	at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:564)
> 	at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:548)
> 	at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:528)
> 	at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:524)
> 	at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:194)
> 	at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:483)
> 	at org.apache.tools.ant.util.ReflectUtil.invoke(ReflectUtil.java:108)
> 	at org.apache.tools.ant.util.ReflectWrapper.invoke(ReflectWrapper.java:81)
> 	at org.apache.tools.ant.util.optional.JavaxScriptRunner.evaluateScript(JavaxScriptRunner.java:103)
> 	at org.apache.tools.ant.util.optional.JavaxScriptRunner.executeScript(JavaxScriptRunner.java:67)
> 	at org.apache.tools.ant.taskdefs.optional.Script.execute(Script.java:52)
> 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
> 	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:483)
> 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
> 	at org.apache.tools.ant.Task.perform(Task.java:348)
> 	at org.apache.tools.ant.Target.execute(Target.java:435)
> 	at org.apache.tools.ant.Target.performTasks(Target.java:456)
> 	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
> 	at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
> 	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
> 	at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
> 	at org.apache.tools.ant.Main.runBuild(Main.java:851)
> 	at org.apache.tools.ant.Main.startAnt(Main.java:235)
> 	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
> 	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
> Caused by: <eval>:2 ReferenceError: "importClass" is not defined
> 	at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:56)
> 	at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:318)
> 	at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:290)
> 	at jdk.nashorn.api.scripting.NashornScriptEngine.__noSuchProperty__(NashornScriptEngine.java:274)
> 	at jdk.nashorn.internal.scripts.Script$engine._L35(nashorn:engine/resources/engine.js:37)
> 	at jdk.nashorn.internal.scripts.Script$\^eval\_.runScript(<eval>:2)
> 	at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:498)
> 	at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:206)
> 	at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:378)
> 	at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:546)
> 	... 29 more
> {noformat}
> Apparently this is due to changes with the new Nashorn ECMAScript engine in the new JDK.
> According to http://stackoverflow.com/questions/22503100/java-8-javascript-engine-backwards-compatibility,
one way to solve this is thusly:
> {noformat}
> diff --git a/build.xml b/build.xml
> index 02e1f98..245ca8e 100644
> --- a/build.xml
> +++ b/build.xml
> @@ -1447,7 +1447,7 @@
>         </path>
>         <property name="eclipse-project-libs" refid="eclipse-project-libs-path"/>
>         <script language="javascript"> <![CDATA[
> -               importClass(java.io.File);
> +               var File = java.io.File;
>                 jars = project.getProperty("eclipse-project-libs").split(project.getProperty("path.separator"));
>                 
>                 cp = "";
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message