LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 07-19-2007, 11:48 AM   #1
zimboney
LQ Newbie
 
Registered: Jul 2007
Posts: 5

Rep: Reputation: 0
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
 
Old 07-19-2007, 02:56 PM   #2
nordickiwi
Member
 
Registered: Oct 2004
Location: Stockholm Sweden
Distribution: Fedora 1-8,Familiar v0,7.2, Redhat 9.0, Knoppix, CentOS, Windows 2003,2000,XP,98,95, Exc
Posts: 39

Rep: Reputation: 15
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
 
Old 07-19-2007, 05:53 PM   #3
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
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, ...?
 
Old 07-20-2007, 12:40 PM   #4
zimboney
LQ Newbie
 
Registered: Jul 2007
Posts: 5

Original Poster
Rep: Reputation: 0
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
 
Old 07-20-2007, 01:00 PM   #5
nordickiwi
Member
 
Registered: Oct 2004
Location: Stockholm Sweden
Distribution: Fedora 1-8,Familiar v0,7.2, Redhat 9.0, Knoppix, CentOS, Windows 2003,2000,XP,98,95, Exc
Posts: 39

Rep: Reputation: 15
Cool No worries

Pleased to help.

/Roger
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception in thread "main" java.lang.UnsupportedClassVersionError manolakis Programming 2 01-20-2007 10:56 AM
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window serve paragvd Programming 4 10-05-2004 03:35 AM
Java error "Exception in thread "main" java.lang.StackOverflowError" nro Programming 1 09-04-2004 03:47 AM
Exception in thread "main" java.lang.NoClassDefFoundError: Lobais Linux - Software 19 06-23-2004 08:42 AM
Exception in thread "main" java.lang.NoClassDefFoundError: melinda_sayang Programming 2 04-27-2004 11:49 AM


All times are GMT -5. The time now is 07:10 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration