Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

200
Visualizações
javafx fxml: page language not specified - JavaScript seems not to be supported

The FXMLLoader does not recognize the <?language javascript?> directive when trying to process an fxml script (see below). The error message is "Page language not specified". My fxml is like follows (actual code ommitted for brevity):

<?language javascript?>

<!-- differnet includes -->
...

<!-- actual fxml -->
<StackPane xmlns="http://javafx.com/javafx"
           xmlns:fx="http://javafx.com/fxml"
           fx:controller="com.xxx.xxx.MainViewController"
           prefWidth="1200">

...

    <!-- somewhere in the middle of the fxml code -->
    <fx:script>
        function clearTool1() {
            tool1.setValue(null);
        }
    </fx:script>

...

<StackPane/>

I have investigated a bit and found out that the ScriptEngineManager class of javafx actually does not see any script engines. In particular, in its getEngineByName method, the collection of ScriptEngineFactory is empty, so it does not find any javascript engine and throws the exception later on. I will not go into details on this since the goal is not to debug javafx source code but I thought it could be useful as a hint.

Do you have any idea why the scripting language directive is not recognized although the fxml and everything else is written correctly?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Of course, you have to include the scripting engine implementation into your pom...

<dependency>
    <groupId>org.openjdk.nashorn</groudId>
    <artifactId>nashorn-core</artifactId>
    <version>15.0</version>
</dependency>

Thanks to @Pointy and @James_D for giving a hint regarding that.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda