在虛擬機中開發 Java 有什麼好處嗎? (Are there any benefits to developing Java in a virtual machine?)


問題描述

在虛擬機中開發 Java 有什麼好處嗎? (Are there any benefits to developing Java in a virtual machine?)

我來自 .Net 陣營,在該陣營中,虛擬化更為普遍,因為需要在服務器軟件和系統範圍的實體(如 GAC)上運行。

現在我正在做Java開發,繼續使用虛擬化有意義嗎?我們使用的是 VirtualPC,IMO 並不是最好的產品。如果我們要繼續前進,希望我們會使用 VMWare。

我們正在進行 Web 開發,不會使用虛擬化來測試不同風格的服務器部署。

優點:

  • 允許整個團隊的開發環境相同
  • 允許與主機隔離
  • 跨平台/瀏覽器測試

缺點:

    <
    ## 參考解法 #### 方法 1:

    One possible advantage is that you could technically test out the same program on a variety of operating systems and on a vartiety of JVMs.

    Contrary to popular opinion, Java is not 100% portable, and it is very possible to write nonportable code. In addition, there are subtle versions between libraries. If you work with different JVMs, there could also be differences.

    However, since Java IDEs are heavyweight, running an IDE within the VM may not be fun.

    Java does support some forms of remote deployment, might be beneficial to explore those while still doing the IDE work locally.

    方法 2:

    I don't like developing in a VM. The good thing is, in contrast to what you're writing as cons, that multiple monitors are supported by VMWare and the huge disk thing isn't really a problem since VMWare runs surprisingly smoothly from USB hard disks.

    Running the heavyweight IDEs for Java, as Uri said, won't be much fun in a VM. But then, running Visual Studio in a VM isn't really fun as well. So if you were happy with VS in a VM, then give it a try for Java, because the cons aren't as strong as you might think :)

    方法 3:

    You said your doing java web development so it makes sense to test your application using different web browsers on different operating systems. VMware will be useful for this.

    The Netbeans IDE is operating system independent, so you can have developers working on different operating systems with out any trouble.

    方法 4:

    I run eclipse inside a VirtualBox instance and it works fine. I've used VMWare in the past and that's fine too.

    I like having my development environment segmented away from whatever the rest of my PC is doing (playing games, surfing the web, reading email, etc...)

    I work from home so virtualization provides necessary separation of work/play. It also allows me to upgrade each environment separately and have much more control over the environment.

    Also I can safely try something new and revert if the install goes "wonky". Sorry for the highly technical term. ;‑)

    Edit: It also allows me to satisfy the corporate VPN access requirements without subjecting my home environment to excessive corporate influence.

    方法 5:

    If you need a VM to verify that the app will also run on a different OS, you can cover quite some ground by using a continuous integration server and start/run VM instances on that machine (ie. Linux / Windows / OSX). Then unpack the latest build, run unit‑tests on the delivered classes. Then run automated integration tests. You will then have to report the results back to the CI‑environment. If the integration tests are good, this can catch a lot of the common multi‑platform mistakes right after they are committed to the SCM.

    (by Ryan EmerleUriOregonGhostMarkChris Navakungfoo)

    參考文件

    1. Are there any benefits to developing Java in a virtual machine? (CC BY‑SA 3.0/4.0)

#virtualization #java






相關問題

需要一個好的 Internet Explorer 6、7、8 獨立版 (Need a good Internet Explorer 6, 7, 8 standalone)

英特爾虛擬化問題 (Android Studio) (Intel Virtualization Problems (Android Studio))

VirtualMachine 的第一條指令是如何獲取的(在 KVM-QEMU 中) (How is the first instruction of VirtualMachine is fetched (in KVM-QEMU))

如何使用 SharePoint、K2 和域控制器複製虛擬 PC (How to duplicate a virtual PC with SharePoint, K2 and domain controller)

WPF數據虛擬化ListView (WPF Data virtualizing ListView)

製作linux系統的“副本” (Make a "copy" of linux system)

在虛擬機中模擬 Windows 筆記本電腦? (Simulating windows laptop in virtual machine?)

為“假 Mac OS X”虛擬化構建 Windows XP 或 7 (Skeletoning Windows XP or 7 for "fake Mac OS X" virtualization)

在虛擬機中開發 Java 有什麼好處嗎? (Are there any benefits to developing Java in a virtual machine?)

Xen ABI 是真正的 ABI 嗎? (is the Xen ABI a true ABI?)

在使用 qemu kvm 安裝 VM 之前更改 VM 的磁盤大小 (Changing Disk Size of VM before VM installation using qemu kvm)

Qemu 在 Windows 上運行時無法加載 bios-256k.bin (Qemu can't load bios-256k.bin when running on Windows)







留言討論