Java is installed but...
Java is installed on my server but when i start server it says Error: Could not find or load main class java
Whats the problem?
most likely you don't have java in your path.
How can i fix that?
do echo "$PATH" in the linux console and post the results here.
Here it is:
as you can see, your java doesn't have the path in there. you have to install the latest version of java following the guide for your operating system.
CentOS/RHEL and Fedora : http://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/
Ubuntu and LinuxMint: http://tecadmin.net/install-oracle-java-8-jdk-8-ubuntu-via-ppa/
In case you're on ubuntu and you're following that guide and the add-apt-repository does not exist, use the "apt-get install software-properties-common" command to install it.
That should make everything work for your java installation.
Error: Could not find or load main class java
That error is because you set the Java arguments wrong. You don't add the command to the start-up parameters. You have Java installed fine, but screwed up the parameters.
I fixed it. I didnt read the startup parameters. I dont need to put "java" on the startup parameter. It needs to start without java like this :
(java goes here) -Xmx7G -Xms7G -jar spigot.jar