Unsupported major.minor version 48.0

hi all,

I'm new to java programming and trying fix jedit in my ubuntu box, but it seems my efforts are going ... fultile.

First my config -

neo@tathagata:~$ java -version

java version "1.5.0_06"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)

Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)

now when I issue the command jedit I get

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/gjt/sp/jedit/jEdit (Unsupported major.minor version 48.0)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:488)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:243)

at java.net.URLClassLoader.access$100(URLClassLoader.java:51)

at java.net.URLClassLoader$1.run(URLClassLoader.java:190)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:183)

at java.lang.ClassLoader.loadClass(ClassLoader.java:294)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:288)

at java.lang.ClassLoader.loadClass(ClassLoader.java:250)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)

can the version of jdk I'm using create any problem?

When I'm saying JAVA 2 version 1.4 I'm refering to the VM .. right? so should jdk be a concern?

I'm new to java ...and if things dont get fixed I would need to go back to windows leaving ubuntu ... please help

Thanks in advance..

[1682 byte] By [neo.anersona] at [2007-10-2 16:12:54]
# 1

My understanding of the "Unsupported major.minor version" error is that

you are trying to use a class file compiled with a newer Java version

than your JVM. The strange thing is that 1.5 (by whatever name) is

version 49. So it looks like you have a 1.4 class file, and are running it

with a VM that's older than that.

Check that you are launching jedit with the new VM. (Mine is

/var/local/jdk1.5.0_05/bin/java). You talk about issuing "the command

jedit", so it sounds like there is a script running somewhere. It may

be using another VM.

I'm going to download jedit now - I'll let you know what happens.

pbrockway2a at 2007-7-13 16:59:42 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2

Good news and bad news. The good news (for me): I have JEdit installed

and running nicely. The bad news (for you): I have JEdit installed and

running nicely.

There are a few points where my set up may differ from yours.

(0) I use Eclipse, not JEdit.

(1) I downloaded and ran the generic *nix installer .jar, not the Debian

package, chosing the following (default) options:Install program in /usr/local/share/jedit/4.2

Install shortcut in /usr/local/bin

Install manual page in /usr/local/man/man1

(2) I have no java related environment variables

(3) The script that runs when I enter the jedit command is:#!/bin/sh

# Java heap size, in megabytes

JAVA_HEAP_SIZE=32

DEFAULT_JAVA_HOME="/usr/local/jdk1.5.0_05/jre"

if [ "$JAVA_HOME" = "" ]; then

JAVA_HOME="$DEFAULT_JAVA_HOME"

fi

exec "$JAVA_HOME/bin/java" -mx${JAVA_HEAP_SIZE}m ${JEDIT} -jar "/usr/local/share/jedit/4.2/jedit.jar" $@

The lines to note are DEFAULT_JAVA_HOME= which points to the VM I

am using, and JAVA_HOME which is empty.

You might want to check these out (in reverse order). As I said before,

the error seems to indicate that the VM you are using to execute

jedit.jar is not the one reported by java -version.

pbrockway2a at 2007-7-13 16:59:42 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 3

Also the -log switch will verify the java environment you are using:pbrockway@linuxltbr:~$ jedit -log=1

[message] Log: When reporting bugs, please include the following information:

[message] Log: java.version=1.5.0_05

[message] Log: java.vm.version=1.5.0_05-b05

[message] Log: java.runtime.version=1.5.0_05-b05

[message] Log: java.vendor=Sun Microsystems Inc.

[message] Log: java.compiler=null

[message] Log: os.name=Linux

[message] Log: os.version=2.6.12-9-386

[message] Log: os.arch=i386

[message] Log: user.home=/home/pbrockway

[message] Log: java.home=/usr/local/jdk1.5.0_05/jre

[message] Log: java.class.path=/usr/local/share/jedit/4.2/jedit.jar

[notice] jEdit: jEdit version 4.2final

pbrockway2a at 2007-7-13 16:59:42 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 4

I'm soooooooooooo much grateful that I feel like giving away all my duke dollars to you ...

but I have only twenty ... and I'm not gonna offer such an insignificant amount ....

Jedit is running ...what I did was ..

I had installed jdk1.5.0_06 with net beans ...so I had a jdk1.5.0_06 already ...

I just changed the $PATH to point to its loaction ..and I have my JAVA_HOME where also I did the same thing ...and jedit now is running ...

I can get back to coding now and remain in ubuntu at the same time ...

aaaahhhh ... thank you soo much once again...

it would not have been possible without your help ...

neo.anersona at 2007-7-13 16:59:42 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 5

> I just changed the $PATH to point to its loaction ..and I have my

> JAVA_HOME where also I did the same thing ...and jedit now is

> running ...

Good news! PATH is useful for running the Java tools from the

command line, but JEdit seems to rely on the setting for JAVA_HOME.

> thank you soo much once again...

You're welcome.

pbrockway2a at 2007-7-13 16:59:42 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 6

master ....

I'm already a fan of yours and may I be your trainee ...

please can you guide me where to start from learning java?..any specific book or tute on the web? I have started reading core java vol 1 ... and it appears pretty nice ..

Are you in orkut or any social network? may I have your blog address?

I would be proud to have you in scoopal.com ... you have any mailid that you can write publicly in the forum (I would only invite (plain text) you, fear no spams) ...

neo.anersona at 2007-7-13 16:59:42 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 7

Sun's Tutorial (http://java.sun.com/docs/books/tutorial/) does an

extremely good job of introducing the language: it manages to

balance the need for conceptual overviews with lots of code examples

which are necessary given the huge number of classes involved.

Beyond that, it's a question of choosing a project that's interesting or

useful for you and writing some code! You'll find any number of people

here who are willing to help with comments and suggestions. (And, of

course you should offer your own).

I don't give out mail id's here. I hope your not offended by that. To be

honest, I prefer the anonymity of the forum. Talk of "social networks"

and "blog addresses" makes me feel old! I had to ask wikipedia who

or what orkut was! Real flesh and blood people are the thing - but I

guess you know that.

Good luck with your programming and your study. Cheers,

Peter

pbrockway2a at 2007-7-13 16:59:42 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...