MineOS not recognizing Java 8

Hello, I’m fairly new to MineOS and I’m running it off a FreeNAS server.
I was able to install the latest Forge for Minecraft 1.11, and get other players connected to my server. But once I started adding mods to the server I got errors saying some mods required Java 8 to run.

After lots of trial and error I was able to install the openjdk8 package into the MineOS jail using “pkg install openjdk8” and I even ran “java -version” to get

openjdk version “1.8.0_112”
OpenJDK Runtime Environment (build 1.8.0_112-b16)
OpenJDK 64-Bit Server VM (build 25.112-b16, mixed mode)

But even then my server returns the error “mods require java 8”
Am I missing something simple here or am I doing the whole thing wrong?

Error message:

hi SpoonlessTaco,

i don’t think it did what you thought it did. and i am not sure java 8 is your actual problem anyway (looking at FreeNAS with suspicion), but you can try this:

from the MineOS console logged in as ‘root’ you can please try exactly, not one more or less number, letter, space or punctuation mark. exactly line by line:

sh -c ‘echo “deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main” >> /etc/apt/sources.list’

sh -c ‘echo “deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main” >> /etc/apt/sources.list’

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886

apt-get update

apt-get install oracle-java8-installer

reboot

please let us know if it helps or any further error messages you get.

best regards, and good luck!

tNt

I think these lines were meant to be used with a Debian based system, not a BSD-based one, though.

Let’s check out which path MineOS is deciding to use.

Drop into your jail as the user from the webui and try out the following:

cd /usr/games/minecraft
nodejs  //should drop you into a node prompt, or try just `node`
var which = require('which');
which.sync('java');

This should return the path of the first java binary it finds; whatever it finds is 100% what MineOS is invoking, so I’m guessing that it’s finding a Java 7 binary, and your Java8 binary is not first in $PATH. Confirm?

ゆるゆり!

Hey guys, thank you so much for helping me out.
Unfortunately, I tried both of your advice and neither seemed to work :frowning:

I tried using tNt’s commands, line by line, and it returned an error saying no such file or directory. Checked the files through FTP and found that there is no /apt/ directory (although the command was recognized). Also tried the apt-get/apt-key commands and it wasn’t recognized.

I tried connecting to the mineos jail through PuTTY and the FreeNAS WebUI shell and both dropped me in as root.
For PuTTY I had to sudo into it while logged as mcserver because mcserver didn’t have permission to use jexec, yet it switched to root user once I dropped in:

Also tried cd /usr/games/minecraft and once again no such file or directory. Checked FTP and there’s no file or directory titled minecraft in /games/
Although if this is referring to the same minecraft directory that holds the server files mine is in “/var/games/minecraft” if that helps.
node or nodejs, var which, and which.sync aren’t recognized as commands either.

I do know that installing java through pkg install openjdk8 (or any similar java pkg) installs it to “/usr/local/openjdk8/” and the current Java 7 is installed in “/usr/pbi/mineos-amd64/openjdk7/”

Then it appears that you’re running into an issue introduced by FreeNAS (the plugin) rather than MineOS.

FreeNAS isn’t something I’ve released, so I’m not altogether too familiar with where it puts things. Java going in /usr/local/openjdk8/ is an example, but more prominently, I don’t know where your MineOS scripts are, which are a different directory than your world files /var/games/minecraft).

Perhaps the files are in /usr/local/games/minecraft? At any rate, if node, nodejs don’t bring up the node program, there’s another issue of FreeNAS’ conventions just something I’m not familiar with. One other thing, are you doing this in the jail or the host? The host probably doesn’t have these files.

Finding MineOS’ scripts is task one. In all of my tutorials, they are very clearly put in /usr/games/minecraft or in the case of self-installed atop BSD, /usr/local/games/minecraft. Since FreeNAS works on a plugin system, it very well could be choosing neither of the above, but that makes it no less important to know where FreeNAS (as a plugin system) puts it.

That said, node or nodejs would just help confirm the path; it’s not necessary to know, but probably pretty unambiguously helpful in figuring out what’s going wrong.

All hope is not lost, and that’s not to say that MineOS and Java 8 don’t work together (they do), but the problem we have in front of us is a barrier of knowledge with FreeNAS and its conventions.

Any of the following options are still valid, but whether you should pursue them is up to your level of familiarity; I’m guessing you’re pretty new to this stuff though, am I right?

option 1) _as the user from the webui, at the terminal, type which java. Determine if this locates your appropriate Java 8. If not, you need to adjust your $PATH.

option 2) locate the java that is being invoked. If it’s a symlink, redirect that symlink to the java you know already exists. Looks like you already located this. It’s possible to have /usr/pbi/mineos-amd64/openjdk7/ just symlink (roughly) to /usr/local/openjdk8/, but this is … potentially dangerous.

It could very well work, but FreeNAS will see a different Java than it expects (even if your Forge mods then work), so it could cause issues with the packaging system. Also, the symlink has to be from the binary to the binary, not just the paths, so it’s likely to look more like /usr/local/openjdk8/bin/java…but I also couldn’t tell you for certain because I don’t know precisely what’s on your machine and how it was installed by the packaging system. So this is the most likely easy way to get it working, but it’s also the most error-prone option. So…

option 3) install MineOS on a BSD install that isn’t FreeNAS. You’ll have both the control of where files are put (and the wealth of knowledge of other people on this site to help you)

option 4) create a BSD Jail (but not one through the FreeNAS plugin system) and install it using the above instructions

option 5) install MineOS turnkey

1 Like

Ah, I see.
Thank you very much for helping me out and trying to troubleshoot. To me it seems like my best option for now is moving to a different OS that works out of the box with MineOS and has a lot of documentation for any other errors I might run into in the future, as I also wanted to run a home media server and cloud storage stuff through the OS. I’ll give FreeNAS another try later. Researching it a bit I think I’m going to try using Ubuntu Server.
And yeah, you’re correct I am pretty new to this stuff. My forte is more on the hardware side… but I’m learning :smiley:
Now, I’ve tried looking into Turnkey but can’t seem to find a straight answer. Is it just pre-packaged tools like FreeNAS’s “Plugins” system but for Linux systems?

hola, Sir hexparrot,

in addition, ubuntu1 was not supposed to have the ‘1’ either. so all around my bad.

dear SpoonlessTaco,

i would suggest VMware or some other virtual machine as a base for your server and you would be able to achieve your goals of; [quote=“SpoonlessTaco, post:6, topic:1717”]
as I also wanted to run a home media server and cloud storage stuff through the OS
[/quote]

good luck!

tNt

Sales pitch about MineOS Turnkey on the wiki.

TL;DR the MineOS webui is a collection of node scripts, which can be installed on any *nix system.
MineOS Turnkey is that collection of scripts bundled with Java and MySQL on Debian. For all intents and purposes, installing Debian/Ubuntu and installing the scripts atop that will give you the same functional system.

1 Like