LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-23-2017, 09:10 PM   #1
deretsigernu
Member
 
Registered: May 2007
Distribution: Slackware 14.2/-current
Posts: 185

Rep: Reputation: 13
Java install: JAVA_HOME seems to be missing


Hi, I used the instructions from here:

https://docs.slackware.com/howtos:software:java

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:
Code:
find /usr -name java
Quote:
/usr/lib64/R/share/java
/usr/lib64/jvm/bin/java
/usr/lib64/jvm/jre/bin/java
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/plugin/include/java
/usr/doc/gcc-4.8.2/gcc/java
/usr/doc/swig-2.0.10/Examples/python/java
/usr/doc/swig-2.0.10/Examples/test-suite/java
/usr/doc/swig-2.0.10/Examples/tcl/java
/usr/doc/swig-2.0.10/Examples/perl5/java
/usr/doc/swig-2.0.10/Examples/ruby/java
/usr/doc/swig-2.0.10/Examples/java
/usr/doc/libidn-1.33/contrib/java
/usr/lib/java
/usr/lib/java/bin/java
/usr/share/swig/2.0.10/java
/usr/share/java
/usr/include/c++/4.8.2/gnu/java
/usr/include/c++/4.8.2/java
How do I fix this?
 
Old 09-23-2017, 09:12 PM   #2
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
You need to log out and then log back in. It should hopefully run the profile script that will set the java variables.
 
Old 09-24-2017, 12:28 AM   #3
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by deretsigernu View Post
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.
 
1 members found this post helpful.
Old 09-24-2017, 12:45 PM   #4
deretsigernu
Member
 
Registered: May 2007
Distribution: Slackware 14.2/-current
Posts: 185

Original Poster
Rep: Reputation: 13
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.
 
Old 09-24-2017, 01:13 PM   #5
FTIO
Member
 
Registered: Mar 2015
Location: Las Vegas, NV
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
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.

Last edited by FTIO; 09-24-2017 at 01:28 PM.
 
Old 09-24-2017, 02:26 PM   #6
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by deretsigernu View Post
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.
 
1 members found this post helpful.
Old 09-24-2017, 02:43 PM   #7
deretsigernu
Member
 
Registered: May 2007
Distribution: Slackware 14.2/-current
Posts: 185

Original Poster
Rep: Reputation: 13
bassmadrigal, thanks for the info. I was not aware of the disabled plugin. I'm going to try v8.x.
 
Old 09-24-2017, 03:33 PM   #8
deretsigernu
Member
 
Registered: May 2007
Distribution: Slackware 14.2/-current
Posts: 185

Original Poster
Rep: Reputation: 13
bassmadrigal, thanks for the info. I was not aware of the disabled plugin.

I used jdk-8u144-linux-x64.tar.gz from http://www.oracle.com/technetwork/ja...s-2133151.html

I followed the instructions I referenced at start of the thread and I still get:

Code:
bash-4.2$ which java
which: no java in (/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/kde4/libexec:/usr/lib64/qt/bin:/usr/share/texmf/bin)
When I ran ./java.SlackBuild, there were several lines of output similar to

Quote:
WARNING: zero length file usr/lib64/java/lib/security/trusted.libraries
but for several directories, probably a couple of dozen in all.

Last edited by deretsigernu; 09-24-2017 at 03:35 PM. Reason: additional info
 
Old 09-24-2017, 03:58 PM   #9
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
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.
 
Old 09-24-2017, 04:15 PM   #10
deretsigernu
Member
 
Registered: May 2007
Distribution: Slackware 14.2/-current
Posts: 185

Original Poster
Rep: Reputation: 13
Yes, I logged out and back in.
 
Old 09-24-2017, 04:17 PM   #11
deretsigernu
Member
 
Registered: May 2007
Distribution: Slackware 14.2/-current
Posts: 185

Original Poster
Rep: Reputation: 13
Yes, I logged out and back in.

/etc/profile.d has no files with java in the name.
 
Old 09-24-2017, 04:41 PM   #12
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
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.
 
Old 09-24-2017, 06:10 PM   #13
deretsigernu
Member
 
Registered: May 2007
Distribution: Slackware 14.2/-current
Posts: 185

Original Poster
Rep: Reputation: 13
Backing up a little bit, at first, instead of
Code:
installpkg
I ran

Code:
upgradepkg --install-new
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?
 
Old 09-24-2017, 06:19 PM   #14
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
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/

https://slackbuilds.org/repository/1...velopment/jdk/

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
 
2 members found this post helpful.
Old 09-24-2017, 10:43 PM   #15
deretsigernu
Member
 
Registered: May 2007
Distribution: Slackware 14.2/-current
Posts: 185

Original Poster
Rep: Reputation: 13
bassmadrigal, that did it. Thank you very much!
 
  


Reply

Tags
java



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Linux Mint on Intel CPU, will the AMD Java work properly? Also JAVA_HOME nerdofdarkness Linux - Newbie 3 10-22-2013 01:10 AM
How to get/set Java version, JAVA_HOME and Classpath MughalShahzad Programming 3 07-13-2010 10:26 PM
Setting JAVA_HOME after automatic update of Java to the latest version BinDigit1 Linux - General 1 07-23-2009 06:21 PM
set up java_home path in /home/user/.bashrc but use path in /usr/lib/java vitalstrike82 Slackware 4 01-13-2009 11:25 PM
Java - JAVA_HOME problem after upgrade ssa2204 Linux - Newbie 5 08-24-2006 06:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration