-1

I'm trying to build a JavaFX software application for windows platforms including windows XP, Vista, 7, 8, 10.

I'm using Maven as a dependancy manager to build the project.

In my application, i make use of MySQL Driver for JDBC connectivity. However, when targeting old OS such as XP, i'm obliged to use old drivers because nowdays versions of MySQL are impossible to start on XP.

I need my project to get built with MySQL 5.1.6 Driver for Windows XP platform, and MySQL 5.7 Driver for the rest of platforms.

I'm aware that i can do that by building the project 2 times and proving 2 .jar files and then 2 different .exe files, but is there any other elegant way to do that ?

Thanks in advance.

Mssm
  • 717
  • 11
  • 29
  • Does this answer your question? [Different dependencies for different build profiles](https://stackoverflow.com/questions/166895/different-dependencies-for-different-build-profiles) – Adrian Jan 14 '20 at 15:15
  • Exactly what i was looking for, but still as said Karim, have to compile 2 times, the dependancy isn't picked according to the platform. – Mssm Jan 14 '20 at 15:27

1 Answers1

1

There is no way around it because Java is precompiled, you gonna need to make an exe file Windows XP and an exe for the rest of platforms, even if you use profiles (which I highly recommend to do in this case). You gonna have to make a profile for windows XP and a profile for the rest of the platforms and you going to compile it twice.

Karim
  • 1,004
  • 8
  • 18