• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1586
  • Last Modified:

java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main (Unsupported major.minor version 48.0) what is this?!

i encountered this error suddenly.
Not really sure what's went wrong. Some of my jsp pages which i did previously have this errors also.
But some still works fine. Can anyone please help me with this?
Really dont understand what this exception means.
javax.servlet.ServletException: com/sun/tools/javac/Main (Unsupported major.minor version 48.0)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
      at java.lang.Thread.run(Thread.java:484)


root cause

java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main (Unsupported major.minor version 48.0)
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at org.apache.catalina.loader.StandardClassLoader.findClass(StandardClassLoader.java:621)
      at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:958)
      at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:857)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:120)
      at org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.doesModernCompilerExist(CompilerAdapterFactory.java:173)
      at org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:131)
      at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:833)
      at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:682)
      at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:308)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
      at java.lang.Thread.run(Thread.java:484)

0
iCeFiRe
Asked:
iCeFiRe
  • 13
  • 11
  • +1
1 Solution
 
iCeFiReAuthor Commented:
and some of the page, which are not working, doesnt involve jsp at all
one of them is the login page

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>de-conexion Login</title>
<link rel="stylesheet" type="text/css" href="../conexion.css">
</head>
<body>
<%@ include file ="../htm/top.htm" %>
<%@ include file="../htm/left.htm"%>
<h1 align="left" class = "BigTitle">Login Page</h1>
<p align="left">&nbsp;</p>
<div align="center">
  <center>
  <table border="0">
    <tr>
      <td class="smallTextsFade">Not yet a member? <a href="frmRegMem.jsp">SignUp</a> for FREE now.</td>
    </tr>
     </table>
  <table border="0">
<form method = "post" action="processLogin.jsp">
    <tr>
      <td class="smallTextsFade">Email:</td>
      <td><input type="text" name="email" size="20" class="smallTextsFade"></td>
    </tr>
    <tr>
      <td class="smallTextsFade">Password:</td>
      <td><input type="password" name="password" size="20" class="smallTextsFade"></td>
    </tr>
    <tr>
      <td colspan="2">
        <p align="center"><input type="submit" value="Login" name="Submit"> <input type="reset" value="Reset" name="Reset"></td>
    </tr>
</form>
  </table>

</center>
</div>

<p align="center"><a href="http://forgetpass.htm">&nbsp;&nbsp;&nbsp;
&gt;&gt;Forget Password?</a></p>

</body>

</html>

this is the code for my login.jsp
0
 
thanassisCommented:
The problem you have is caused (I am pretty sure) because your java versions are probably out of sync.

It is possible that tomcat isn't fully compatible with jdk version you use.
0
 
cheekycjCommented:
try reverting to jdk 1.3.1

CJ
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
kennethxuCommented:
you might have multiple version of jdk installed, uninstall all of them and re-install only one jdk.

BTW, which version of tomcat are you using?
0
 
iCeFiReAuthor Commented:
i am using tom-cat 4.1.18
but all the while i am fine with it. how come?
how to uninstall jdk?
0
 
kennethxuCommented:
>> how to uninstall jdk?
go to control panel, add/remove programs in windows platform.

when you download tomcat. there are 2 version, one version is for jdk1.4, which version did you downloaded?
0
 
iCeFiReAuthor Commented:
i downloaded j2sdk-1_4_1_01-windows-i586.exe
jdk1.4
but when i install my tomcat
it keeps on prompting me that it found a jdk1.3.1 in my c:
0
 
kennethxuCommented:
you should download LE-jdk14 version of tomcat
http://jakarta.apache.org/builds/jakarta-tomcat-4.0/archives/v4.1.18/bin/jakarta-tomcat-4.1.18-LE-jdk14.exe

did you tried to remove the 1.3 jdk from control panel?
0
 
iCeFiReAuthor Commented:
ya.
i remove it
but it still there in the c: folder after i removed from program using control panel.
what i should use for jdk?
1.4.1_02 or 01?
0
 
iCeFiReAuthor Commented:
ya.
i remove it
but it still there in the c: folder after i removed from program using control panel.
what i should use for jdk?
1.4.1_02 or 01?
0
 
iCeFiReAuthor Commented:
but no matter how i remove the folder. and downloaded the tomcat u recommend
it still not working.
even i tried installing the tomcat u mentioned. it also prompt jdk found, C:\jdk1.3.1
but i couldnt see any jdk1.3.1 in control panel, add/remove program
0
 
iCeFiReAuthor Commented:
but no matter how i remove the folder. and downloaded the tomcat u recommend
it still not working.
even i tried installing the tomcat u mentioned. it also prompt jdk found, C:\jdk1.3.1
but i couldnt see any jdk1.3.1 in control panel, add/remove program
0
 
kennethxuCommented:
go to control panel, system, check the environment vars
JAVA_HOME
PATH
take out the jdk1.3.1

>> 1.4.1_02 or 01
get the latest one, i think it's 1.4.1_02 now.
0
 
iCeFiReAuthor Commented:
where can i find the environment vars?
i go to system
but cannot see environment vars
or java_home and path
0
 
kennethxuCommented:
there is button near the bottom of advanced tab in windows XP, cannot remember where it is in other windws OS. look around, it must be there.
0
 
iCeFiReAuthor Commented:
i am using window me
there is no advance tab in system
0
 
kennethxuCommented:
for windows ME, check your env setting in autoexec.bat
you need to restart window for your change to take effect.
0
 
kennethxuCommented:
sorry, i was thinking it is at least Windows NT :)
0
 
iCeFiReAuthor Commented:
oh...it's ok. i also wondering why my company will choose windows ME
0
 
kennethxuCommented:
the steps should be:
1. install jdk1.4.1
2. edit c:\autoexec.bat make sure
JAVA_HOME=C:\JDK1.4.1 (where you install jdk)
PATH includes C:\JDK1.4.1\bin
3. restart ME.
4. install tomcat.
0
 
iCeFiReAuthor Commented:
but..where can i find my autoexec.bat?
0
 
kennethxuCommented:
c:\autoexec.bat
0
 
kennethxuCommented:
late here, will see you tomorrow.
0
 
iCeFiReAuthor Commented:
Thanks kennethxu!
You are so great!
it works. Finally...Really Really thanks!
0
 
iCeFiReAuthor Commented:
sorry, guys, as kennethxu really guide me step by step and help me the most on this question. i think he should be the one who get the points from me for this question.
Thanks alot guys!
0
 
kennethxuCommented:
glad to know it is working for you, and as always, my pleasure to help :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 13
  • 11
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now