-2

I have downloaded tomcat into home/username/web/tomcat. in the bin folder i created file setenv.sh:

JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64

then i started tomcat (sh startup.sh) and got message

Using CATALINA_BASE:   /home/username/web/tomcat
Using CATALINA_HOME:   /home/username/web/tomcat
Using CATALINA_TMPDIR: /home/username/web/tomcat/temp
Using JRE_HOME:        /usr/lib/jvm/java-7-openjdk-amd64
Using CLASSPATH:       /home/username/web/tomcat/bin/bootstrap.jar:/home/username/web/tomcat/bin/tomcat-juli.jar
Tomcat started.

However when I go to http://localhost:8080/ in my browser I get the error message :

This webpage is not available

ERR_CONNECTION_REFUSED

What could go wrong?

Catalina.out has following:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/catalina/startup/Bootstrap : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:64)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:312)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482

The problem was in old version of jdk. Tomcat needed the last version of Java

evg
  • 29
  • 7
  • check logs files – user12384512 Aug 17 '17 at 10:58
  • 1
    You 'get the error message' such as what? Off topic. – user207421 Aug 17 '17 at 10:58
  • this:This webpage is not available ERR_CONNECTION_REFUSED – evg Aug 17 '17 at 10:59
  • So it isn't listening at port 8080. So either configure it so it is, or browse to it at the port it *is* listening to, or see whether it started up at all. Off topic. – user207421 Aug 17 '17 at 11:01
  • Possible duplicate of [Tomcat won't load default web page in browser](https://stackoverflow.com/questions/33636886/tomcat-wont-load-default-web-page-in-browser) – Unknown Aug 17 '17 at 11:03
  • Tried doing some prior research? – GhostCat Aug 17 '17 at 11:08
  • [how-to-fix-java-unsupported-major-minor-version](https://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi) – Hugues M. Aug 17 '17 at 11:19
  • Possible duplicate of [How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version](https://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi) – Olaf Kock Aug 17 '17 at 13:55

1 Answers1

2

startup.bat typically opens a new command line. If the new command line closes immediately, it's hard to recognize the error message that's displayed for fractions of a second.

You can check error messages in tomcat's log/catalina.out or see them interactively by using catalina.bat run - this will not open a new window and not go to the background - instead start Tomcat in the current command line window, displaying all the log information. It should be easy to spot the problem this way.

Harsh
  • 243
  • 3
  • 20
  • This doesn't answer the question. It should be a comment, not an answer. I know , you cant comment yet - but that doesnt mean you should misuse *answers* to give comments. – GhostCat Aug 17 '17 at 11:09
  • sorry @GhostCat, I have to comment but it can not possible. – Harsh Aug 17 '17 at 11:18
  • Please note that i didnt downvote or flag your answer. And hey, you even reached comment level. What I am saying: I have seen much worse comment answers ... – GhostCat Aug 17 '17 at 11:19