UnsupportedClassVersionError:

0

I'm new to this and I'm setting up my website on a VPS server.

I have already installed it in easypache and tomcat 7, I can already see my homepage, but if I try to load some jsp page that has a java code it gives me this error.

  

javax.servlet.ServletException:   java.lang.UnsupportedClassVersionError:

Look it up on the Internet and say the following:

  

UnsupportedClassVersionError always appears when you compile "with"   one version (targeting one version) and execute with a previous java   version.

     

JAVA_HOME does not tell the operating system where should it look for   the java.exe file. The operating system will take that file from the   PATH variable. That's why it's recommended to add at the beginning of   the PATH variable, the path JAVA_HOME / bin.

Because of the above I understand that you are compiling with a lower version and that's why you have that problem.

But I do not know how to fix this problem.

Some help would be greatly appreciated.

I have already been able to verify what the JDK / JRE version is on my server.

java version "1.7.0_141"

As we already know the problem is that the webaplication was created in neteban using version 1.8.0.131

This I already knew, but the problem I have is how to make the version of my server also 1.8.0.131.

Thank you, I hope you can help me.

    
asked by eliasith sandi 28.06.2017 в 02:24
source

1 answer

0
  

Because of the above, I understand that you are compiling with a lower version and that's why you have this problem.

Actually the problem is the other way around. For example, let's say that your code has been compiled by pointing to Java 8 but you are running it in a JDK / JRE that points to Java 7 or earlier.

I recommend you check the JDK / JRE version that you have installed on your server. You can do it with the following command:

java -version

After that, you will see a message as follows:

  

java version "1.8.0_92"
  Java (TM) SE Runtime Environment (build 1.8.0_92-b14)
  Java HotSpot (TM) 64-Bit Server VM (build 25.92-b14, mixed mode)

In my case, the team I work on has Java 8 installed.

Solutions (are excluding):

  • Install the latest version of the JDK / JRE on your server. If it is not available in a simple way or you do not have direct control over the equipment, contact an administrator or staff to help you with this maintenance.
  • Recompile your project using the same version (or previous) of Java that the server has. This can have many problems, especially with code that is not compatible in previous versions.
  • Recommendation: install the latest version of the JDK / JRE.

        
    answered by 28.06.2017 в 02:53