Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #190972 > unrolled thread

java, javac versions not the same, apt-get doesn't help ...

Started byAlbretch Mueller <lbrtchx@gmail.com>
First post2018-01-12 10:30 +0100
Last post2018-01-12 15:20 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.debian.user


Contents

  java, javac versions not the same, apt-get doesn't help ... Albretch Mueller <lbrtchx@gmail.com> - 2018-01-12 10:30 +0100
    Re: java, javac versions not the same, apt-get doesn't help ... Bastien Durel <bastien@durel.org> - 2018-01-12 11:00 +0100
      Re: java, javac versions not the same, apt-get doesn't help ... Albretch Mueller <lbrtchx@gmail.com> - 2018-01-12 15:20 +0100

#190972 — java, javac versions not the same, apt-get doesn't help ...

FromAlbretch Mueller <lbrtchx@gmail.com>
Date2018-01-12 10:30 +0100
Subjectjava, javac versions not the same, apt-get doesn't help ...
Message-ID<v73OV-5ZW-7@gated-at.bofh.it>
java gives you error messages when you compile and run code with
different versions of the JVM

while trying to update my box using apt-get I am getting:
"openjdk-8-jdk is already the newest version."

How do you make sure you install the same version of both java and
javac using apt-get?

lbrtchx
~
$ uname -a
Linux IBMThnkPdT60 3.16.0-4-686-pae #1 SMP Debian 3.16.36-1+deb8u1
(2016-09-03) i686 GNU/Linux

$ java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-1~bpo8+1-b11)
OpenJDK Server VM (build 25.131-b11, mixed mode)

$ javac -version
javac 1.7.0_111


# _LOG_FL="openjdk-8-jdk_install_$(date +%Y%m%d%H%M%S).log"

# uname -a >> "${_LOG_FL}" 2>&1

# time(apt-get -V install openjdk-8-jdk) >> "${_LOG_FL}" 2>&1

# cat openjdk-8-jdk_install_20180112040601.log
Linux IBMThnkPdT60 3.16.0-4-686-pae
#1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) i686 GNU/Linux

Reading package lists...
Building dependency tree...
Reading state information...
openjdk-8-jdk is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 365 not upgraded.

real    0m3.571s
user    0m0.672s
sys     0m0.092s

# java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-1~bpo8+1-b11)
OpenJDK Server VM (build 25.131-b11, mixed mode)

# javac -version
javac 1.7.0_111

[toc] | [next] | [standalone]


#190974

FromBastien Durel <bastien@durel.org>
Date2018-01-12 11:00 +0100
Message-ID<v74hX-6bu-1@gated-at.bofh.it>
In reply to#190972
Le vendredi 12 janvier 2018 à 04:20 -0500, Albretch Mueller a écrit :
> java gives you error messages when you compile and run code with
> different versions of the JVM
> 
> while trying to update my box using apt-get I am getting:
> "openjdk-8-jdk is already the newest version."
> 
> How do you make sure you install the same version of both java and
> javac using apt-get?
> 
> lbrtchx
> ~
> $ uname -a
> Linux IBMThnkPdT60 3.16.0-4-686-pae #1 SMP Debian 3.16.36-1+deb8u1
> (2016-09-03) i686 GNU/Linux
> 
> $ java -version
> openjdk version "1.8.0_131"
> OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-1~bpo8+1-b11)
> OpenJDK Server VM (build 25.131-b11, mixed mode)
> 
> $ javac -version
> javac 1.7.0_111
> 
> 
> # _LOG_FL="openjdk-8-jdk_install_$(date +%Y%m%d%H%M%S).log"
> 
> # uname -a >> "${_LOG_FL}" 2>&1
> 
> # time(apt-get -V install openjdk-8-jdk) >> "${_LOG_FL}" 2>&1
> 
> # cat openjdk-8-jdk_install_20180112040601.log
> Linux IBMThnkPdT60 3.16.0-4-686-pae
> #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) i686 GNU/Linux
> 
> Reading package lists...
> Building dependency tree...
> Reading state information...
> openjdk-8-jdk is already the newest version.
> 0 upgraded, 0 newly installed, 0 to remove and 365 not upgraded.
> 
> real    0m3.571s
> user    0m0.672s
> sys     0m0.092s
> 
> # java -version
> openjdk version "1.8.0_131"
> OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-1~bpo8+1-b11)
> OpenJDK Server VM (build 25.131-b11, mixed mode)
> 
> # javac -version
> javac 1.7.0_111
> 
You d'like to look at your alternatives

$ ls -l /etc/alternatives/java*
lrwxrwxrwx 1 root root 46 juil.  2  2017 /etc/alternatives/java ->
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
lrwxrwxrwx 1 root root 56 juil.  2  2017 /etc/alternatives/java.1.gz ->
/usr/lib/jvm/java-8-openjdk-amd64/jre/man/man1/java.1.gz
lrwxrwxrwx 1 root root 39 déc.  14  2010 /etc/alternatives/java_vm ->
/usr/lib/jvm/java-6-sun/jre/bin/java_vm
lrwxrwxrwx 1 root root 38 déc.  14  2010 /etc/alternatives/javaws ->
/usr/lib/jvm/java-6-sun/jre/bin/javaws
lrwxrwxrwx 1 root root 48 déc.  14  2010 /etc/alternatives/javaws.1.gz
-> /usr/lib/jvm/java-6-sun/jre/man/man1/javaws.1.gz

On this box, java and javaws use different java versions
You can set them using update-alternatives(1) -- or update-java-
alternatives(8) for java

-- 
Bastien

[toc] | [prev] | [next] | [standalone]


#190984

FromAlbretch Mueller <lbrtchx@gmail.com>
Date2018-01-12 15:20 +0100
Message-ID<v78lA-Px-7@gated-at.bofh.it>
In reply to#190974
On 1/12/18, Bastien Durel <bastien@durel.org> wrote:
> Le vendredi 12 janvier 2018 à 04:20 -0500, Albretch Mueller a écrit :
>> java gives you error messages when you compile and run code with
>> different versions of the JVM
>>
>> while trying to update my box using apt-get I am getting:
>> "openjdk-8-jdk is already the newest version."
>>
>> How do you make sure you install the same version of both java and
>> javac using apt-get?
>>
>> lbrtchx
>> ~
>> $ uname -a
>> Linux IBMThnkPdT60 3.16.0-4-686-pae #1 SMP Debian 3.16.36-1+deb8u1
>> (2016-09-03) i686 GNU/Linux
>>
>> $ java -version
>> openjdk version "1.8.0_131"
>> OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-1~bpo8+1-b11)
>> OpenJDK Server VM (build 25.131-b11, mixed mode)
>>
>> $ javac -version
>> javac 1.7.0_111
>>
>>
>> # _LOG_FL="openjdk-8-jdk_install_$(date +%Y%m%d%H%M%S).log"
>>
>> # uname -a >> "${_LOG_FL}" 2>&1
>>
>> # time(apt-get -V install openjdk-8-jdk) >> "${_LOG_FL}" 2>&1
>>
>> # cat openjdk-8-jdk_install_20180112040601.log
>> Linux IBMThnkPdT60 3.16.0-4-686-pae
>> #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) i686 GNU/Linux
>>
>> Reading package lists...
>> Building dependency tree...
>> Reading state information...
>> openjdk-8-jdk is already the newest version.
>> 0 upgraded, 0 newly installed, 0 to remove and 365 not upgraded.
>>
>> real    0m3.571s
>> user    0m0.672s
>> sys     0m0.092s
>>
>> # java -version
>> openjdk version "1.8.0_131"
>> OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-1~bpo8+1-b11)
>> OpenJDK Server VM (build 25.131-b11, mixed mode)
>>
>> # javac -version
>> javac 1.7.0_111
>>
> You d'like to look at your alternatives
>
> $ ls -l /etc/alternatives/java*
> lrwxrwxrwx 1 root root 46 juil.  2  2017 /etc/alternatives/java ->
> /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
> lrwxrwxrwx 1 root root 56 juil.  2  2017 /etc/alternatives/java.1.gz ->
> /usr/lib/jvm/java-8-openjdk-amd64/jre/man/man1/java.1.gz
> lrwxrwxrwx 1 root root 39 déc.  14  2010 /etc/alternatives/java_vm ->
> /usr/lib/jvm/java-6-sun/jre/bin/java_vm
> lrwxrwxrwx 1 root root 38 déc.  14  2010 /etc/alternatives/javaws ->
> /usr/lib/jvm/java-6-sun/jre/bin/javaws
> lrwxrwxrwx 1 root root 48 déc.  14  2010 /etc/alternatives/javaws.1.gz
> -> /usr/lib/jvm/java-6-sun/jre/man/man1/javaws.1.gz
>
> On this box, java and javaws use different java versions
> You can set them using update-alternatives(1) -- or update-java-
> alternatives(8) for java

 Well, yes, but, based on my poor understanding of such matters, how
can you change the alternatives if apt-get doesn't install more
updated versions? I think you should be able to specify to the
differencet utilities in the jdk. This is what I got in my env:

$ ls -l /etc/alternatives/java*
lrwxrwxrwx 1 root root 45 Dec 17 18:16 /etc/alternatives/java ->
/usr/lib/jvm/java-8-openjdk-i386/jre/bin/java
lrwxrwxrwx 1 root root 55 Dec 17 18:16 /etc/alternatives/java.1.gz ->
/usr/lib/jvm/java-8-openjdk-i386/jre/man/man1/java.1.gz
lrwxrwxrwx 1 root root 42 Nov 11 22:14 /etc/alternatives/javac ->
/usr/lib/jvm/java-7-openjdk-i386/bin/javac
lrwxrwxrwx 1 root root 52 Nov 11 22:14 /etc/alternatives/javac.1.gz ->
/usr/lib/jvm/java-7-openjdk-i386/man/man1/javac.1.gz
lrwxrwxrwx 1 root root 44 Nov 11 22:14 /etc/alternatives/javadoc ->
/usr/lib/jvm/java-7-openjdk-i386/bin/javadoc
lrwxrwxrwx 1 root root 54 Nov 11 22:14 /etc/alternatives/javadoc.1.gz
-> /usr/lib/jvm/java-7-openjdk-i386/man/man1/javadoc.1.gz
lrwxrwxrwx 1 root root 42 Nov 11 22:14 /etc/alternatives/javah ->
/usr/lib/jvm/java-7-openjdk-i386/bin/javah
lrwxrwxrwx 1 root root 52 Nov 11 22:14 /etc/alternatives/javah.1.gz ->
/usr/lib/jvm/java-7-openjdk-i386/man/man1/javah.1.gz
lrwxrwxrwx 1 root root 42 Nov 11 22:14 /etc/alternatives/javap ->
/usr/lib/jvm/java-7-openjdk-i386/bin/javap
lrwxrwxrwx 1 root root 52 Nov 11 22:14 /etc/alternatives/javap.1.gz ->
/usr/lib/jvm/java-7-openjdk-i386/man/man1/javap.1.gz
$

# 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-7-openjdk-i386/jre/bin/java   1071
  auto mode
  1            /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java   1071
  manual mode
* 2            /usr/lib/jvm/java-8-openjdk-i386/jre/bin/java   1069
  manual mode

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

# update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).

  Selection    Path                                        Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-7-openjdk-i386/bin/javac   1071      auto mode
  1            /usr/lib/jvm/java-7-openjdk-i386/bin/javac   1071
manual mode
  2            /usr/lib/jvm/java-8-openjdk-i386/bin/javac   1069
manual mode

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web