3

I was looking up how to install java on Debian properly. Came to Debian wiki (that's one thing I really appreciate on Debian, the wiki's great), and this is the tip I got there:

Just run aptitude search "?provides(java-runtime)" on your system to list available packages).

So I thought this ?provides is some query in description, but behold:

i A default-jre                 - Standard Java or Java compatible Runtime                                                         
p   default-jre:i386            - Standard Java or Java compatible Runtime                                                         
i A default-jre-headless        - Standard Java or Java compatible Runtime (headless)                                              
p   default-jre-headless:i386   - Standard Java or Java compatible Runtime (headless)                                              
p   gcj-4.8-jre                 - Java runtime environment using GIJ/Classpath                                                     
p   gcj-4.8-jre:i386            - Java runtime environment using GIJ/Classpath                                                     
p   gcj-4.8-jre-headless        - Java runtime environment using GIJ/Classpath (headless version)                                  
p   gcj-4.8-jre-headless:i386   - Java runtime environment using GIJ/Classpath (headless version)                                  
p   gcj-4.9-jre                 - Java runtime environment using GIJ/Classpath                                                     
p   gcj-4.9-jre:i386            - Java runtime environment using GIJ/Classpath                                                     
p   gcj-4.9-jre-headless        - Java runtime environment using GIJ/Classpath (headless version)                                  
p   gcj-4.9-jre-headless:i386   - Java runtime environment using GIJ/Classpath (headless version)                                  
p   gcj-jre                     - Java runtime environment using GIJ/Classpath                                                     
p   gcj-jre:i386                - Java runtime environment using GIJ/Classpath                                                     
p   gcj-jre-headless            - Java runtime environment using GIJ/Classpath (headless version)                                  
p   gcj-jre-headless:i386       - Java runtime environment using GIJ/Classpath (headless version)                                  
i A openjdk-7-jre               - OpenJDK Java runtime, using Hotspot JIT                                                          
p   openjdk-7-jre:i386          - OpenJDK Java runtime, using Hotspot JIT                                                          
i A openjdk-7-jre-headless      - OpenJDK Java runtime, using Hotspot JIT (headless)                                               
p   openjdk-7-jre-headless:i386 - OpenJDK Java runtime, using Hotspot JIT (headless)                

The string java-runtime does not ever occur in output, which suggests there are hidden properties being queried. Which are these?

  • @perror I don't remember asking what JRE means. – Tomáš Zato Oct 6 '15 at 8:17
  • I think I was too fast reading your question, sorry. – perror Oct 6 '15 at 8:21
4

Each package has different fields. You see the package name and the short description listed, but query the Provides-field.

You can list all fields of all the available versions of a package with

$ apt-cache show openjdk-7-jre

and get (shortened, depending on your system:)

[...]

Package: openjdk-7-jre
Source: openjdk-7
Version: 7u3-2.1.7-1
[...]
Architecture: amd64
Provides: java-runtime, java2-runtime, java5-runtime, java6-runtime, java7-runtime
Depends: openjdk-7-jre-headless (= 7u3-2.1.7-1), libasound2 (>= 1.0.16), libatk1.0-0 (>= 1.12.4), libc6 (>= 2.11), libcairo2 (>= 1.2.4), libcups2 (>= 1.4.0), libfontconfig1 (>= 2.9.0), libfreetype6 (>= 2.2.1), libgdk-pixbuf2.0-0 (>= 2.22.0), libgif4 (>= 4.1.4), libglib2.0-0 (>= 2.16.0), libgtk2.0-0 (>= 2.8.0), libjpeg8 (>= 8c), libpango1.0-0 (>= 1.14.0), libpng12-0 (>= 1.2.13-4), libpulse0 (>= 0.99.1), libx11-6, libxext6, libxi6, libxrender1, libxtst6, zlib1g (>= 1:1.1.4), libxrandr2, libxinerama1, libgl1-mesa-glx | libgl1, libatk-wrapper-java-jni (>= 0.30.4-0ubuntu2)
Recommends: libgnome2-0, libgnomevfs2-0, libgconf2-4, ttf-dejavu-extra
Suggests: icedtea-7-plugin
Conflicts: icedtea-gcjwebplugin (<< 1.0-1ubuntu4)
Description-en: OpenJDK Java runtime, using Hotspot JIT
 Full Java runtime environment - needed for executing Java GUI and Webstart
 programs. Using Hotspot JIT.
 The packages are built using the IcedTea build support and patches
 from the IcedTea project.
[...]

About the listed files:

  • :i386 means the package is for the i386 architecture (not amd64 which you are probably using)
  • headless means for systems without graphical display (less dependencies)
  • gcj is the java runtime from the gcc project
  • openjdk is the more official free implementation of java which you probably want to use

See also https://askubuntu.com/questions/377750/what-is-the-difference-between-default-jdk-ecj-gcj-and-openjdk

2

aptitude has a rather extensive search syntax, and documentation for it. You can search on pretty much all the relationships that are defined for packages, including dependencies, maintainer name, architecture, etc, as well as properties like availability for download or being installed locally.

As you can probably guess, the query you ask about searches the Provides: field for the value java-runtime.

Somewhat ironically, see also the Debian Wiki

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.