You cannot strictly do this (creating a single installer / executable file) in a common cross-platform way, since different platforms use different executable formats. The JVM relies on having a platform-specific JVM installed on the target computer; if it is not installed, your JAR will not start unless you install the JVM in a platform-specific way. Perhaps more importantly, any third-party Python packages that rely on binary extensions will not work well with Jython unless specifically released in a version of Jython, which is unusual. (I believe that a similar situation exists for Ruby packages, although I do not have direct knowledge there, and not even as binary extensions are usually used for Ruby packages ...). You can use the full range of Java libraries, but very little in the way of Python / Ruby libraries. It is also worth noting that JVM language versions tend to lag behind the standard version, offering fewer language features and less frequent fixes.
If your code is pure Python, then it is already cross-platform, if Python is already installed on the destination machine, just like Java ... but, at least on Windows, it is much less safe to assume that Python is installed than to assume that java is installed. Third-party elements (database, etc.) are also likely to be binary for the platform. User expectations regarding how reasonable the installation process varies greatly across platforms - if your application uses third-party libraries or tools, you should enable them all for Windows users, but * nix users are more likely to download dependencies. (However, expectations for being automatically processed by the package manager are growing ...)
Indeed, if this is a large application stack, and you want to have a removal package that can be deployed on almost any server, the easiest way is probably to distribute it as a complete virtual virtual VMWare machine - free software for the player (at least for Windows and * nix, but I suppose for Mac), and this allows you to create a special Linux / BSD system that is already fully configured specifically for your application. (I say Linux / BSD, because then you do not need to worry about paying for OS licenses ...)
(If this is a smaller application that you want to allow to run on an existing client web server, then I suspect that compatibility with multiple operating systems will be less of a concern than cross-server compatibility - while Apache has a Windows version, the vast majority Windows web servers run IIS, and having a single distribution (or even one version of your application) that works well with both web servers is likely to be impractical.)
source share