How to install Java SE Development Kit 7 on Debian

Debian is a wonderful open source distro, but sometimes you need some evil Oracle to get some things going.

Debian is a wonderful “open source” Linux distribution that I have been using for quite some time now. One problem that creeps up every now and then is the whole “open source” thing–frankly sometimes you need proprietary software. Now I hate that and if you know any better you probably do too, but such is the world we live in.

I needed Java SE 7 to try to fix a small problem I had been having with PyCharm. For some reason the “ctl+v” for pasting is not working and I had seen somewhere on a forum that the java version could be causing a problem. I had been using openjdk-7 –and since I don’t do much in java–that really hadn’t been much of an issue. But now it was and Debian does not have the official Oracle version in the repositories–anywhere. (Oracle is evil by the way).

So off to some “googling” to find out a solution…

While Debian does not provide the oracle version in the repos, they do have a neat package called “java-package” which is kindly provided for the sole purpose of helping poor developers install the evil official version of java on their systems. (Get the feeling that this is a fairly frequent problem). This lovely little package installs a program called “make-jpkg” which you can then use to compile a .deb installer to install on your system.

So should you need to do this little exercise it will look like this:

  1. Download Java SE 7 to your computer.
  2. open your terminal and cd into your Downloads folder or wherever you downloaded the file to.
  3. then make-jpkg your-file-here.tar.gz to compile that compressed file into a .deb file.
  4. Finally sudo dpkg -i your-new-deb-file-here.deb to install Oracle’s java.

You are also probably interested in using this version of java on a regular basis–and since you have it now maybe even all the time. We can do that also!

In your command line type sudo update-alternatives --config java. This will bring up a small command line menu that will enable you to change which version of Java you want to be your default version:

kevin@debian:~/Development/FlaskHF$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                           Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      auto mode
* 1            /usr/lib/jvm/j2sdk1.7-oracle/jre/bin/java       317       manual mode
  2            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      manual mode

Press enter to keep the current choice[*], or type selection number:

Simply enter the number of the version you want and you’re done! Hopefully this will be of some help to you. Leave any comments or helpful tips below.

PS This didn’t solve my Pycharm problem so if you have any tips you can pass those there also 🙁

PPS I just solved the PyCharm problem it was related to keyboard layout order in Debian. Weird! see thread.

WordPress Social Media Tags Without Plugin

WordPress does great as a Content Management System, but leaves a lot to be desired when it comes to getting ready for Social Media. Google, Facebook, and Twitter all have their own markup schemes which really provide some enhancements to content that is shared on those networks. Getting that markup on WordPress is the challenge. There are plugins that help provide this sort of functionality, but I prefer to keep it simple and I also like to know how it is done. So I rolled up my sleeves and put something together to get the job done.

Continue reading “WordPress Social Media Tags Without Plugin”

Map a custom subdomain to Amazon’s S3 service

Background

I’ve been dabbling with Amazon’s AWS S3 service lately for a number of reasons, but one of them is hosting web resources. I have been putting up outlines from my Sunday School lessons at Church which are easily taken care of with Dropbox through their sharing options. Then someone asked me to put up some audio from the lessons to listen to later and I knew that I needed a more robust solution. Not only would audio take up a huge amount of my Dropbox quote, but I also wasn’t sure about the bandwidth issues of either hosting audio from either Dropbox or my web hosting service. I had also been thinking about switching up my Church’s audio storage solution and this would be a great opportunity to test settings and get more familiar with the service.

Continue reading “Map a custom subdomain to Amazon’s S3 service”