Hi I have developed a swing application using javafx
on Windows operating system . It's working fine on Windows. But when I run the jar on Linux it's defaulting to opening in the archive manager, it's not working as an executable.
I have checked the properties of the jar file, it's an executable already.
Do I have to recompile the source file in a Linux environment to run this jar file
on Linux or will the jar file
work on Linux also?
If you've not used an operating system dependent commands like running a windows command from java (which will not run in linux for sure) or using a windows specific module, your java will run in all other operating systems. This is one of the most significant features of java which is cross-platform and you can run your code in different operating systems which has that operating system specific java runtime environment installed.
So in all operating systems, just you have to run
java -jar yourjarfile.jar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With