Okay folks, I decided to try my hand at Java programming, but I can’t seem to find Javac.
I’ve got a shiny new OpenSuse 42.3 Leap installation on my laptop and everything would seem to indicate
that I have Java-1.8.0_openjdk installed on my system as well. Does anyone have an idea where my Javac
got to?
> zypper info java-1_8_0-openjdk
java-1_8_0-openjdk
Description :
SUSE's implementation of the OpenJDK 7 runtime environment.
It contains a Java virtual machine, runtime class libraries, and an
Java application launcher that are necessary to run programs written in
the Java programming language. It is not a development environment and
does not contain development tools such as compilers and debuggers. For
development tools, see the java-1_7_0-openjdk-devel package.
> zypper info java-1_8_0-openjdk
java-1_8_0-openjdk-devel
Description :
SUSE's implementation of the OpenJDK 7 Development Environment.
It is a development environment for building applications, applets,
and components using the Java programming language.
Okay, I think I’m catching your drift, although I can’t repeat your results exactly, I do get a confirmation
of what you’re saying - which is that I’m SOL with respect to a compiler since I only have the Runtime Environment.
Well thanks for the help, I’m off to see about installing the Oracle JDK-9.0.4 since OpenSuse doesn’t think I should be allowed
to compile anything. lol!
Thanks again.
zypper info java-1_8_0-openjdk
Loading repository data...
Reading installed packages...
Information for package java-1_8_0-openjdk:
-------------------------------------------
Repository : openSUSE-Leap-42.3-Update
Name : java-1_8_0-openjdk
Version : 1.8.0.161-21.1
Arch : x86_64
Vendor : openSUSE
Installed Size : 565.7 KiB
Installed : Yes
Status : up-to-date
Source package : java-1_8_0-openjdk-1.8.0.161-21.1.src
Summary : OpenJDK 8 Runtime Environment
Description :
The OpenJDK 8 runtime environment.
On Sun, 01 Apr 2018 01:56:01 +0000, xenrobia wrote:
> Well thanks for the help, I’m off to see about installing the Oracle
> JDK-9.0.4 since OpenSuse doesn’t think I should be allowed to compile
> anything. lol!
Just to be clear, it’s Oracle who doesn’t allow redistribution of the
Java compiler. You have to get it from Oracle directly - they
specifically don’t permit redistribution in their license.
No! Me being obtuse, sorry.
You were meant to read the package descriptions.
It [java-1_8_0-openjdk] is not a development environment and
doe s not contain development tools such as compilers and debuggers.For
development tools, see the java-1_8_0-openjdk-devel package.
To get the open-source Java Compiler you need to install the java-1_8_0-openjdk*-devel*** package.
And you were correct to do so, because shortly after that I started snooping around Yast and to my wondrous surprise I actually
located java-1_8_0-openjdk-devel package, did the installation and compiled a little program. But it did take a bit for me to find it.
So it was more like me being obtuse, but I finally got the point.
Bottom line for those new to openjdk and Oracke Java…
Despite the name “openjdk” it is <not> comparable to Oracke JDK.
openjdk only provides the runtime so is comparable to Oracle JRE.
If you want add-ons like javac which are in the Oracle JDK, for openjdk you need to install the openjdk-devel(or similarly named package for your openjdk version) as people found in this Forum thread.
Hello there Tsu2:
I’ve been considering installing the Oracle JDK 9 for some of the new features offered, namely jshell and modules. You seem to have a good handle on the installation process so I thought I’d ask you
a couple of questions, if you don’t mind.
Can I install Oracle JDK 9 along side my existing installation of the “java-1_8_0-openjdk and java-1_8_0-openjdk-devel” packages and keep my old installation as an Alternative?
If I can do the above,
Should I place my copy of **jdk-9.0.4_linux-x64_bin.rpm in the same directory as java-1_8_0-openjdk? **The current directory is **root/usr/lib64/jvm/
**3) Considering that the original installation is an openjdk as opposed to the Oracle JDK should I still use the UPDATE installation command: rpm -Uvh jdk-9.minor.security.patch_linux-x64_bin.rpm
Being that there is no patch level yet should the command be: rpm-Uvh jdk-9.0.4.0_linux-x64_bin.rpm or rpm-Uvh jdk-9.0.4_linux-x64_bin.rpm ?
I haven’t yet reviewed procedures for Oracle Java 9.
for now, a <possible> guide would be the**SDB: Installing Java
**But, it looks like it’s current only up to Oracle Java 8.
It also looks like the article has undergone a major re-write (organizing info) which was badly needed… With the many contributions since Oracle Java 7, the article was becoming very hard to follow.
'Way back for Oracle SE JDK 7, I took all the steps described, made some significant modifications and created some scripts that enabled installation in less than a couple minutes (It literally took longer to download than to install). Without those scripts, it easily took over half an hour to install.
I didn’t create scripts for Oracle JDK 8 because of the major architectural changes in the new version and questions about what the new changes did that were unclear to me.
It looks to me that the same person who created the steps published for Oracle SE JDK 7 that I modified likely created the steps now in the SDB (and accordingly will likely mean a half hour install again).
I can take a look at the existing SDB again, look to see if they apply to the newest released Oracle SE JDK and then see if I can similarly re-create the scripts to make the install quick and simple, but will take some time.
Be aware that the default installation of Oracle Java has historically been to over-write installed Java (whatever that might be). The SDB describes steps that install Oracle Java side by side (not over-writing) and then sets up update-alternatives to allow you to switch between any installed Java.
So,
Bottom line is that I can’t answer your questions about Oracle 9 at the moment, but will after a little time…
BTW -
It looks like the current latest Oracle SE JDK is version 10.
The current RPM is supposed to not over-write existing Java, and set up update-alternative automatically.
If that’s all done already, that’s cool.
I can’t check on this until tomorrow, so you can wait or go ahead and try the install.
Would think that this ought to work for both Oracke SE JRE or JDK, both versions 9 and 10.
If this works as expected,
After installing you should be able to run the following command to view and inspect all Java (both openjdk and Oracle SE) and switch to whatever is configured.
Well that’s interesting, I started looking into JDK-10 since you mentioned it and I came across information ( Wikipedia ) that implies that the next LTS ( Long Term Support ) version: Java SE 11 is due
for release September 2018. Makes me wonder if I should bother updating at all. From all problems and headaches an update seems to invite, I might just exercise a little patience and save myself some grief.
I have a package which requires Sun-Oracle JDK, according to its FAQ. It only needs old Sun 1.6 though. I have found that openjdk 1.8 seems to have the necessary gubbins (2 versions late).
A few years ago, none of the alternatives like openjdk seemed to be compatible with the official Java.
Off the top of my head, I don’t remember at which version openjdk and Oracle SE became about 99% compatible for supporting Java apps… The remaining incompatiblities were javac and some unusual add-ons like JavaFX.
Today,
Starting around openjdk 8 and Orcle SE JDK 8, even the compiler (javac) should pretty much be interchangeable to compile code, and today openjdk JavaFX should also be compatible.
For anyone simply running Java apps, the JRE have been interchangeable and compatible for a very long time.
OK, a very significant update on Oracle SE Java (several versions) on openSUSE (current testing TW but should apply to LEAP as well)…
The Oracle SE Java instructions (both for JRE and JDK) do not set up alternatives correctly on openSUSE (would be curious whether they work on RHEL).
For Oracle SE JDK 8-182, the files just install without throwing any error, but can’t be found in “update-alternatives”
For Oracle SE JDK 9 and 10, a series of non-critical errors are thrown which I remember also existed and needed to be fixed by my scripts for Oracle SE JDK 7… but again, no entries show up in update-alternatives.
Bottom line,
For anyone who wants to install Oracle SE JDK or J$E, the Oracle Install Documentation** does not work.**
If you’re in a hurry, I’d expect that the currentSDB: Installing Java should work but as I described I’d expect most people will need more than 30 minutes to complete the steps.
I will take a look at creating scripts based on the current SDB like I did for Oracle SE 7, and unless I run into obstacles should be able to provide a solution that can install Oracle Java 9 or 10 (don’t know about 8, that’s slightly different) within the next week or so. Unlike the current SDB, I expect installing by script will be effortless and complete within a couple minutes.
erlangen:~ # update-alternatives --config java
There are 4 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/java/jdk-10/bin/java 100000000 auto mode
1 /usr/java/jdk-10/bin/java 100000000 manual mode
2 /usr/java/jdk-9.0.1/bin/java 90001000 manual mode
3 /usr/lib/jalbum/jre64/bin/java 1 manual mode
4 /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java 1805 manual mode
Press <enter> to keep the current choice
[li], or type selection number: [/li]erlangen:~ #
Interesting.
I see you already had openjdk-8 installed, I assume before you installed your Oracle SE JDK.
Did you install using the Oracle RPMs or the TAR files?
I also ran my test on a TW.
Maybe I should test on a LEAP, too.
I didn’t mean this as an affirmative, would like to know which method you used to install your Oracle Java… Although the RPM is recommended for distros like openSUSE, it’s also possible to instead use the TAR file which works for all Linux distros…