I have java 8 installed and running on Ubuntu 22.04 LTS. How do I make (re-compile?) a Windows java app to run on Ubuntu?
@BruceJ , Welcome. This 'question' is far too vague to be able to give any reasonable response, you need to supply details. We need precise details about the app.
In principle java is 'platform independent', but that's the core language, in the 'real world' applications typically will leverage platform specifics - graphics libraries,system services,file io ...
What version of Windows ?
What version of java on Windows ?
Are you the app developer ? (or responsible for maintaining/building it on Windows)
How is the app 'made' on Windows ?
Are there windows specific components to the app (DDL, JDBC, ASYNC, Threading ...)?
I suggest you supply at a minimum the above and as much additional detail about the app, once you've done that maybe the team can field responses (and likely more questions).
tks
Have you considered using a Windows virtual machine within Ubuntu ? Definitely not my skills set, but it seems to be a fairly common methodology.
My usual approach would be just to run the Java native in Ubuntu. It won't work, but it might be a good indication of how deep and wide the problem area is likely to become.
Hmmmm
Java is designed to be platform-independent,, so this means of course that, in theory, Java applications should run on any platform where the Java Virtual Machine (JVM) is installed, both Windows and Ubuntu.
Do you have the JVM installed on both machines @BruceJ ? If so, what versions on the JVM on each machine are installed / running ?
When you solve this puzzle, think about if the app does anything which is file system dependent, like system commands and paths to commands and logs, etc.
Also, as @munkeHoller mentioned, if the application uses native libraries (e.g., DLL files on Windows), you might need to find or compile equivalent libraries for Ubuntu.
So, first I suggest you make sure you have similar versions of the JVM running on both machines, and give it a try and see what errors you get!
java -jar your_java_app.jar
After you confirm your JVMs are OK. try to run it like in the above simple example for your app and post back any errors!
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.