Reputation: 762
ExecuteScript processor supports many languages as of now, Python;Groovy;clojure;Lua etc.
Why does it not allow me to write some custom code in java?
Upvotes: 0
Views: 753
Reputation: 12103
In addition to the other answers, we could add a Java "scripting engine" based on Janino but it has quite a few limitations that make it less attractive than just using Groovy. There are some differences between Groovy and Java (array initialization, and until Groovy 3, Java lambdas), but as the other folks said, it's pretty close.
Having said that, once NiFi requires Java 9+, I'm going to look into adding Java as a scripting language using the JShell REPL stuff in Java 9.
Upvotes: 1
Reputation: 14194
In general, Java is not a "scripting" language. You can read more about enabling scripting language access to the JVM in JSR-223. As daggett pointed out, you can write code in pure Java and select the Groovy option, and this will compile the code to the same JVM bytecode.
Upvotes: 0