Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4564750
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:32:43+00:00 2026-05-21T18:32:43+00:00

I am trying to make my JavaFX app compile into a WAR file for

  • 0

I am trying to make my JavaFX app compile into a WAR file for deployment on a Jetty server, using Maven. The problem, as I see it, is with the javascript in my webapp’s index.html:

<script>
    javafx(
        {
              draggable: true,
              width: 600,
              height: 290,
              code: "my.app.package.MyApp",
              name: "MyApp",
              id: "app"
        }
    );
</script>

Of course, JavaScript throws an error, because it’s missing the ‘archive’ parameter where I am supposed to put the name of the jar file I’m loading this from. But that’s the problem, there is no jar. This is a war with .class files in ‘WEB-INF/classes/’ and not in a jar. There doesn’t seem to be much documentation on how to do this.

My concern is that this is unsupported behavior. An annoying alternative is to change the build type to ‘jar’, build it, change the build type back to ‘war’, build it, and put the jar in the war by hand every time. I suppose that would be alright if I could find an automated way of doing that, but I wouldn’t know how to go all INCEPTION on the build process or if that’s even a good idea to try.

Thanks for any ideas!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T18:32:44+00:00Added an answer on May 21, 2026 at 6:32 pm

    The solution I came to was to build the JavaFX app using an ant task (as it was a NetBeans project anyway) and including the resulting jar in the war by using this configuration for the maven-war-plugin:

    <configuration>
      <webResources>
        <!-- Include the jar build inside the war -->
        <resource>
          <directory>dist</directory>
          <includes>
            <include>MyJavaFXApp.jar</include>
          </includes>
        </resource>
      </webResources>
    </configuration>
    

    For those looking for a pure-maven solution, instead of an ant task, I was also able to use the maven-jar-plugin to specifically build a jar (the project packaging type still ‘war’) as well, which I then include with the method included above.

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>make-a-jar</id>
            <phase>compile</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I´m trying to make a custom component to javafx, so I make my class
I'm learning javafx. I'm trying to make a path, but when i instantiate the
Trying to make simple minesweeper game in python, but have one problem. I have
I'm trying to make a connection to an oracle database using the sample codes
I am trying to make connections to my database using connection pooling library: DBPool
I am trying to make a simple app that read from a midi port
I am trying to create a client server application. I am going to make
I’m trying to make a desktop application in Java SE to receive a file
i am trying to make a colored dropdown list with colored items (please see
Okay I am trying to make minecraft mods using eclipse. I used this video

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.