Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!