bad class file error

A

AC

I keep getting an error when I try to import a jar file into a JSP
using myEclipse:

<%@ page import = "java.util.*,
...
com.directory.class_A,
com.directory.class_B"
%>

The .class files for these classes are in a jar file that is in the
Java build path.

The jar file looks like this:
jar -tf myJar.jar
META-INF/
META-INF/MANIFEST.MF
com/directory/class_A.class
com/directory/class_B.class

The error says:
cannot access com.directory.class_A: bad class file:
/directory/myJar.jar(com/directory/class_A.class). NOTE: No JSP line
number was avaliable so line 1 was used for the marker.

If I switch the order of class_A and class_B, I get the same error for
class_B.

I can't figure out why these classes aren't found. Anybody have an
idea?

Thanks in advance.
 
C

chris brat

Hi,

What JDK and JRE versions are you using?

Have you confirmed that they are compatible?

Chris
 
A

AC

I'm using:

Eclipse SDK
Version: 3.1.1
Build id: M20050929-0840
java -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-112)
 
A

AC

"I forced Eclipse to use the JDK in the installation directory through
the -vm startup parameter, and the error does not appear anymore."

How do you do this? I've been looking around at the preferences and
through the help manual, but I have not solved this yet.

Thanks for your help.
 
A

AC

In other words, what is the JDK in the installation directory? I don't
see any JDK there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,283
Latest member
JoannaGrif

Latest Threads

Top