LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Exception in thread "main" java.lang.ClassFormatError: onmyown.Main (unrecognized cla (https://www.linuxquestions.org/questions/fedora-35/exception-in-thread-main-java-lang-classformaterror-onmyown-main-unrecognized-cla-570728/)

zimboney 07-19-2007 11:48 AM

Exception in thread "main" java.lang.ClassFormatError: onmyown.Main (unrecognized cla
 
So I'm trying to run a program I made in java netbeans....I am using fc7 it builds ok but when I try to run it in terminal I get errors this is what happened

java -jar "/home/zimboney/onMyOwn/dist/onMyOwn.jar"

Exception in thread "main" java.lang.ClassFormatError: onmyown.Main (unrecognized class file version)
at java.lang.VMClassLoader.defineClass(libgcj.so.8rh)
at java.lang.ClassLoader.defineClass(libgcj.so.8rh)
at java.security.SecureClassLoader.defineClass(libgcj.so.8rh)
at java.net.URLClassLoader.findClass(libgcj.so.8rh)
at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.8rh)
at java.lang.ClassLoader.loadClass(libgcj.so.8rh)
at java.lang.ClassLoader.loadClass(libgcj.so.8rh)
at gnu.java.lang.MainThread.run(libgcj.so.8rh)

I was looking over the internet for a solution and someone said to change the default version I currently have 1.6 installed but my java --version says I have 1.5 maybe that is the problem can someone tell me how to change that

nordickiwi 07-19-2007 02:56 PM

Java/Fedora Tips & Tricks
 
Not sure if this will help you, but my Java problems in Fedora usually are fixed after following this howto...

http://www.gagme.com/greg/linux/f7-tips.php#java

/Roger

jay73 07-19-2007 05:53 PM

The differences between jdk5 and jdk6 tend to be minimal even though some frameworks (spring for example) will fail to install with jdk6 installed. I think it far more likely that you are simply facing a programming error. From the looks of it, the compiler can't find the class to load: wrong name, wrong extension, ...?

zimboney 07-20-2007 12:40 PM

thanks for your help nordickiwi after looking at that I did what it told me to do then I uninstalled java and installed it again then it started working for me

nordickiwi 07-20-2007 01:00 PM

No worries
 
Pleased to help.

/Roger


All times are GMT -5. The time now is 12:06 AM.