How are Java applications deployed in the “real world”?

后端 未结 4 2140
眼角桃花
眼角桃花 2021-02-01 08:12

As a novice to the world of Java programming, this question has always boggled my mind. I first believed that all Java files were compacted into applets and then ra

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-01 08:43

    • Applets never really caught on and are very rarely used nowadays.
    • Simple applications can be deployed as "executable" JAR files , which are basically ZIP archives with additional metadata that tells the JVM which class contains the main method to run. They can be run on the command line using the -jar option, or in most desktop environments by double-clicking (this requires a JVM to be installed as well).
    • Desktop applications can be deployed via Java Web Start or installers like IzPack or Install4J, but Java desktop applications are not very common either.
    • Most Java software nowadays runs only on servers (web servers or app servers). They are typically deployed as WAR or EAR files, which are also ZIP archives containing classes and other resources. These applications then run inside a server component following the Servlet or EJB standards.

提交回复
热议问题