5
PacRat
7y

yes, i know this isn't omg! ubuntu

yes i know it's obviously not StOve (you guys are way too nice)

but im going to look like an idiot for asking this here. my process is a rollercoaster to read so bear with me

context:
· xubuntu 17.10
· zsh (not that it matters)

° i want to be able to use java -jar file.jar

i tried using that command
zsh: java: permission denied

then used sudo
sudo: java: command not found

i grabbed the generic x64 tar.gz and extracted to ~/.local/.app/java/
set the Java path to the openjdk folder inside, no good

i installed openjdk-8-jre
couldnt figure it out that way, so uninstalled

RE-GRABBED the x64 tarball
extracted into /usr/java
set the path to the folder containing java & javaws executables

still no luck

what is the problem here

Comments
  • 2
    I'd always stick with platform-specific install packages. Did you fuck with the ownership of any system directories?
  • 0
    Can you run Java --version (or whatever the command is)?
  • 2
    update: a really hacky fix
    in ~/.zshrc
    alias java='sh /usr/java/jre1.8.0_151/bin/java'

    please help im on painkillers and my foot is slowly blistering
  • 2
    @AlgoRythm i DOUBLE CHECKED my $JAVA_HOME in /etc/environment, made sure that zsh sourced the enviro variables, and this is what i have

    also the hacky workaround actually didn't work. i was able to execute the java executable when i was in the directory

    to test i ran
    sh java -jar
    and got a "missing file operand" error... so it works i guess, but when i do it outside of that directory it dosen't work.
  • 2
    sudo apt update
    sudo apt install openjdk-8-jre
    sudo reboot (Just to be safe)
    Tell me what that does
  • 0
    i weep
    should i remove the $JAVA_HOME variable in /etc/environment?
    @AlgoRythm
  • 0
    @killermenpl i ran a find command and removed all the java directories i had, removed the $JAVA_HOME enviro variable, and removed the openjdk package, rebooted
    then i ran
    sudo apt install openjdk-8-jre
    and rebooted again,
    i got this
  • 1
    Yeah, grab openjdk9 from apt, the generic tarballs are really hacky to use.

    I think i had to add a blank jar to startup so it would load from PATH??? Something like that but yeah, just use apt.
  • 0
    Ooor you can also get oracle-java9-installer i guess
  • 0
    Could you run
    sudo update-alternatives --config java
    To check if it conflicts with something?
  • 0
    @BindView Thanks!
    but i've heard that 1.9 has issues, was there a 1.8 installer by any chance?
  • 0
    Ye just substitute it with 8
  • 0
    @BindView here's what update-alternatives gave me
  • 2
    @BindView heyyyy looky there! i cant believe i never saw anything for this. thanks man!
  • 6
    You r welcome. Dont forget to like upvote subscribe google+ follow hail hypnotoad.
  • 1
    @BindView HELLZ YEAH WELCOME TO THE WOOOOORRLD OF TOMORROOOW!!!!!!!! lol FUTURAMA WILL NEVER DIE
  • 0
    Don't know if still needed but I always use this thing on Ubuntu. Works always.
    https://launchpad.net/~webupd8team/...
Add Comment