LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   javac on slackware-current? (https://www.linuxquestions.org/questions/slackware-14/javac-on-slackware-current-4175653907/)

Geremia 05-14-2019 07:11 PM

javac on slackware-current?
 
How do I compile Java programs on slackware-current? javac isn't in GCC anymore.

USUARIONUEVO 05-14-2019 07:16 PM

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

Richard Cranium 05-14-2019 08:15 PM

Quote:

Originally Posted by Geremia (Post 5995086)
How do I compile Java programs on slackware-current? javac isn't in GCC anymore.

I trot off and get a copy of OpenJDK for the version I need and unpack it in /opt. I use jenv to manage the various versions that I need.

Your use case may be much simpler than mine have been.

(FWIW, I don't claim that /opt is the best place for JDK installations. /usr/local/ is probably better.)

Geremia 05-14-2019 10:56 PM

Quote:

Originally Posted by Richard Cranium (Post 5995099)
I trot off and get a copy of OpenJDK for the version I need and unpack it in /opt. I use jenv to manage the various versions that I need.

Ah, that was the issue. I do have
Code:

# grep javac /var/log/packages/openjdk-8u201_b08-x86_64-1alien
usr/lib64/java/bin/javac

, but, yes, I need some sort of environment variable manager.

3rensho 05-14-2019 11:09 PM

The 8u212 version is available. I built openjdk using AlienBob's script.

$ javac -version
javac 1.8.0_212

$ which javac
/usr/lib64/java/bin/javac

Alien Bob 05-15-2019 04:14 AM

Quote:

Originally Posted by Geremia (Post 5995130)
Ah, that was the issue. I do have
Code:

# grep javac /var/log/packages/openjdk-8u201_b08-x86_64-1alien
usr/lib64/java/bin/javac

, but, yes, I need some sort of environment variable manager.

If you installed my package, it installs a file in /etc/profile.d/ which gets executed at login. It sets the $PATH so that the java and javac binaries are found.
I think you either forgot to logout/login or to "source /etc/profile.d/openjdk.sh".

Alien Bob 05-15-2019 04:17 AM

Quote:

Originally Posted by 3rensho (Post 5995131)
The 8u212 version is available. I built openjdk using AlienBob's script.

$ javac -version
javac 1.8.0_212

$ which javac
/usr/lib64/java/bin/javac

Essentially the same as my openjdk-8u201_b08 package - the devs forgot to update the version properly. After I built my package from source, they re-released those same sources but with a correct version number (1.8.0_212 instead of 1.8.0_201). I was not bothered to create the packages anew unless someone would complain, and no one did.


All times are GMT -5. The time now is 04:46 AM.