Bad Class File Error

Hi Guys,
I am getting the following error :
An error occurred at line: 7 in the jsp file: /test1.jsp
Generated servlet error:
bad class file: C:\Student\Assignment2\WEB-INF\classes\ie\nci\Accommodation\DBBase.class
class file has wrong version 49.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
    AccommodationSampleHelper helper = new AccommodationSampleHelper();
                                       ^
1 error

when trying to run the below jsp file code:

%@page contentType="text/html"%>
<%@page import="ie.nci.Accommodation.*"%>
<html>
<head><title>JSP Page</title></head>
<body>
<table>
<%
    AccommodationSampleHelper helper = new AccommodationSampleHelper();
    AccommodationSample[] accommodationSamples = helper.getAllAccommodationSample() ;
   
    for (int i = 0 ; i < accomodationSamples.length ; i ++)
      {
        out.print("<TR>");
        out.print("<TD>" + accomodationSamples[i].getPaymentType() + "</TD>");
        out.print("<TD>" + accomodationSamples[i].getDescription() + "</TD>");
         
    }
%>
</table>
</body>
</html>

Any advice appreciated
LVL 17
Barry CunneyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fargoCommented:
may be the JAVA_HOME is pointing to some version which is not compatible with the class file compiled version compiler. Which java version r u using? Make sure the app is pointing to correct java version.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fargoCommented:
r u using IDE like Eclipse, NetBeans etc....
0
hoomanvCommented:
Java 1.4 creates class files labeled with version 48.0
Java 1.5 creates class files labeled with version 49.0

Java 1.4 can't run class files labeled with version 49.0

If you are getting the error, that means that you're trying to run using Java 1.4 - either you're doing it, ir (more likely) your PATH environment variable is set so that Java 1.4 is before 1.5 in the path, and it executes rather than 1.5

Solution: change JAVA_HOME so that 1.5 runs class files labeled 49.0.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.