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: 181
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(
	at org.mozilla.javascript.ScriptRuntime.constructError(
	at org.mozilla.javascript.ScriptRuntime.notFoundError(
	at org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(
	at org.mozilla.javascript.optimizer.OptRuntime.callName(
	at org.mozilla.javascript.gen.unnamed_script_49._c_script_0(Unknown Source)
	at Source)
	at org.mozilla.javascript.ContextFactory.doTopCall(
	at org.mozilla.javascript.ScriptRuntime.doTopCall(
	at Source)
	at org.mozilla.javascript.gen.unnamed_script_49.exec(Unknown Source)
	at org.mozilla.javascript.Context.evaluateReader(
	at org.eclipse.ease.lang.javascript.rhino.RhinoScriptEngine.internalExecute(
	at org.eclipse.ease.lang.javascript.rhino.RhinoScriptEngine.execute(
	at org.eclipse.ease.AbstractScriptEngine.inject(

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: 239
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:
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 Jan 27 07:34:16 GMT 2023

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

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

Back to the top