How do set up a Unix based VirtualBox guest for Java Development? I wish to keep some of my existing development environment (I run Windows) and integrate it using VirtualBox. Is this possible?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It took me some time to come up with a more flexible solution to install not only a development environment on Linux, from scratch, but also cater for a system running on VirtualBox.
I have found that running two systems through VirtualBox running on a Windows 7 Ultimate edition gives the optimal solution for my needs as a Java based web developer with additional bash scripting skills.
Let’s start by my host system (Windows 7 Ultimate) provides me with a proprietary environment where I can install proprietary JDK from Oracle in addition to tools like Photoshop, MS Office, MSSQL, etc. The Ultimate version of Windows 7 allows me to set up XP Mode machines to add IE6, IE7, IE8 to my browser range (you need a new machine for each legacy Internet Explorer). I am also able to test Safari on Windows, but not Linux (to my knowledge). Most of the other tools I use related to Java (IDE’s and Maven, servers), simply need to be unpacked to a specific location or a run o the installer. The two crucial choices I make are: 1) Keep everything in my “%USERPROFILE%” (home) directory & *2)*Ensure my IDE has Maven support.
The idea is to get our host and guest working in unison. The two systems can benefit each other as I demonstrate in the video below. We can set up SVN repositories with tortoise SVN client in Windows to be used as repositories in guest systems. Obviously if you want proper SVN clients on guests in VirtualBox, install them. However your guest IDE’s will be able to use these Windows created repositories. You can go the other way too by sharing a folder and using your guest SVN client to make it into a subversion repository.
Our guest system (Linux), allows us to remove some bloatware from Windows. Things like FileZilla & Putty are no longer needed. Our guest comes with a superior terminal with built in ftp and ssh. We can also create bash scripts now to build/rebuild our Linux development and to download our needs. You can even write bash scripts to download and unpack Maven into a Windows shared directory.
Linux also aids the Web developer with an additional browser which needs to be tested like Konqueror.
More importantly, our Linux system can just be used as a completely different environment to our host. We can set up Open JDK versions and configure our Maven install accordingly which can also be shared between host and guest as the JRE abstracts it from our host/guest.
I have written the following script that downloads and installs Oracle JDK onto your guest, Maven, NetBeans & IDEA. The script also prompts you for a file to write ‘boot’ commands to in an attempt to mount some defaults like ‘.m2’, ‘maven’, ‘SVN’, ‘NetBeansProjects’, ‘IDEAProjects’ from your host to guest. Provided that you have set up VirtualBox with Guest Additions and set up these directories to be shared.
You are prompted for your systems script file which can be used to write startup commands to. I wish there was a universal location for this on Linux but OpenSuse is not playing along so you won’t be able to use the default I provided (type in: /etc/rc.d/boot.local). If you don’t like this feature the script will create ‘on-the-fly’ scripts in your ‘/usr/local/bin’ location.
Finally, because we are working with shared folders on the guest only (if everything is set up correctly), it should be safe to delete your guest because your are sharing projects, Maven, SVN, from host system and the data should still be there.
See this vid