aspose file tools*
The moose likes Java in General and the fly likes Pre-compiling a script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Pre-compiling a script" Watch "Pre-compiling a script" New topic
Author

Pre-compiling a script

Vinicius Souza
Ranch Hand

Joined: May 18, 2011
Posts: 58

Im creating a program where I need to execute the same script continuously so I was wondering if I can pre compile it ? My code below
package com.xcreator;


Thanks in advance!


Java is the best (I love C too) heehhh
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1821
    
    7

You can compile a script at runtime if the ScriptEngine implements the Compilable interface.
If so, you can cast it to Compilable and invoke either of the compile() methods to obtain a CompiledScript instance, which you can then re-use as often as you like.


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pre-compiling a script