个人工具

UbuntuHelp:BulgarianDocumentation/restricted formats dapper

来自Ubuntu中文

跳转至: 导航, 搜索

<<Include(Tag/ContentCleanup)>>

目录

НЕ-свободни формати - Ubuntu 6.06 "Dapper Drake"

Версия 3(dapper) Преработка-0.165flash-unsync-alpha<
> В този документ са използвани преведени части от https://wiki.ubuntu.com/RestrictedFormats

Правно разяснение

IconsPage?action=AttachFile&do=get&target=IconDialog-Warning1.png Патентите и лицензионните ограничения върху милтимедийните формати затрудняват възможността на свободната операционна система да се разпространява със софтуер, който поддържа тези формати. Ubuntu активно подкрепя Свободните Формати. Тази страница ще ви разясни как да добавите поддръжка за най-популярните НЕ-свободни мултимедийни формати. Някой от пакетите изброени тук може да се незаконни във въшата старана (това не се отнася за България). Тази страница не е правен съвет.

Преди да започнете

  • Трябва да имате администраторски права за да инсталирате пакети. RootSudo разяснява как Ubuntu предоставя нужните права.
  • Почти всички приложения и пакети споменати на тази страница се намират в Universe и Multiverse хранилщата. Вижте Добавяне на Хранилища за инструкции как да добавите Universe и Multiverse хранилщата.
  • Някои допълнителни пакети се намират в хранилища, които не се контролират от Ubuntu. Моля не съобщавайте за бъгове относно тези пакети:
  • realplayer
  • w32codecs
  • libdvdcss2

Алтернативен начин на инсталиране

Тези компоненти могат да се инсталират ползвайки една от две програми направени спецално за тази цел

  • !EasyUbuntu има опростен интерфейс и се препоръчва за начинаещи
  • Automatix е за малко по-напреднали потребители и има повече опции. Също така (поне за момента) може да инсталира допълнителен софтуер като VMWare Player и други.

И двете изискват Ubuntu Breezy (5.10) или по-нова версия. Ползването на една от тези помощни програми не пречи нито изключва да следвате инструкциите по-долу.

Търговси марки

Java е търговска марка на Sun Microsystems, DivX е търговска марка на DivX Inc., Real'Player е търговска марка на Real'Networks Inc., Windows e търговска марка на Microsoft Corp., Flash е търговска марка на Adobe Systems Inc., всички останали марки са търговски марки на съответните им претежатели.

НЕ-Свободна Мултимедия

Мултимедийни Плейъри предоставени от Ubuntu

  • Ubuntu поддържа Totem (видео плейър) и Rhythmbox (музикален плейър)
  • Kubuntu включва Kaffeine и amaroK.

Тези програми могат да изпълняват свободни формати (напр. Ogg Vorbis, Ogg Theora, и др. подобни) без допълнителни настройки (out of the box). Същите програми могат да стартират и НЕ-свободни формати ако инсталирате някои допълнителни пакети. Мултимедийни Приложения описва най-популярните плейъри включени в Ubuntu, както и някой по-популярни намиращи се в хранилищата.

MP3

Ако живеете в страна където е законно (напр. България), можете да добавите MP3 поддръжка в Ubuntu и Kubuntu Мултимедийни Плейъри като добавяне на multiverse и universe хранилища и инсталиране на gstreamer0.8-mad пакета. Използвайте любимия си пакетен мениджър за да инсталирате пакета или напишете в конзола:

Ubuntu

Ubuntu 6.06 (Dapper Drake) Използвайте любимия си пакетен мениджър за да инсталирате пакета:

gstreamer0.10-plugins-ugly

Ubuntu 5.10 (Breezy Badger) Използвайте любимия си пакетен мениджър за да инсталирате пакета:

gstreamer0.8-mad

Всички Ubuntu Версии Файловия Мениджър на Ubuntu може да просвирва предварително музикални файлове ако задържите мишката върху файла. Ако искате тази функционалност използвайте любимия си Пакетен Мениджър за да инсталирате:

mpg321 vorbis-tools

Ако предварителното просвирване на MP3 е лошо опитайте да инталирате 'mpg123-esd' вместо mpg321. mpg123-esd не е свободен и затова се намира в multiverse хранилището.

Kubuntu

Kubuntu 6.06 (Dapper Drake) Използвайте любимия си пакетен мениджър за да инсталирате пакета:

libxine-extracodecs

За да имате mp3 поддръжка в K3b, инталирайте:

libk3b2-mp3

Kubuntu 5.10 (Breezy Badger) Kubuntu uses two different methods for playing mp3s. If you are using the version of amarok that comes by default with Kubuntu 5.10, use your favorite package manager to install

gstreamer0.8-mad

Ако използвате akode библиотеката за звук, инсталирйте:

akode-mpeg

За да имате mp3 поддръжка в K3b, инталирайте:

k3b-mad

{i} Забележка за KDE потребителите: Вашата специфична конфигурация може да изисква инсталация на akode-mpeg пакета за да се добаве mp3 поддръжка. В Ubuntu 6.06, amaroK се нуждае от libxine-extracodecs за mp3 поддръжка.

Рипване на CD дискове

Ако вашия преносим музикален плйър не поддържа Свободни Формати, страницата CD Рипване обяснява как да конвертирате вашите CD в MP3 и AAC.

Други НЕ-Свободни Формати

Мултимедийните плейъри в Ubuntu и Kubuntu могат да поддържат голям брой от НЕ-свободни формати. Ако и законно да просвирвате тези формати, просто добавете universe и multiverse хранилищата и инсталирайте нужните пакети с любимия се пакетен мениджър. Или можете за напишете следното в конзола:

  sudo apt-get install  gstreamer0.8-plugins  gstreamer0.8-plugins-multiverse  gstreamer0.8-ffmpeg
  

или, ако използвате Ubuntu 6.06 (Dapper Drake):

  sudo apt-get install gstreamer0.10-ffmpeg gstreamer0.10-gl gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse libxine-extracodecs ffmpeg lame faad sox mjpegtools libxine-main1
  

{i} Забележка: Това е една команда. Не я въвеждайте на няколко пъти по редове. IconsPage?action=AttachFile&do=get&target=IconNote.png Това не е необходима за Kubuntu потребителите защото libxine-extracodecs включва всички тях.

Кодеци - НЯМА Я ВЕЧЕ

mplayer, xine и totem-xine могат да стартират MPEG-1, MPEG-2, MPEG-4 (т.е. кодирани с DivX, XviD, FFmpeg MPEG-4 и др.), QuickTime и други формати зползващи вградени базови кодеци (главно от FFmpeg). Real'Audio и Real'Video 8 и 9, Windows Media 9 и някой други хормати са поддържани чрез външни кодеци, или чрез Linux кодеци (Real'Media), или чрез Windows кодеци (Windows Media 9, RealMedia) - тази поддръжка е включена във 'w32codecs' пакета. Тъй като Windows е основно на 32 битова основа при десктопи, на практика няма собственически кодеци в 64 битова DLL форма, следователно няма пакет 'w64codecs'. Някой хора на AMD64 решават този проблем като инсталират 32 битова версия на операционната система вътри в chroot (чрез Linux Vserver или dchroot), и това работи много добре. PowerPC потребителите са абсолятно без късмет на този фронт - никой все още не е проявил инициатива да събере двоични кодеци написани за комерсиални операционни системи на тези платформи. нито да интегрира възможнос да бъдат използвани от гореспоменатите медийни плейъри. Ако законита във вашата страна позволяват да стартирате медия използвайки 'w32codecs', в терминал напишете:

  wget -c ftp://ftp.nerim.net/debian-marillat/pool/main/w/w32codecs/w32codecs_20050412-0.0_i386.deb
  sudo dpkg -i w32codecs_20050412-0.0_i386.deb
  

{i} Забележка: WMV файлове кодирани с DRM (Digital Rights Management) не могат да се стартират от кодеците. {i} Забележка: Ако звука при WMV файлове е насечен, опитайте това решение.

Alternative Media Players - ЗАМЕНЯ ТОЧКА КОДЕЦИ

Currently, the best support for MPEG-1, MPEG-2, MPEG-4 (for example, encoded with DivX, XviD or FFmpeg MPEG-4), QuickTime and other non-free media formats is provided by Totem-xine, Kaffeine, MPlayer, and xine. Playing WMV or RealVideo files requires a package that Ubuntu is unable to distribute (See [[UbuntuHelp:[w32codecs|Windows Codecs]]] below for installation instructions).

Ubuntu

Totem-xine or xine are recommended for most users since MPlayer can be complicated to configure and use. If you would like to try these media players, enable the universe and multiverse repositories and install the following packages Ubuntu 6.06 (Dapper Drake)

install totem-xine xine-ui mplayer

Ubuntu 5.10 (Breezy Badger) and earlier

totem-xine xine-ui

For instructions on installing Mplayer, see MplayerInstallHowto

Kubuntu

In addition to the default kaffeine player, you could try KMplayer and Codeine. Install the packages Ubuntu 6.06 (Dapper Drake)

kmplayer codeine mplayer xine-ui

<<Anchor(w32codecs)>>

Windows Codecs

i386 distribution

Support for WMV, RealMedia and other formats has been bundled into the w32codecs package. Since this package is not supported by Ubuntu, you will need to install it from an unoffical repository. Simply type in a terminal:

wget -c ftp://ftp.nerim.net/debian-marillat/pool/main/w/w32codecs/w32codecs_20050412-0.4_i386.deb
sudo dpkg -i w32codecs_20050412-0.4_i386.deb

{X} WMV files encoded with DRM (Digital Rights Management) are not playable by the codecs. {i} If you are experiencing choppy audio when playing WMV files, try this fix.

AMD64 distribution

The [[UbuntuHelp:[w32codecs|Windows Codecs]]] cannot be used directly by the AMD64 distribution. Some people solve this problem by installing the i386 Ubuntu distribution inside a chroot (for example, Linux Vserver or dchroot), and this works very well.

PowerPC distribution

The PowerPC distribution cannot use the [[UbuntuHelp:[w32codecs|Windows Codecs]]].

Пускане на поточно видео през Интернет

Има доста програми, които могат да пускат поточно видео. Едни от най-популярните са totem-xine-firefox-plugin, totem-gstreamer-firefox-plugin и mozilla-mplayer, които са налични в universe и multiverse хранилищата. Ще трябва да инсталирате w32codecs (вижте нагоре), добавяне на universe и multiverse хранилищата и в терминал напишете: Ако използвате totem-xine:

 sudo apt-get install totem-gstreamer-firefox-plugin
 

Ако използвате totem-gstreamer:

 sudo apt-get install totem-gstreamer-firefox-plugin
 

Ако използвате mplayer:

 sudo apt-get install mozilla-mplayer
 

Ако използвате KDE и Kaffeine:

 sudo apt-get install kaffeine-mozilla
 

IconsPage?action=AttachFile&do=get&target=IconNote.png This is not needed for Konqueror; Kubuntu comes with a plugin by default. There are a variety of plugins that allow you to play streaming video in your browser. The recommended plugin is totem-xine-firefox-plugin. You should install the [[UbuntuHelp:[w32codecs|Windows Codecs]]], enable the universe repository and, install the totem-xine-firefox-plugin package.

Пускане на DVD

Повечето комерсиални DVD дискове са криптирани с CSS (the Content Scrambling System). Филмовите плейъри в Ubuntu са моат да четат DVD дискове, които не са криптирани. ако според вашите закони е легално да заобиколите CSS, тогава можете да включите четенето но криптиране DVD дискове в vlc, mplayer, xine и totem-xine като инсталирате libdvdcss2. Напишете в терминал:

  sudo apt-get install libdvdread3
  sudo /usr/share/doc/libdvdread3/examples/install-css.sh
  

{i} Забележка: С Ubuntu 6.06 (Dapper Drake), gstreamer dvd плъгина не е прехвърлен в новата версия на gstreamer - 0.10. Моля използвайте totem-xine. Most commercial DVDs are encrypted with CSS (the Content Scrambling System). The movie players provided in Ubuntu are capable of reading DVDs that are not encrypted. You can enable reading encrypted DVDs in MPlayer, xine and Totem-xine by installing libdvdcss2. IconsPage?action=AttachFile&do=get&target=IconDialog-Warning1.png Ubuntu 6.06's GNOME default version of Totem does not support playing DVDs. You must install Totem-xine in order to play DVDs using Totem. See [[UbuntuHelp:[alternateplayers|Alternative Media Players]]] for instructions.

Installing libdvdcss2 - НОВА

To install libdvdcss2, type the following in a terminal:

sudo aptitude install libdvdread3
sudo /usr/share/doc/libdvdread3/examples/install-css.sh

DVD блокиране

Ако вашия филмов плейър блокира докато се опитва да прочете DVD, ще трябва да поставите DVD диск във вашето DVD устройство и след това да направите следното:

  sudo apt-get install regionset
  regionset
  

Можете да направите това без DVD във вашето устройство ако знаете номера на вашия регион. Знайте, че софтуера твърди, че можете да сменяте региони 4 пъти, така че ефектът от тази процедура е невъзвратим и може да остави вашето устройство неспособно завинаги да чете DVD дискове кодирани за определени региони.


If your DVD player locks up on nearly every DVD movie you try to play, you probably have a DVD player that does not match your Region Code. A Region Code indicates the geographical region where the DVD was published. For example, you cannot play a DVD published in Japan on a DVD player in the United States without changing the Region Code of the DVD player. IconsPage?action=AttachFile&do=get&target=IconDialog-Warning1.png The author of regionset states that you can only change regions 4 times. The This procedure is irreversible, and may render your drive permanently unable to read DVDs encoded for your region. To change the Region Code of your DVD player, insert a DVD from your region in the DVD player, and type the following. Install the regionset package. Run regionset on the command line.

Насечено възпроизвеждане

Ако DVD възпроизвеждането е насечено или забелязвате трансфера на оптични данни (напр. запис на CD/DVD) да е по-бавен отколкото трябва да бъде, тогава ще трябва да включите DMA трансфера за това устройство. Вижте DMA страницата за детайли. If DVD playback is jerky or you notice that burning a CD/DVD is slower than it should be, then you may need to enable DMA transfer for that drive. See the DMA page for details.

RealPlayer

За да инсталирате Real'Player 10 използвайте вашия браузър за да свалите пакета realplayer_10.0.6-0.0_i386.deb на вашата система и го инсталирайте (заедно с поддръжката нужна на Real'Player - libstdc++5) като напишете в терминал:

  cd /directoriqta/v/koqto/svlihte/DEB_faila
  sudo apt-get install libstdc++5
  sudo dpkg -i realplayer_10.0.6-0.0_i386.deb
  

Вижте RealplayerInstallationMethods за други начини за инсталиране на Real'Player. Повечето от НЕ-свободните формати на Real могет да бъдат стартирани от totem-xine, xine и mplayer когато основните или w32codecs са инсталирани.

Smil

Използвайте Файловия Мениджър за да стигнете до папка съдържаща Smil файл. Натиснете с десния бутон на мишката върху файла, изберете Настройки, и след това таба Отваряне с, натиснете радио бутона срещу Real'Player 10, и затворете диалоговия прозорец.

RealMedia

Ако искате Real'Player да бъде стандартното приложение за отваряне на Real'Media файлове, използвайте Файловия Мениджър за достигнете папка съдържаща Real'Media файл. Натиснете с десния бутон на мишката върху файла, изберете Настройки, и след това таба Отваряне с'. Натиснете радио бутона срещу Real'Player 10, и затворете диалоговия прозорец.


You can install Realplayer 10 by simply typing in a terminal:

wget -c ftp://ftp.nerim.net/debian-marillat/pool/main/r/realplay/realplayer_10.0.7-0.0_i386.deb
sudo dpkg -i realplayer_10.0.7-0.0_i386.deb

IconsPage?action=AttachFile&do=get&target=IconHint2.png Most of Real's non-free media formats can be played by MPlayer, xine, and Totem-xine when either Realplayer 10 or the [[UbuntuHelp:[w32codecs|Windows Codecs]]] are installed.

Real Media

If you want Realplayer to be the default application to open particular Real'Media' file types, use the File Manager to navigate to a folder containing a sample Real'Media file. Click the file with the right mouse button, select Properties, and then the tab Open With. Click the radio button next to Real'Player 10, and close the dialog window.

Smil

Use the File Manager to navigate to a folder containing a Smil' file. Click the file with the right mouse button, select Properties, and then the tab Open With. Click the radio button next to Real'Player 10, and close the dialog window.

Macromedia Flash

Macromedia's Flash Player is only available for i386 based machines, and Shock Wave is not available at all. There are projects that are attempting to provide free support for Flash, and currently they are the only way to get Flash support for the PPC and AMD64 distributions of Ubuntu. Flash can be problematic, so if you have problems (and solutions), read Flash Issues below.

Flash for i386

To add Flash Player support for konqueror, mozilla, firefox, epiphany and other browsers, enable the multiverse repository and, in a terminal, type:

for Ubuntu 6.06 (Dapper Drake)
  sudo apt-get install flashplugin-nonfree
  sudo update-flashplugin
  

{i} Note: With Ubuntu 6.06 (Dapper Drake Flight 5), apt-get does not seem to activate flashplugin, so you will have to use the update-flashplugin to allow Mozilla Firefox to use it.

for Ubuntu 5.10 (Breezy Badger)
  sudo apt-get install flashplayer-mozilla
  
for Ubuntu 5.04 (Hoary Hedgehog)
  sudo apt-get install flashplugin-nonfree
  

Flash for AMD64 and PPC

"For those of us with 64-bit processors (or Mac) there is no non-free flash implementation available because the manufacturer does not support them. However, there are two free implementations. One is gplflash and the other is swfdec. There is also gplflash2 in development that aims to be the proper free, open source replacement for all the platforms. While you can install them using apt-get, they tend not to work very well and are unstable, so that option is not great. Better to install one of them (I recommend gplflash) manually." If you are determined, another option is to install a i386 ubuntu in a DebootstrapChroot and launch your browser with flash plugin from there.

GPLFlash

Installing from repository

To install GPLFlash enable the universe repository and type in a terminal:

  sudo apt-get install libflash-mozplugin
Installing from source

Since the GPLFlash in Ubuntu can be unstable, a better method is to compile it from source. To do this, first install some needed build packages by typing:

  sudo apt-get install libx11-dev xlibs-dev libmad0-dev libjpeg-dev checkinstall build-essential

Then, get the GPLFlash source from sf.net, compile and install it:

  wget -c http://heanet.dl.sourceforge.net/sourceforge/gplflash/gplflash-0.4.13.tar.bz2
  tar xvjf gplflash-0.4.13.tar.bz2
  cd gplflash-0.4.13
  ./configure --with-plugin-dir=/usr/lib/mozilla/plugins/
  make
  sudo checkinstall

When you restart your web browser you should have a working, stable flash plugin.

Flash Issues

Sound
Symptoms
  • Flash videos stop playing after 1 second.
  • Firefox freezes when going to another page ater having tried to view a flash video.
  • The firefox process not correctly ending after having tried to view a flash video.
Possible Fixes

After Flash is installed, if the sound is not working properly, or you experience one of the above symptoms, try one of the following solutions: Open:

  gedit ~/.mozilla/firefox/rc
  

Add the line:

  FIREFOX_DSP="none"
  

As an alternative solution, if the above doesn't solve the problem: Type the following in a terminal:

  sudo ln -s /usr/lib/libesd.so.0 /usr/lib/libesd.so.1
  
Video

If you use an Intel 855GM video card, ensure you set the X server colour depth to 24 bits, otherwise you will probably experience Firefox crashes.

Fonts

If you are viewing a Flash video and you do not see any text, the following command should help:

  sudo apt-get install gsfonts gsfonts-x11
  

Macromedia Shockwave

Installation

The Shockwave player is unfortunately only available for Windows, but it's possible to run (some) Windows programs on Linux using Wine. Wine will only work on a PC, and users of 64-bit Ubuntu may encounter problems with it. Then you will need mozplugger, which is a program that lets you "embed" other programs in your web browser. First, install Wine and mozplugger. Open a terminal and type:

  sudo apt-get install wine mozplugger
  

Then you need to install the Windows version of Firefox (yes you read that right). Download it from here: http://www.mozilla.com/firefox/all.html . Choose to open the installer with Wine and follow the instructions on the screen. When the installation has finished go to a web site that requires Shockwave and choose to get the missing plugin. When the plugin has installed and is working you may close Firefox. Now you need to configure mozplugger to use the Windows version of Firefox for Shockwave files. From a terminal, type this:

  sudo -b gedit /etc/mozpluggerrc
  

Add the following two lines to the end of the file:

  application/x-director: dir,dcr,dxr,cst,cct,cxt,w3d,fgd,swa: Macromedia Director file
	swallow(firefox.exe) fill: wine "C:\\Program Files\\Mozilla Firefox\\firefox.exe" -chrome "file://Z:$file"
  

Finally you need to make Firefox reload the plugin database. Close all Firefox windows and do this in a terminal:

  rm ~/.mozilla/firefox/pluginreg.dat
  

Now Shockwave should (hopefully) work for you. However some Shockwave objects may not work (see below).

Shockwave Issues and Workarounds

  • Objects appear in a small window of its own.

Cause 1: Wine or Shockwave is still running in the background Workaround 1: Type this in a terminal to end all wine processes:

  killall wine-preloader -s KILL
  

Cause 2: mozplugger does not handle multiple objects. I don't know how to fix this.

  • Objects claim they're being run from the harddisk

Cause: The files are first downloaded and then run from the Windows version of Firefox. Workaround: Change the /etc/mozpluggerrc file so that streaming is enabled: Change this line:

    swallow(firefox.exe) fill: wine "C:\\Program Files\\Mozilla Firefox\\firefox.exe" -chrome '''"file://Z:$file"'''
    

Into:

    swallow(firefox.exe) fill stream: wine "C:\\Program Files\\Mozilla Firefox\\firefox.exe" -chrome '''"$file"'''
    

Then remove ~/.mozilla/firefox/pluginreg.dat and restart Firefox. This may not work if you are connected using IPv6 or a proxy.

  • Objects claim they're "stolen"

Cause (when using streaming): The Shockwave object expects the "Referrer" HTTP header to be set, and it's not when using mozplugger. Workaround: None yet

AAC and iTunes Music Store

AAC decoding

The default audio format used by Apple's iTunes and iPod is AAC. This is a variant of the MPEG standard, and as such has patent issues. However, you can listen to AAC files in rhythmbox or amarok by installing gstreamer0.8-faad. You will need this for listening to any AAC file, including those bought from the iTunes Music Store (see below for more info on using the music store on Linux). Warning: songs purchased from the iTunes music store (.m4p) are encrypted and will not just play using gstreamer0.8-faad. You will need to decrypt them first.

For Ubuntu 6.06 (Dapper Drake):

Install the gstreamer-plugins-bad-multiverse package.

   sudo apt-get install gstreamer0.10-plugins-bad-multiverse
   

AAC encoding:

FAAC can be used to encode AACs, although this is somewhat experimental compared to MP3 encoding at this point. For encoding programs which use gstreamer, there is a gstreamer plugin called gstreamer0.8-faac. See CDRipping for how to encode CDs to AAC. For other programs, you may be able to utilize FAAC directly to encode to AACs using the "faac" package.

iTunes Music Store

Apple's iTunes Music Store sells music online with a large selection of artists. Songs are in 128K AAC format, and cost varies by country. Apple only has Mac and Windows clients, but it also can be used on Linux. There are two different methods by which this can be done. First of all, you can use CodeWeavers CrossOver Office (available at http://www.codeweavers.com) to install the Windows version of iTunes on Ubuntu. This will allow you to buy iTunes songs on Linux and listen to them. However, the main caveats of this approach are that 1) it costs money 2) it is not a fully Linux-native solution. As an alternative to using CrossOver, there is a new, Free program called PyMusique which allows basic usage of the iTunes Music Store on Linux. This works better than using iTunes on CrossOver, but PyMusique has fewer features than the official iTunes client at this point and may be in violation of the iTunes Music Store terms of service. To use this on Ubuntu, first install gstreamer0.8-faad and libmcrypt4. Then, go to http://fuware.nanocrew.net/pymusique/ or a mirror (google "pymusique 0.4" for mirrors) and download the pymusique, python2.4-mcrypt, python2.4-vlc, and python2.4-mp4ff packages. Finally, install all the packages you downloaded from the above website. You can now launch PyMusique from the Applications-Internet menu, and purchase songs (although you may have to restart your system for this to work). PyMusique has been superceded by SharpMusique, available from http://www.nanocrew.net/software/sharpmusique/. It is available as a .deb for Breezy Badger and allows you to preview songs, signup for an account, buy songs and albums, redownload songs that you bought, and more.

Getting Java

Blackdown Java

For Ubuntu 5.10 (Breezy Badger), the easiest method is to use the Blackdown Java 1.4 installer from Multiverse. To install Java with the installer, just do:

  sudo apt-get install j2re1.4

Ubuntu PPC, please see: JavaPPC. Ubuntu AMD64, please see: JavaAMD64.

Sun Java

The alternative method it to get the latest version from Sun. This version of Java works better for most applications. Sun's implementation of Java and Java plugin for browsers however is non-free. Free Java is in active development and will be the preferred choice once it is released. Go to http://java.sun.com/j2se/1.5.0/download.jsp and click on “Download JRE 5.0 Update 6”. Ensure you do not choose one of the JDK or J2EE versions unless you are going to develop Java applications. You must first accept the licence, then click on “Linux self-extracting file” (jre-1_5_0_06-linux-i586.bin). Save this file to your hard drive. Make the downloaded file executable. At the command line, change to the directory where you downloaded the file, and type:

  chmod +x jre-1_5_0_06-linux-i586.bin

Install the java-package and java-common, as well as fakeroot (which allows a non-root user to create the package derived from Sun's bin file):

  sudo apt-get install fakeroot java-package java-common

If you get an error when installing java-package, you need to enable the multiverse repository (see AddingRepositoriesHowto). Use make-jpkg to translate Sun's bin file into a debian package:

  fakeroot make-jpkg jre-1_5_0_06-linux-i586.bin

{i} Note: You can see warning mesages like the ones below, but there is nothing to worry about.

  mkdir: cannot create directory `/etc/.java': Permission denied
  ./jdk-1_5_0_06-linux-i586.bin: line 507: /usr/share/mime-info/java-archive.keys: Permission denied

{X} Note: If you get an error similar to this:

  Loading plugins: blackdown-j2re.sh blackdown-j2sdk.sh common.sh ibm-j2re.sh ibm-j2sdk.sh j2re.sh j2sdk.sh j2se.sh sun-j2re.sh sun-j2sdk.sh

  No matching plugin was found.

Try:

  DEB_BUILD_GNU_TYPE=i386-linux fakeroot make-jpkg jre-1_5_0_06-linux-i586.bin

or similar command if you are not using i386 architecture. Install the created package using dpkg:

  sudo dpkg -i sun-j2re1.5_1.5.0+update06_i386.deb

{i} Note: in above example, i386 might have to be i586.

Sun Java SDK (Software Development Kit)

The same procedure can also be used to install Sun's Java SDK instead of just the runtime environment (JRE). Just choose "Download JDK 5.0 Update 6" when downloading the package from Sun, and replace the file name with jdk-1_5_0_06-linux-i586.bin

Selecting the default Java version

In Ubuntu 5.10 (or Dapper), if you want to use Sun's Java instead of the open source GIJ (GNU Java bytecode interpreter) you need to set it as default. Run:

  sudo update-alternatives --config java

and select your preference from the list. {i} Note: You might want to do the same with jar, javac, javadoc, javah, javap and javaws:

  sudo update-alternatives --config jar

To get common java applications (installed using .deb-packages) to run under your JVM of choice, make sure you also edit the JVM configuration file:

  sudo -b gedit /etc/jvm

and add the line:

  /usr/lib/j2sdk1.5-sun

Packages such as ant starts the first JVM found in this file.

Sun Java J2EE SDK

At the moment, there's no possibility to create a deb as described above for the J2EE SDK so you have to download the jdk from the site http://java.sun.com and then install:

  sudo apt-get install libstdc++2.10-dev

then install as user the binary file that you have downloaded before. {i} Note:Remember to add the jar j2ee.jar in your IDE e.g. eclipse if you want to develop JSP and/or Servlet

Java on Mozilla Firefox

Installing Java without following the previous steps does not alert Firefox to its presence. If you simply executed the .bin file you downloaded, you will need to tell Firefox or Mozilla where to find the plugin library: If you do not have a .mozilla/plugins directory in your home directory, create one:

  mkdir -p /home/username/.mozilla/plugins

Then create links to plugin files:

  cd /home/username/.mozilla/plugins
  ln -s /usr/lib/j2re1.5-sun/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin_oji.so
  sudo ln -s /usr/lib/j2re1.5-sun/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla-firefox/plugins/

You can skip these steps if you used the make-jpkg command. If you have downloaded more than one, you need to modify the command to be more specific.

Java on amd64 computers

Unfortunately, Sun's Java for 64-bit PC's does't work very well yet, but the Blackdown version of Java works and is available in the Ubuntu 5.10 (Breezy Badger) Multiverse repository.

  sudo apt-get install j2re1.4 j2re1.4-mozilla-plugin

Afterwards restart Firefox and you should have a working Java plugin.