File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Exception" Watch "Exception" New topic
Author

Exception

Tontang Bei
Ranch Hand

Joined: Oct 21, 2006
Posts: 130
why is the code below giving me an exception?

Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
What is productPrice[4][4]?
Tontang Bei
Ranch Hand

Joined: Oct 21, 2006
Posts: 130
Okay even productPrice[1] is giving the exception. And shouldnt it be an ArrayoutofBOuds exception if this was the problem? This exception is:

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class f
e
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
That looks like you have an older version of the .class file you are trying to run.

Are you sure that you are interpreting the right class?
Tontang Bei
Ranch Hand

Joined: Oct 21, 2006
Posts: 130
Yes, Am I the only one getting this exception. could someone else verify for me please?
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
I don't get that exception.

Make sure that there is no older version of MainApplication.class in your current directory and try

 
 
subject: Exception