LinuxQuestions.org
Help answer threads with 0 replies.
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 01-14-2024, 02:19 PM   #1
glupa4e
Member
 
Registered: Jan 2011
Posts: 321

Rep: Reputation: 7
Unhappy Slackware 15 64 - Not Properly set JAVA_HOME


Hello,
i installed NetBeans which requires Java 8. Now i needed to install LibreOffice, which requires Java 11. I get an error that my java version is too low.
Code:
echo $JAVA_HOME
/usr/lib64/zulu-openjdk8

which java
/usr/lib64/zulu-openjdk11/bin/java

java --version
openjdk 11.0.21 2023-10-17 LTS
OpenJDK Runtime Environment Zulu11.68+17-CA (build 11.0.21+9-LTS)
OpenJDK 64-Bit Server VM Zulu11.68+17-CA (build 11.0.21+9-LTS, mixed mode)
please tell me how to proeprly set JAVA_HOME - perhaps LiberOffice checks there and that's why it fails.
 
Old 01-14-2024, 02:37 PM   #2
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,932

Rep: Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566
Code:
ls -l /etc/profile.d/*jdk*.sh
If they are both executable, they are sourced in alphabetical order.

Maybe 'chmod -x' them both, and logout/login. Then explicitly source one of them according to your need.
 
Old 01-14-2024, 02:40 PM   #3
dolphin77
Member
 
Registered: May 2009
Location: Odesa, Ukraine
Distribution: Slackware
Posts: 206

Rep: Reputation: 60
In case needed, you may simply specify $JAVA_HOME before running the program. For example like this:
Code:
user$ JAVA_HOME=/usr/lib64/zulu-openjdk11 /usr/bin/libreoffice
or do
Code:
user$ export JAVA_HOME=/usr/lib64/zulu-openjdk11
and then it will remain in that konsole (or other x terminal you use), till you close it.

If you need to set it permanently, set it in your /home/user/.bashrc, for example.
Edit: for permanent configuration better use the method provided by Petri above ^^^

Last edited by dolphin77; 01-14-2024 at 02:45 PM.
 
1 members found this post helpful.
Old 01-14-2024, 02:58 PM   #4
glupa4e
Member
 
Registered: Jan 2011
Posts: 321

Original Poster
Rep: Reputation: 7
Quote:
Originally Posted by Petri Kaukasoina View Post
Code:
ls -l /etc/profile.d/*jdk*.sh
If they are both executable, they are sourced in alphabetical order.

Maybe 'chmod -x' them both, and logout/login. Then explicitly source one of them according to your need.
Code:
ls -l /etc/profile.d/*jdk*.sh
-rwxr-xr-x 1 root root 302 jan 14 21:47 /etc/profile.d/zulu-openjdk11.sh
-rwxr-xr-x 1 root root 157 jan  2 22:08 /etc/profile.d/zulu-openjdk8.sh
sorry, i do not know how to properly source the "right version"

Code:
checking the installed JDK... configure: error: JDK is too old, you need at least 9 (10800 < 10900)
Error: build failed.
 An error occurred. Press Enter to return to main window ...

Last edited by glupa4e; 01-14-2024 at 03:03 PM.
 
Old 01-14-2024, 03:18 PM   #5
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,932

Rep: Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566
First, as root:
Code:
chmod -x /etc/profile.d/zulu-openjdk*.sh
Then logout and login. Now no JAVA variables are set.
Then if you need jdk11:
Code:
. /etc/profile.d/zulu-openjdk11.sh
# then start libreoffice stuff
The dot '.' or 'source' will read the file into current shell. Notice the space between the dot and the file name.
Or if you need jdk8:
Code:
. /etc/profile.d/zulu-openjdk8.sh
# NetBeans stuff
The variables are set only for that shell session.
 
Old 01-14-2024, 04:55 PM   #6
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 918

Rep: Reputation: 620Reputation: 620Reputation: 620Reputation: 620Reputation: 620Reputation: 620
LibreOffice is able to be built with a number of jdk versions. Similarly, netbeans is able to run with a number of jdk versions. I just installed netbeans then removed zulu-openjdk8 and installed openjdk11. After that netbeans seemed to run OK.

Therefore my suggestion is to just removepkg zulu-jdk8. Until you then logout/login again (which will clean up your java environment) you'll probably still have to source zulu-openjdk11 as others have already mentioned.


chris


BTW - if netbeans maintainer sees this thread, netbeans is now at version 20. Having it depend on zulu-openjdk11 instead of zulu-openjdk8 would also fix the OP's problem.
 
1 members found this post helpful.
Old 01-14-2024, 08:06 PM   #7
dr.s
Member
 
Registered: Feb 2010
Distribution: Slackware64-current
Posts: 340

Rep: Reputation: 156Reputation: 156
You can set JAVA_HOME to the newer JDK and configure Netbeans
to point to the older JDK, just edit netbeans.conf, see snippit below.
Another option is to simply pass --jdkhome when launching Netbeans.

Quote:
#netbeans_jdkhome="/path/to/jdk"
netbeans_jdkhome="/mnt/myjdks/jdk8"
 
1 members found this post helpful.
Old 01-15-2024, 12:41 AM   #8
glupa4e
Member
 
Registered: Jan 2011
Posts: 321

Original Poster
Rep: Reputation: 7
JAVA_HOME problem was sloved by just removing older jdks logging out and in again.
sorry for shifting the topic but libreoffice still fails to be built
Code:
checking which languages to be built... en de
checking for msgfmt... msgfmt
checking for msguniq... msguniq
configure: error: invalid language: 'en' (vs ''); supported languages are: en-US af am ar as ast be bg bn bn-IN bo br brx bs ca ca-valencia ckb cs cy da de dgo dsb dz el en-GB en-ZA eo es et eu fa fi fr fur fy ga gd gl gu gug he hsb hi hr hu id is it ja ka kab kk km kmr-Latn kn ko kok ks lb lo lt lv mai mk ml mn mni mr my nb ne nl nn nr nso oc om or pa-IN pl pt pt-BR ro ru rw sa-IN sat sd sr-Latn si sid sk sl sq sr ss st sv sw-TZ szl ta te tg th tn tr ts tt ug uk uz ve vec vi xh zh-CN zh-TW zu
Error: build failed.
something is not right with locale, but sure to where exactly fix that

Last edited by glupa4e; 01-15-2024 at 12:50 PM.
 
Old 01-15-2024, 01:31 AM   #9
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 918

Rep: Reputation: 620Reputation: 620Reputation: 620Reputation: 620Reputation: 620Reputation: 620
It looks like you set LOLANGS="en de" but what you probably want is LOLANGS="de".

From the README:
Code:
1. support additional languages by overriding the LOLANGS variable,
   whose default setting is LOLANGS="de es fr id it ja nl vi zh-CN".
   Note that en-US is always added to whatever LOLANGS is set. Thus
   building with, for example,
       LOLANGS="de" sh LibreOffice.SlackBuild
   would build LibreOffice with support for german and US english
   languages.
If you really want to specify english despite it being included by default, then you could have LOLANGS="en-US de" as the configure error message explains.


chris

Last edited by chris.willing; 01-15-2024 at 02:44 AM.
 
1 members found this post helpful.
  


Reply



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 set JAVA_HOME in catalina.sh rajaniyer123 Linux - Software 1 10-06-2007 04:34 AM
How to set JAVA_HOME in REDHAT 9.0 Linux? tejpatil Linux - Newbie 5 05-23-2004 01:17 PM
How to set JAVA_HOME in REDHAT 9.0 Linux? tejpatil Linux - General 1 05-23-2004 06:32 AM
JAVA_HOME path not set for all users tantric Linux - Software 5 03-29-2004 01:25 PM

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

All times are GMT -5. The time now is 03:23 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