Posts Tagged ‘Fedora’

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.

About Sudo and Fedora

Saturday, August 1st, 2009

Whenever you read entries about Fedora administration, the common recommendation is to use sudo instead of the root account.

But if you try sudo at the command line, you are met with some error regarding sudo configuration: Fedora does not sudo-enable your account to during system installation, so you are stuck.

What to do is simple:

su -
(insert your root password)
visudo <em> (as per kagesenshi comment #1)</em>

Find a line which says:

root    ALL=(ALL)       ALL

and add

$username ALL=(ALL)     ALL

where $username is the user you log in. That’s all. Ubuntu default behaviour on Fedora.
A variant of this is adding a NOPASSWD tag to avoid requesting for a password every time, though I DO NOT RECOMMEND doing that (gives you time to think about what you are doing); the line becomes:

$username ALL=(ALL)      NOPASSWD: ALL

EDIT – Brian correctly suggests to uncomment the wheel group in /etc/sudoers and add the users to said group; while correct from a sysadmin point of view, I believe we should keep it simple for users that use Fedora “on the Desktop”. I strongly believe Using Fedora and Administering Fedora should be kept as separate activities as possible. Anyway, for more technically oriented users, you can find this way at the fedorasolved.org site.

Packaging – Infrastructure setup

Wednesday, July 29th, 2009

For packaging purposes (see my previous entry) I think to need some infrastructure. Specifically:

  • An internal subversion repository for spec files (before posting them on fedora)
  • Mock (also look here) to build in a chrooted environment

The subversion repository will be hosted on my soho server at home with dynamic ip (obviously in a ssh setting), which runs on CentOS. The mock environment is just a sudo yum install mock on my machines.

I was also toying with the idea of installing Koji and run a build server on my little atom 330, but perhaps that is overkill.

Planet Fedora

Monday, July 27th, 2009

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

Ten days with Fedora 10

Monday, December 1st, 2008

Last week the nice guys at Fedora released the tenth (X in roman numerals) version of Fedora.

In the previous weekend, I already had installed the preview release on my notebook, as a clean install. It all worked perfectly, marking this version of Fedora the most interesting Linux Distribution release I ever tried.

Fast, beautiful (thanks to Byte-Code colleague Samuele Storari and his Solar theme), this version, while looking similar to older 9 release, feels definitely more polished and performing.

After the release, I yum-upgraded my home server (the Atom 330 I mentioned in the past), and it worked out really fine, with no issues at all. It’s a simpler environment (no gnome, and a initlevel at 3), but everything (iscsi, samba, DNS, DHCP) continued working as before.

On a side note, my iscsi disk is one of two USB disks attached to the server, so I was wondering how to ensure the block device naming and availability. After contemplating custom udev rules, all that was necessary was a look at /dev/disk. I discovered I can access block devices (like disks) through the /dev/disk/by-id, for example.

Really interesting.