Archive for the ‘Fedora’ Category

Java 1.6 and Fedora 11

Monday, August 3rd, 2009

How to install the latest version of Java 1.6 on Fedora 11 (also F10 should work) and CentOS.

For Java on Fedora, I rely on Paul Howarth excellent wiki entry regarding rebuild of Sun Java Package on Fedora Linux.
As a side note, OpenJDK is possibly the best thing that could happen to Java, but:

  • as a developer, I need the target vm on my development environment
  • as a user, a lot of applets have issues with the OpenJDK plugin

Unfortunately, Paul’s entry refers to version 7 of Java 6, while, at the time of this writing, Java has been updated to version 14. Furthermore, since release 12 of Java 6, a 64 bit version of the java plugin exists (which follows new plugin apis available from mozilla version 3 forward, by the way), so Paul’s notes regarding 64 bit plugin are not valid anymore.

Well, enough said. I just put up a new spec file to help any of you out there setting up the correct java version for your fedora. The thing is set for Fedora 11, but should work for version 10, too.

You can donwload the spec file here . Also download this xsl file and this one .

If you need to startup with rpm packaging (easier than what you would expect) see my previous post regarding packaging setup. You can skip the installation of development-tools, anyway.

After completing the initial steps, put the spec file above in the SPECS directory under rpmbuild in your home directory, and the xsl files in the SOURCES directory (still under rpmbuild).

Download Java (as of today, spec file is for version 6 update 14) 64 or 32 bit as needed. As I was saying, from version 12 forward there is the 64 bit plugin and Java Web Start. Choose the bin file, and download it in ~/rpmbuild/SOURCES.

In case you are wondering, the ~ symbol in Linux stands for “the user’s home directory“, so, if the username you adopted on Linux is “jsmith”, your user home directory will be “/home/jsmith“, and the above directory will be”/home/jsmith/rpmbuild/SOURCES” and the previous one will be “/home/jsmith/rpmbuild/SPECS

Now insert the following commands:

cd rpmbuild/SPECS
rpmbuild -ba java-1.6.0-sun.spec

Take your time here (it takes a bit to unpack and repackage all). After a while, if all is OK, the command prompt will be back and you will find some files in the RPMS and SRPMS directories.

Depending on your architecture, you will find a i586 (for Fedora 11) or X86_64 directory with rpms in it. To have the Java runtime environment, just do:

sudo yum localinstall java-1.6.0-sun{,-alsa,-fonts,-plugin}-1.6.0*.rpm –nogpgcheck

answer y(es) and go ahead. But now the default Java will still be set to OpenJDK (if installed) the gcj. Just do

sudo alternatives –config java

There are 3 programs which provide ‘java’.

Selection Command

———————————————–

* 1 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java

2 /usr/lib/jvm/jre-1.4.2-gcj/bin/java

+ 3 /usr/lib/jvm/jre-1.6.0-sun/bin/java

Enter to keep the current selection[+], or type selection number:

In this case, selecting 3 you would select the sun java runtime we just installed.
As an additional benefit, an entry in the administration menu of Gnome (do not know about KDE) will be present to set all things related to Java. Also the Java Web Start should work. You can try with (ex)TrollTech’s Qt Jambi Demo Page or at Sun’s Java Web Start Demo Page.

I hope all this becomes obsolete quickly – it looks like in b16 of the OpenJDK the plugin source code is included, so we should see it appear in the Fedora infrastructure for F12.

Update Fabio comments that KDE menu entries work correctly, too. Also, to have the development environment you have to:

sudo yum localinstall java-1.6.0-sun{,-demo,-devel,-src,-jdbc}-1.6.0*.rpm –nogpgcheck

to install compilers, profiler, and all of the JDK elements.

Planet Fedora

Monday, July 27th, 2009

Just added this blog to planet fedora: still writing the next post on packaging.

Building RPMs, part one

Saturday, June 27th, 2009

The following is an excerpt from the IRC Packaging Lesson ; in red instructions for root (please use sudo – never use a system as root):

  • yum groupinstall development-tools
  • yum install rpm-build rpmdevtools
  • rpmdev-setuptree

The last command will setup the following directories:

rpmbuild directory tree

rpmbuild directory tree

BUILD

This directory will contain the build of the source code you want to package. Roughly equivalent to the directory where you tar xjf source.tarball.bz2 ; cd source.tarball ; .configure ; make

BUILDROOT

The directory where the package will be built.

RPMS

The rpm produced will end in this directory. This is the binary rpm, the one you want to install in the system to use that cute application of yours.

SOURCES

Tarballs will end up here. These are the .gz or bz2 downloaded to build the application; usually contains source files, in the common autotools format.

SPECS

Spec files are the files which define how to package software, which dependencies to look for, and some more stuff. It’s the only file you need (apart from source code) to really build a package.

SRPMS

SRPMS files are RPMS which contain source and SPEC file to rebuild packages with rpm.

OK, right now I will close the entry. A new one in a few days.

Getting lost

Thursday, June 25th, 2009

At Byte-code meetup I just launched the idea for a new projet to support the Prince2 project management methodology.

Right now, I just registered at sourceforge and nothing else. But the plan is clear (and will be managed in a Prince2 manner, by the way):

  • Django / Python powered
  • GPL v2
  • Integration with external tools ( trac comes to mind, but also taskjuggler )

Django is a little hazard – never programmed seriously in Python, and the Django world is a new one for me. Anyway, I am just willing to move away from the Java world for a while.

Now comes the best – I will try to do it using Fedora way . This means that every additional package (Python or Django) will be rpm’ed.

Django by itself it’s a no-brainer – just yum install Django (observe the capital ‘D’ here), but I was looking at Pinax and some more Django extensions, mostly hosted at google code.

Benefits of this plan:

  • Enhance package building knowledge
  • Easy installation
  • Really join fedora community

So I will create a new category, starting today, where I will summarize my steps. Stay tuned.

New Kid in the block….

Thursday, April 30th, 2009

…is a Samsung NC10, quite an interesting machine, lighter than my laptop (Dell D630).

I was trying to stay clear of these netbooks, but I did not resist. The little one (“atomino“) is currently running with Fedora 11 Preview + updates. Installed without a hitch (not the same with the beta…), only video performance is sub-par and actually under investigation.

I will post my findings. Stay tuned.