Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Advanced Scripting Environment (EASE) » Importing Java package in EASE script
Importing Java package in EASE script [message #1723336] Sun, 14 February 2016 16:07 Go to next message
Lutz Wrage is currently offline Lutz WrageFriend
Messages: 135
Registered: July 2009
Senior Member
How do I import a Java package in an EASE script? It would be if I didn't have to use fully qualified names everywhere.
EASE seems to use rhino as the execution engine. However, I tried to use importPackage() but it's not recognized:

org.mozilla.javascript.EcmaError: ReferenceError: "importPackage" is not defined.
	at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3687)
	at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3665)
	at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3750)
	at org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:2176)
	at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:61)
	at org.mozilla.javascript.gen.unnamed_script_49._c_script_0(Unknown Source)
	at org.mozilla.javascript.gen.unnamed_script_49.call(Unknown Source)
	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
	at org.mozilla.javascript.gen.unnamed_script_49.call(Unknown Source)
	at org.mozilla.javascript.gen.unnamed_script_49.exec(Unknown Source)
	at org.mozilla.javascript.Context.evaluateReader(Context.java:1110)
	at org.eclipse.ease.lang.javascript.rhino.RhinoScriptEngine.internalExecute(RhinoScriptEngine.java:181)
	at org.eclipse.ease.lang.javascript.rhino.RhinoScriptEngine.execute(RhinoScriptEngine.java:162)
	at org.eclipse.ease.AbstractScriptEngine.inject(AbstractScriptEngine.java:182)
	at org.eclipse.ease.AbstractScriptEngine.run(AbstractScriptEngine.java:230)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Re: Importing Java package in EASE script [message #1723341 is a reply to message #1723336] Sun, 14 February 2016 19:57 Go to previous message
Christian Pontesegger is currently offline Christian PonteseggerFriend
Messages: 197
Registered: July 2009
Location: Graz, Austria
Senior Member
Hi Lutz,

I guess you are using the 0.2.0 release or some older nightly build. The current nightly version does support importPackage:
importPackage(java.io)
	[null]
new File("/")
	/
Previous Topic:Use script to automate UI actions
Next Topic:Need help to create script module for Groovy
Goto Forum:
  


Current Time: Fri Oct 19 15:03:51 GMT 2018

Powered by FUDForum. Page generated in 0.02364 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top