Part Three – Configuring Ubuntu to use your newly installed Java JRE and SDK
There are a lot of technical steps in this part, and I figured them out mostly through heavy internet searching, piecing together information from other blogs, and trial and error. The main issues were caused by every site expecting you to already have some key components installed before trying to get this working. So when I tried to follow their guides they never worked. That is why we are here now, using a fresh and clean Ubuntu installation.
updated for Java 7 on February 8th 2012
- cd /opt/java && sudo ln -s /opt/java/jdk1.7.0_02 /opt/java/jdk-linked && sudo ln -s /opt/java/jdk1.7.0_02/jre /opt/java/jre-linked – this moves back to the /opt/java directory and creates a link to the jdk folder that we can use to reference to later, that way if we ever install a newer version of java all you have to do is remove the links and create new ones, not have to go through this whole process again! you can test by typing cd jdk-linked && ls – and you will see the contents of /opt/java/jdk1.7.0_02 (don’t forget you can use [tab])
- sudo update-alternatives –install “/usr/bin/java” java “/opt/java/jre-linked/bin/java” 10 && sudo update-alternatives –set java /opt/java/jre-linked/bin/java – this updates Ubuntu so it can find your new jre and makes it the default jre to be used by the system (again future proofed because we used the linked location)
- if you want to, we can setup java for Firefox too
- mkdir ~/.mozilla/plugins/ && ln -s /opt/java/jre-linked/lib/i386/libnpjp2.so ~/.mozilla/plugins
- cd && vi .profile
- [ctrl+f]
- [o]
- EXPORT JAVA_HOME=/opt/java/jdk-linked
- [enter]
- EXPORT PATH=$PATH:$JAVA_HOME:$JAVA_HOME/bin
- [esc]
- :wq!
- now we need to repeat the next set of instruction with the following items placed in [java] (everytime you see [java] put one of the following until you have done these steps for each of the following), I have noted after each one if you need a jre or jdk, or both lines for it, if both, replace the 10 with a 5 on the jdk (this will add both the jre and the jdk alternatives to the list making the jre ones the default). Or, just use this script. (remember to look at the script first to make sure it does what I said, and to set it as executable! cat java-update|more && chmod +x java-update then execute it with sudo ./java-update)
- java – jre/jdk
- jar – jdk
- jarsigner – jdk javac – jdk
- javadoc – jdk
- javah – jdk
- native2ascii – jdk
- rmic – jdk
- rmid – jre/jdk
- rmiregistry – jre/jdk
- serialver – jdk
- sudo update-alternatives –install “/usr/bin/[java]” [java] “/opt/java/jre-linked/bin/[java]” 10
- sudo update-alternatives –set [java] /opt/java/jre-linked/bin/[java]
- mkdir ~/source-build && cd ~/source-build && sudo apt-get install debhelper gcj-4.4-base gcj-jdk m4 debiandoc-sgml python-docutils cdbs – moving on, we need to install some things before the adding Titanium to the system, this group (plus their dependencies, you don’t want to know what I went through to get this list exactly correct, it took a couple of months the first time I worked on getting this installed) takes up 823MB and took me 16 minutes to download and 2.5 minutes to install. as an fyi, I figured these out by not having them installed the first time around and spent weeks trying to figure each part out, because these files are not what causes the failed instal, linux will pull the dependencies for you when you install something, but there are dependencies of dependencies of dependencies… and somewhere down that line linux fails to grab the final set! So you need to install them in this order, I then spent another week or 2 finding out that those in particular have to be installed before the next set or the next set fails to install!
- sudo rm /var/lib/apt/lists/* && sudo apt-get update – this will resolve an issue with the sources of the next step
- sudo apt-get install llvm-gcc-4.5 && sudo apt-get build-dep llvm-gcc-4.5 && sudo apt-get -b source python-defaults ruby-defaults && sudo apt-get update && sudo apt-get dselect-upgrade && sudo apt-get autoremove – this set downloads the source files for each of these and builds them specifically for your system and then cleans itself up, this did prompt me for 62.5MB of additional storage space and the build process took about 20 to 45 seconds on my machine.
- sudo apt-get install ispell – I have found a few other things that are necessary for titanium to work
- restart your development VM
- mount your shared drives and take a new snapshot after the system comes back up, called pre Android SDK, and comments “OS, java jre&jdk, and compilers installed”
maybe you don’t really need all of this, but I don’t want to find out while I am writing my Android app that I missed a step, as then you won’t be able to re-use the snapshots in case of an emergency (also called a mistake!). One other note, if you noticed I made a new directory and used it for the source builds, this is because at least the python source build requires several chown commands to run and if you try to execute them on a VM share mount it will fail and you cannot complete the build. Congratulations! I know this was a tough part to do, and I’ll have to check it over sometime in the future to recreate the entire process step by step and make sure it all works again (never know where there might be a typo!). Next time we meet it will be to install the Android SDK and Titanium. After that we will build a short crappy Android app to test everything and then make an .iso Live CD of the whole VM! The final file was pretty big, I’m not sure if a Live DVD would cover it all! I’ll test this idea and add it to the final post if it works. I will be heading out of town for a couple of days so don’t expect anything before monday!
again, after I finish this series up, I’ll add in resource links
this may get a bit repetitive with me re-listing everything, so instead I am just going to link to the first post that has the list of things to do… note I have added a couple of things at the bottom so the [...]
this may get a bit repetitive with me re-listing everything, so instead I am just going to link to the first post that has the list of things to do… note I have added a couple of things at the bottom so the numbers now go past 20…
1. 75% in progress, troubleshooting and more testing needed. I have gotten my user added the the “VirtualBox” user group, but I get this error when I try to execute VirtualBox from the command line ”VirtualBox: supR3HardenedExecDir: couldn’t read “”, errno=2 cchLink=-1“ I tried loading VirtualBox from KDE and it was loading for about 12 seconds then nothing happend, also it did not install a manual page. I’ll have to do some forum surfing to figure this one out. this exact error is referrenced in the FreeBSD handbook noting that it should only occur if you are using an older version on VirtualBox.
2. 0% not started. no updates yet, holding off till I get some of these other tasks complete.
3. 100% complete. everything is automounting at bootup and it is doing it where I want it to.
4. 100% complete. I am working almost exclusively via ssh now and can connect to it remotely as tested via an Android cell phone ssh client (props to connectbot)
5. 10% in progress, researched only. Chrome can be installed as a Debian, Ubuntu, openSUSE, or Fedora package, I just need to set my system up to handle RPMs and I might be able to get it to install, hopefully the newest version will work easier than last august when everyone was trying to hack the install to make it work, especially since every forum I went to never had a successful complete port available and there were no posts from 2010 and the maintainer of the hacked port is not doing updates anymore except those that match his specific system configuration.
6. duplicate issue. going to delete this one, as #19 and #20 pretty much sum it up.
7. 30% in progress, trouble shooting and additional testing required. as noteded else where VirtualBox is installed but not able to run, and I have not started on VMWare.
8. 100% complete. Firefox 3.6.2 is installed and operational.
9. 90% in progress, trouble shooting and more testing needed. self testing shows that a user is able to ssh in and access the drives, but is not able to ftp in and access the drives. I used “sudo ln -s /mnt/<directory> /home/<user>/<directory>” I haven’t used links much and need to see if the -s (symbolic) is what is preventing the user from accessing the data via ftp.
10. 0% not started. no updates yet, holding off till I get some of these other tasks complete.
11. 20% in progress, 1 out of 5 drives is currently running with GPT. the new 1.5TB drive was setup with GPT when installed into the system. the new 500GB drive (FreeBSD boot drive) is still MBR as the FreeBSD fdisk application did not have an option for setting the drive boot record to GPT, although I have found documentation on converting the FreeBSD boot drive to GPT.
12. 0% in progress, initial research turned up nothing useful.
13. -30% not started, situation worsening, additional packages labeled as “gnome-xxxx” or “xxxxx-gnome” have been added as dependencies during other package installations.
14. 10% in progress, initial research has turned up useful information; however I am not currently in a possition to proceed.
15. 0% not started. no updates yet, holding off till I get some of these other tasks complete.
16. 0% not started. no updates yet, holding off till I get some of these other tasks complete, will require at least one of #’s 1, 2, 7, or 15 to be complete before work can begin.
17. 0% not started. no updates yet, holding off till I get some of these other tasks complete, not a priority and very near the bottom of the list of things to do.
18. 40% in progress. Still leaning towards rsync, but I have been researching into using dump and I think it will do what I want it to.
19. 60% in progress, I thought I had it installed, but when I went to the test if you have java installed page of www.java.com it failed to test my java installation (might need to add the plugin for firefox, will check); however the java download page only lists “Windows, Mac OS, and Linux” as OS choices, so I will have to do more research.
********update – I am making a java install page because this was such a pain in the rump to do.***********
20. 40% in progress, I thought I had it installed, but when I went to hulu it told me I need java 10.0.22, also amd.com told me I need the flash plugin installed; however again there is no FreeBSD listing on the download page as a supported OS, so I will have to do more research.
21. 100% complete. (I know I added this one) get Yakuake working in KDE, well I did a “sudo pkg_add -r yakuake” and it started downloading, it has about 6 dependencies and those had about 150 dependencies, most of which I already had installed. the problem I saw was it force downloaded KDE 3.5 and all of it’s dependencies, I hope that doesn’t screw anything up. If I remember correctly from when KDE 4.0 first came out they specifically named the port KDE4 instead of just KDE so that there would not be conflicts on systems that had both versions installed. after it finished I ran a “sudo pkgdb -F” it found a lot of stale dependencies and fixed them, one thing I noticed fly by was Firefox 3.0.## which tells me I need to check my Firefox and see if it is 3.0 or 3.6…
22. 10% researched only. Get Picasa installed and working, this will be just like chrome and will require using RPM packages.
23. 100% complete. as part of #5 and #22 (and because I always install this on FreeBSD, but it failed during initial OS installation for some reason) I am installing the linux compatibility/emulation pack. I’ll do a brief post on this and link it here.
Twitter: finndo77
- New blog post... Diablo III closed Beta http://t.co/dKC2ChWm 01:36:32 PM December 07, 2011 from joelperryproductions.com ReplyRetweetFavorite
- New blog post... resolving video problems with K-L-Ubuntu and XFX Radeon 6850 http://t.co/H6bXuMqi 06:59:18 AM October 22, 2011 from joelperryproductions.com ReplyRetweetFavorite
- New blog post... Computer upgrades http://t.co/6PWVNy4m 01:39:35 PM October 20, 2011 from joelperryproductions.com ReplyRetweetFavorite
- $7 for $15 Worth of Hand-Tossed Pizza, Calzones, and Drinks at Andolini's Pizza Charleston, SC http://t.co/QnKwPwB 11:49:26 AM August 29, 2011 from Tweet Button ReplyRetweetFavorite
- New blog post... is zdnet.com/news down http://t.co/DThuI4r 07:57:28 AM August 17, 2011 from joelperryproductions.com ReplyRetweetFavorite
- New blog post... Netflix Down? http://bit.ly/q74Svu 07:39:30 PM August 08, 2011 from joelperryproductions.com ReplyRetweetFavorite
Blogroll
programming
Tech Websites
- a good coder I found on CodeProject
- Barebones HTML coding chart
- Code Project
- Extreme Overclocking
- FreeBSD blog
- Legit Reviews – Tech Hardware Review
- Linuxtopia
- Notion Ink – homepage
- Plug Computing web site and forums
- Tablet Roms – used to be – Notion Ink Hacks
- Ubuntu Forums post on the mount command and fstab file
- VMWare ESX blogger
- Wikipedia.org main page
- ZDNet's blog pages

