[SOLVED] Java install: JAVA_HOME seems to be missing
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I got the latest version for linux from Oracle's website. The version I downloaded is jdk-9_linux_x64_bin.tar.gz and with java.SlackBuild it was turned into jdk-9_linux-i586-1.txz. The install doesn't seem to have worked correctly. The java website to test the install doesn't detect java.
I am trying to install another software with sbopkg and it looks for java as a dependency, but there is an error about java missing.
The instructions from the referenced link say that JAVA_HOME is /usr/lib64/java, but I don't have anything like that:
The java website to test the install doesn't detect java.
That requires the java plugin to be enabled on your browser for earlier versions of java (8 and earlier); even then, the plugin isn't normally enabled by default. IIRC, JDK9 doesn't include the plugin at all.
JDK 9 does things differently than earlier versions; you'll probably have some issues compiling and/or running various java programs with it. Given that JDK 9 was released only 3 days ago, I'd suggest that you start with the latest version of JDK 8 for now.
bassmadrigal, I restarted then tried to check the java variables and the website and nothing was different. I think that Richard Cranium might be on to something. I will see if I can uninstall this and use JDK 8 instead.
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618
Rep:
I've always used this command to make sure that my browsers use/see it...
EXPLOIT_ME=YES ./jdk.SlackBuild
Bleh, never mind. I just looked at it and it isn't setup the same at all as the 8 series. We're just gonna have to wait for one ot the smarter minds that knows how to do so to make the new SlackBuild for this new series.
bassmadrigal, I restarted then tried to check the java variables and the website and nothing was different. I think that Richard Cranium might be on to something. I will see if I can uninstall this and use JDK 8 instead.
Yeah, if this is the case, then it is likely that JDK9 uses a different setup than JDK8 and the SlackBuild would need tweaking to get it to work properly.
JDK8 is pretty well supported, so hopefully you can use that without issue.
But as others have mentioned, the SlackBuild does disable the java plugin by default because there are a lot of possible attack vectors with it. If you really need it, you need to run the SlackBuild with EXPLOIT_ME=YES jdk.SlackBuild, to hopefully let you know that the chances of being exploited with it are high and it is not recommended. If you are just using the website to check if your java is installed, it isn't worth it to install the java plugin. All you need to do to verify java is installed is run java. If it comes back with an error message, things aren't set up as they should be. If it dumps the help file, then it's likely installed correctly.
Did you log off and then log back on? The program adds a script to your /etc/profile.d/ directory to set up the correct variables, but you need to log off and log back on for it to take effect.
Oh, did you install the package after you ran the SlackBuild? It should be in /tmp/. The SlackBuild doesn't install the packages automatically... it just creates them.
Code:
installpkg /tmp/jdk-8u144-x86_64-1_SBo.tgz
Once installed, it should create a jdk.sh and a jdk.csh file in /etc/profile.d/ amount a lot of other files. You can either source the jdk.sh file or log out and log back in.
I went back and uninstalled it and logged out and back in and then used
Code:
installpkg
and logged out and back in and I still get "no" when I use
Code:
which java
, so it seems there a problem somewhere else?
You refer to /tmp/jdk-8u144-x86_64-1_SBo.tgz
So then I noticed the "SBo" in your latest reply.
The file I downloaded was
Quote:
jdk-8u144-linux-x64.tar.gz
and the file output from the java.SlackBuild is
Quote:
jdk-8u144-x86_64-1.txz
So java.SlackBuild is making something a little different for me, no "SBo" as I highlighted from your comment and the file is .txz for me and .tgz for you. Could this be the problem?
Oh, you're probably using the SlackBuild from extra/. To be honest, I'm not sure if that's been worked for JDK8 and was probably originally designed for JDK7... it's been years since I've used it in favor of the one on SlackBuilds. This one will add the required files into your /etc/profile.d/
You can simply just download the SlackBuild tarball, extract it, move the jdk file into it and then run that. Once it is done, install that package, replacing the other one.
Code:
wget https://slackbuilds.org/slackbuilds/14.2/development/jdk.tar.gz
tar xvf jdk.tar.gz
mv ../jdk-8u144-linux-x64.tar.gz .
sh jdk.SlackBuild
--wait a bit--
upgradepkg --install-new --reinstall /tmp/jdk-8u144-x86_64-1_SBo.tgz
source /etc/profile.d/jdk.sh
which java
That should provide the expected output.
Last edited by bassmadrigal; 09-25-2017 at 12:09 PM.
Reason: fix spelling
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.