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.

  1. cd /opt/java && sudo ln -s /opt/java/jdk1.6.0_21 /opt/java/jdk-linked && sudo ln -s /opt/java/jre1.6.0_24 /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.6.0_21 (don’t forget you can use [tab])
  2. 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
  3. cd && vi .profile
    • [ctrl+f]
    • [o]
    • EXPORT JAVA_HOME=/opt/java/jdk-linked
    • [enter]
    • EXPORT PATH=$PATH:$JAVA_HOME:$JAVA_HOME/bin
    • [esc]
    • :wq!
  4. 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
    1. sudo update-alternatives –install “/usr/bin/[java]” [java] “/opt/java/jre-linked/bin/[java]” 10
    2. sudo update-alternatives –set [java] /opt/java/jre-linked/bin/[java]
  5. mkdir ~/source-build && cd ~/sourcebuild && 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!
  6. sudo rm /var/lib/apt/lists/* && sudo apt-get update – this will resolve an issue with the sources of the next step
  7. 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 not prompt me for the additional storage space until it got to the apt-get dselect upgrade step (some 48kb) but the build process took about 20 to 45 seconds on my machine.
  8. sudo apt-get install ispell – I have found a few other things that are necessary for titanium to work
  9. restart your development VM
  10. 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!

  1. part one
  2. part two
  3. part four

again, after I finish this series up, I’ll add in resource links

ok so to start, Appcelerator Titanium is still not working on either x64 or 32-bit Kubuntu 10.04.  I even found a video on YouTube on setting it up for Ubuntu 9.10 that had about 4 or 6 steps and took almost zero time, in fact he did it in an edited 10 minute video and did not install and dependencies or compilers… (gcc, gcc++, python, or ruby) on a clean OS install.  I am still not able to get it running.  I have a new weird error I have not been able to find helpful info on at this point.  will update this post early next week, I have a busy weekend ahead of me)

Final Fantasy XIII – still playing, found some things I am happy about, still not attached to my characters, although I care enough about my accessories that I want to complain that you don’t get them back when your party gets changed (which happens a lot).  I spent all my gil upgrading 1 weapon for each and 3 accessories, and I don’t always get a chance to un-equip the accessories before there is a party swap.  Also found a new thing that pisses me off!! THEY MADE UP WORDS TO THE CHOCOBO SONG!!! I can’t believe they stooped so low! (yes I know there was a pun in that statement)

Good news though, no 999hp limit (I know not the first FF to do so), damage is not capped at 9999 nor 99,999 (I believe, as the only not secret achievement in the game is do more than 100k damage in a single attack).  I am now in chapter 8 and have noticed a significant ramping up of CP rewards, and CP cost for new abilities.  I spent 4 hours at the level 7 sweet spot, Hope’s house, just run around inside and the soldiers respawn when you get halfway to the opposite side.  I made 125k gil from celling incentive chips (2.5k each) and got 60 phoenix downs and 25k CP.  not too bad a stash, but it was not enough… I could not buy any of the better upgrade components yet, so could only upgrade 1 item and 1 weapon (got Lightning’s starter sword to level 12, or maybe it was 11) and when I got to chapter 8 I was not able to max out anyone’s new CP skills. better yet! after I finished a relatively short and easy section wit h Sazh and Vanille (whom I always call vanilla) I had 33k CP available to upgrade the other team!!  which means that easy part at Nautillus which took about 45 minutes +/- gave me almost as much CP as 4 hours in Hope’s house… if I had known that, I would have stuck around Nautillus a bit more.

Right, on to my PC state of affairs… again, I have been using KUbuntu 10.04 for a week or two now, and have an installation post to make still, have it written on little scraps of paper that I need to type up, all seems good, Fedora 13 should be out tuesday, I have prepared my system for a clean install of that on a separate HDD.  Should get that done Wed, so there should be a post about that coming Saturday (maybe friday, I am going to try and post everything in the order it has been happening, so nothing gets left behind.  Also look out for a post on Sprint’s HTV Evo 4G sooner or later (might wait till I pick mine up on June 4th!!! although I will be out of town that weekend to watch a dance recital, 4 yr old and a 9yr old).  hopefully I will be posting my 32-bit Appcelerator install guide tonight if I can figure out this new error.  I want to get started on a couple system apps/widgets for my Evo before I get it.

Sorry for the exceptionally long title…

************************FAILED INSTALLATION, after approximately 3 hours of trying I give up**********************

**********update********

going to give it a shot on a 32-bit install tonight and see how that goes…

********end update********
Had a bit of an issue getting this to work, so I decided to put up a post, seeing as how some of the new fandangled Android phones launching this year will get some people interested in developing their own apps (and apple products too, this SDE is good for iPhone and Android currently…)  For this example, I am doing it as I type it, so hopefully I will come back and clean it up a bit later… I am creating a directory under ~/Downloads to both DL and save all the files used in this process.

*********************I had an error in this process, so I have documented it here.  make sure you read through to the end before trying, as I will re-post a working step-by-step guide at the end so you can avoid these errors…******************

step by step how I got this working (hopefully it will be working  when I finish!!)

  1. mkdir ~/Downloads/android/environment (makes the app directory, you can put it where ever you want, it will make a subdirectory when you do the download)
  2. sudo apt-get install build-essential ruby rubygems libzip-ruby scons libxml2-dev libgtk2.0-dev python-dev ruby-dev libdbus-glib-1-dev libnotify-dev libgstreamer0.10-dev libxss-dev libcurl4-openssl-dev git-core (this downloads all the dependencies you need)
  3. git clone git://github.com/appcelerator/titanium_desktop (this actually pulls down the application)
  4. cd titanium_desktop
  5. git submodule update –init (initiates an update I believe…)
  6. cd kroll
  7. git checkout master (really know nothing about git, I’ll have to look this one up…)
  8. cd ..
  9. scons debug=1 sdkinstaller run=1 (this actually builds the app and makes a binary for you to run)

after step 9 I got this error

/usr/bin/ld: cannot find -lPocoFoundation

collect2: ld returned 1 exit status

scons: *** [build/linux/runtime/libkhost.so] Error 1

scons: building terminated because of errors.

a little hunting found me this:

sudo apt-get install libPocoFoundation*

Reading package lists… Done

Building dependency tree

Reading state information… Done

Note, selecting libpocofoundation9-dbg for regex ‘libPocoFoundation*’

Note, selecting libpocofoundation9 for regex ‘libPocoFoundation*’

The following extra packages will be installed:

libpocofoundation9 libpocofoundation9-dbg

The following NEW packages will be installed:

libpocofoundation9 libpocofoundation9-dbg

0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.

Need to get 2,924kB of archives.

After this operation, 10.6MB of additional disk space will be used.

Do you want to continue [Y/n]? y

Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/universe libpocofoundation9 1.3.6p1-1 [525kB]

Get:2 http://us.archive.ubuntu.com/ubuntu/ lucid/universe libpocofoundation9-dbg 1.3.6p1-1 [2,399kB]

after which it proceeded to install those 2 packages…

collect2: ld returned 1 exit status
scons: *** [build/linux/runtime/libkhost.so] Error 1
scons: building terminated because of errors.

so I re-ran the install script to see what it might do…

same error… new tactic…

sudo ln -s /usr/lib/libPocoFoundation.so.9 /usr/lib/libPocoFoundation

ran it again…

same error… new tactic…

ls ./build/linux/runtime/

libcrypto.so.0.9.8          libgpg-error.so.0.3.0       libPocoCrypto.so.9      libproxy.so.0.0.0

libcurl.so.4.1.1            libgthread-2.0.so.0.2200.3  libPocoData.so.9        libsoup-2.4.so.1.3.0

libgailutil.so.18.0.1       libicudata.so.38.1          libPocoFoundation.so.9  libsoup-gnome-2.4.so.1.3.0

libgcrypt.so.11.4.4         libicui18n.so.38.1          libPocoNet.so.9         libssl.so.0.9.8

libgeoclue.so.0.0.0         libicuio.so.38.1            libPocoNetSSL.so.9      libwebkittitanium-1.0.so.2.15.1

libgio-2.0.so.0.2200.3      libicule.so.38.1            libPocoSQLite.so.9      libxcb-render.so.0.0.0

libglib-2.0.so.0.2200.3     libiculx.so.38.1            libPocoUtil.so.9        libxcb-render-util.so.0.0.0

libgnutls.so.26.4.6         libicutu.so.38.1            libPocoXML.so.9         webinspector

libgobject-2.0.so.0.2200.3  libicuuc.so.38.1            libPocoZip.so.9

so according to this the file might already be there? just with the wrong name…
next fix attempt…
sudo cp build/linux/runtime/libPocoFoundation.so.9 build/linux/runtime/libPocoFoundation.so
(also tried putting a .1 .2 .3 .4 .5 .6 .7 .8 at the end of it still no luck)
next thing I tried…
echo PATH=$PATH:/usr/lib
no good
but I did happen to find this…
/home/android-sdk/.titanium/runtime/linux/1.0.0/libPocoFoundation.so
which I added to /etc/environment and restarted the VM.
  1. sudo vi /etc/environment
  2. /PATH
  3. $
  4. i
  5. :/home/android-sdk/.titanium/runtime/linux/1.0.0/
  6. [esc]
  7. :wq!
just in case…
echo $PATH
showed what I wanted, so I re-ran the build…
same error.
:~/Downloads/android/environment/titanium_desktop/installer/linux$ cat SConscript
#!/usr/bin/env python
import os.path as path
just the first couple lines, but show that it is indeed using the system path, and I have 2 locations with the lib it is looking for in my path…
right new method… looking at the error it says
scons: *** [build/linux/runtime/libkhost.so] Error 1
well, that file does not exist in that location, so I am going to try and put it there…
sudo cp /home/android-sdk/.titanium/runtime/linux/1.0.0/libkhost.so .
no change, still same error.
starting to look like I will have to build my Android apps from windows…
well after 3 hours of trying to figure it out, I have had an idea…
~/Downloads/android/environment/titanium_desktop$ sudo scons debug=1 sdkinstaller run=1
exact same problem…
going to bed, I’ll probably post this now and make anew post later if I try again… 3+ hours to install 1 application is more than my patients will normally allow for a round 2…

To get updates…

  1. cd ~/Downloads/android/environment/titanium_desktop
  2. git pull
  3. cd krull
  4. git pull

**********reference link for this information, I just made it more specific and actually tried to do it using these instructions…

and the following other useful blog posts and such…

http://ubuntuforums.org/showthread.php?t=932162

http://www.linuxquestions.org/questions/linux-software-2/make-error-usr-bin-ld-cannot-find-lxext-365646/

http://ubuntuforums.org/showthread.php?t=204908

don’t forget to get the Android SDK!!!

16 visitors online now
2 guests, 14 bots, 0 members
Max visitors today: 23 at 12:30 pm PST
This month: 23 at 02-05-2012 05:37 am PST
This year: 29 at 01-11-2012 02:49 pm PST
All time: 1100 at 08-08-2011 08:11 pm PDT
View in: Mobile | Standard