In my Java application a small put important feature is to be able to rename audio files based on their metadata (e.g album/artist -title) and the mask is specified using Javascript, this makes for a very flexible and powerful renaming feature.
I knew Javascript was being deprecated but it now seems it is actually going to be removed from Java 15 onwards. This loss of functionality could be a major problem for me so I ask even if it is officially removed is there a way I can continue to use Javascript within a Java 15 application, i.e will it be available as an opensrc plugin that I can use at my own risk. The fact that development has stopped at Ecmascript 5.1 is not a major issue for me.
There was mention of using GraalVM but without explanation how to do this and I don't see that fits in with my scenario, specifically my application is available on some 32bit Arm environments and GraalVM is not available for 32bit.
I have already moved from Java 11 to Java 14 to resolve some other issues, so I cannot really go back to Java 11, and since Java 14 is not a LTS release I cannot really stick with Java 14 over long period of time.
This is the bulk of my Javascript code
try
{
mask = includeUserDefinedFunctions(mask);
ScriptEngine engine = manager.getEngineByName("JavaScript");
for(SongFieldName next:SongFieldName.values())
{
if(next.getScriptVar()!=null && next.getSongFieldKey()!=null)
{
engine.put(next.getScriptVar(), cleanValue(song.getFieldValueSpaceSeparatedOrEmptyString(next.getSongFieldKey()), song));
}
}
String result = (String)engine.eval(mask);
return result;
}
catch(ScriptException se)
{
throw se;
}