Unsupported Major.Minor Version? :(

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Sparticus
Posts: 227
Joined: 27 Feb 2006, 17:44
Location: Canada
Contact:

Unsupported Major.Minor Version? :(

Postby Sparticus » 18 Sep 2011, 16:38

Hey all,

When i try and start the SFS server, I get the following error :

Code: Select all

java.lang.UnsupportedClassVersionError: LoginExtention : Unsupported major.minor
 version 51.0


Any ideas?

Thanks!


Code: Select all

10:42:02,484 INFO  [main] v2.SmartFoxServer     - Boot sequence starts...
10:42:02,500 INFO  [main] v2.SmartFoxServer     -
 _____ _____ _____    ___ __ __    _____ _____ _____ _____
|   __|   __|   __|  |_  |  |  |  | __  |     |     |_   _|
|__   |   __|__   |  |  _|-   -|  | __ -|  |  |  |  | | |
|_____|__|  |_____|  |___|__|__|  |_____|_____|_____| |_|

10:42:03,062 INFO  [main] v2.SmartFoxServer     - License code not found, starti
ng Community Edition license
10:42:03,062 INFO  [main] core.SFSEventManager     - AnonymousService-1 initaliz
ed
10:42:03,109 INFO  [main] impl.DefaultFileReplicator     - Using "C:\Users\ADMIN
I~1\AppData\Local\Temp\252\vfs_cache" as temporary files store.
10:42:03,250 INFO  [main] v2.SmartFoxServer     - License loaded

===================================
LICENSE DETAILS
-----------------------------------
Type            : Community Edition
Max users       : 100
===================================

10:42:03,250 INFO  [main] managers.SFSBannedUserStorage     - BanUserStorage ini
tialized
10:42:03,265 INFO  [main] managers.SFSBannedUserManager     - BanUser data loade
d: 0 records.
10:42:03,281 INFO  [main] config.SFSConfigurator     - Loading: zones\GameLobby.
zone.xml
10:42:03,328 INFO  [main] config.SFSConfigurator     - Loading: zones\SimpleChat
.zone.xml
10:42:03,359 INFO  [main] config.SFSConfigurator     - Loading: zones\Wallz.zone
.xml
10:42:03,406 INFO  [main] managers.SFSZoneManager     -

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 >> Zone: GameLobby
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

10:42:03,437 INFO  [main] managers.SFSZoneManager     - Creating room: (default)
 The Lobby
10:42:03,453 INFO  [main] api.SFSApi     - Room created: [ Room: The Lobby, Id:
0, Group: default, isGame: false ]
10:42:03,453 INFO  [main] managers.SFSZoneManager     -

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 >> Zone: SimpleChat
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

10:42:03,453 INFO  [main] managers.SFSZoneManager     - Creating room: (default)
 The Lobby
10:42:03,468 INFO  [main] api.SFSApi     - Room created: [ Room: The Lobby, Id:
1, Group: default, isGame: false ]
10:42:03,468 INFO  [main] Extensions     - {sfsTris}: SFSTris2X Extension starte
d, rel. 1.0.5
10:42:03,484 INFO  [main] managers.SFSZoneManager     -

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 >> Zone: Wallz
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

10:42:03,828 INFO  [main] managers.SFSZoneManager     - Creating room: (default)
 The Lobby
10:42:03,828 INFO  [main] api.SFSApi     - Room created: [ Room: The Lobby, Id:
2, Group: default, isGame: false ]
java.lang.UnsupportedClassVersionError: LoginExtention : Unsupported major.minor
 version 51.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(Unknown Source)
        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$000(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 java.lang.ClassLoader.loadClass(Unknown Source)
        at com.smartfoxserver.v2.entities.managers.SFSExtensionManager.createJav
aExtension(SFSExtensionManager.java:341)
        at com.smartfoxserver.v2.entities.managers.SFSExtensionManager.createExt
ension(SFSExtensionManager.java:266)
        at com.smartfoxserver.v2.entities.managers.SFSZoneManager.createZone(SFS
ZoneManager.java:395)
        at com.smartfoxserver.v2.entities.managers.SFSZoneManager.initializeZone
s(SFSZoneManager.java:220)
        at com.smartfoxserver.v2.SmartFoxServer.start(SmartFoxServer.java:205)
        at com.smartfoxserver.v2.Main.main(Main.java:31)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
        at com.exe4j.runtime.WinLauncher.main(Unknown Source)
        at com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)
10:42:03,843 INFO  [Thread-2] managers.SFSBannedUserManager     - BanUser data s
aved.
10:42:03,843 WARN  [SFS2X ShutdownHook] core.SFSShutdownHook     - SFS2X is shut
ting down. The process may take a few seconds...
10:42:03,843 INFO  [Thread-1] managers.SFSZoneManager     - BuddyList saveAll...
3slices
Posts: 115
Joined: 17 Aug 2011, 04:42

Postby 3slices » 18 Sep 2011, 17:32

Update your Java to 1.6.
Sparticus
Posts: 227
Joined: 27 Feb 2006, 17:44
Location: Canada
Contact:

Postby Sparticus » 19 Sep 2011, 00:54

According to :

http://javatester.org/version.html

I have java version 1.7.0

Is that okay then? or do i need to downgrade to 1.6?
3slices
Posts: 115
Joined: 17 Aug 2011, 04:42

Postby 3slices » 19 Sep 2011, 06:47

Try uninstall 1.7 and install 1.6 instead. It should work then.
User avatar
levancho
Posts: 71
Joined: 27 Jun 2011, 16:03

Postby levancho » 19 Sep 2011, 17:17

SIDENOTE:

http://javatester.org/version.html will only test version of JRE, its not guaranteed to be the same as one you used for compilation, you might have two ore more java distributions in your machine :) most of the times browser plugin uses separate JRE only distribution while IDE's need whole JDK.

what you need to make sure is whatever IDE you used to compile your extension,needs to use same version of Java (javac to be specific) as SmartFox server is compiled with, I assume 1.6 is the version smartfoxServer is compiled with.


Code: Select all

java.lang.UnsupportedClassVersionError: LoginExtention : Unsupported major.minor
 version 51.0



you are basically mixing 1.7 compatible code (your extension) with 1.6 compatible code of smartfoxServer
tantanix
Posts: 13
Joined: 16 Feb 2012, 05:18

Re: Unsupported Major.Minor Version? :(

Postby tantanix » 21 May 2013, 16:20

Hi,

I'm experiencing the same error and it's pointing to my extension class.
Error: UnsupportedClassVersionError major.minor version 51.0
version: SFS 2x 2.6
OS: Windows 7 64 bit

I have uninstalled all my java and installed afresh JDK 7u21 64 bit version. I now have jdk1.7.0_21 and jre7 in my java folder. I've checked that the environment variables are in place pointing to the correct jdk folder. I've restarted my PC just to be sure. I've recompiled the extensions using Ant from the command line.

I reran SFS and the same error pops out. I've repeated the same process w/ 1.6 version 32/64bit and 1.7 32bit. Nothing's changed. And that's why I'm in here now...pleading to the gods that be. What am I doing wrong?

Is it that I'm using the sfs2x.jar, sfs2x-core.jar, and sfs2x-util.jar libraries from a 32 bit SFS version during compilation of my extensions? Does it even matter?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Unsupported Major.Minor Version? :(

Postby Lapo » 21 May 2013, 18:06

No it doesn't matter, because that's java bytecode.

SmartFoxServer 2X uses its own Java runtime, therefore your Java7 installation is ignored. What you need to do is copying the jre/ folder of your Java 7 JRE and replace the one coming with SFS2X.

If you'll do that the gods will be merciful :)

p.s. = check your spam filter, the email notifications from our forums are bouncing back!
Lapo
--
gotoAndPlay()
...addicted to flash games
tantanix
Posts: 13
Joined: 16 Feb 2012, 05:18

Re: Unsupported Major.Minor Version? :(

Postby tantanix » 22 May 2013, 08:13

Booooooom! And the gods are indeed merciful. :wink:
Thanks for the reply, Lapo. I've added sfs forum email to my contacts. Gmail thinks it's spam.
deathangel
Posts: 2
Joined: 15 May 2015, 13:13

Re: Unsupported Major.Minor Version? :(

Postby deathangel » 06 Jun 2015, 16:29

Hi

SmartFoxServer 2x Version 2.10.0
[NEW] Completed support for Java 8 runtime ???

If I compile my extension with jdk1.8.0_45, I get this Exception.

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/zerno/MapExtension : Unsupported major.minor version 52.0
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.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 java.lang.ClassLoader.loadClass(Unknown Source)
at com.smartfoxserver.v2.entities.managers.SFSExtensionManager.createJavaExtension(SFSExtensionManager.java:335)
at com.smartfoxserver.v2.entities.managers.SFSExtensionManager.createExtension(SFSExtensionManager.java:260)
at com.smartfoxserver.v2.entities.managers.SFSZoneManager.createRoom(SFSZoneManager.java:713)
at com.smartfoxserver.v2.entities.managers.SFSZoneManager.createZone(SFSZoneManager.java:407)
at com.smartfoxserver.v2.entities.managers.SFSZoneManager.initializeZones(SFSZoneManager.java:239)
at com.smartfoxserver.v2.SmartFoxServer.start(SmartFoxServer.java:292)
at com.smartfoxserver.v2.Main.main(Main.java:27)
Unsupported major.minor version 52.^C18:12:46,981 WARN [SFS2X ShutdownHook] core.SFSShutdownHook - SFS2X is shutting down. The process may take a few seconds...

I changed back to Java 7.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Unsupported Major.Minor Version? :(

Postby Lapo » 06 Jun 2015, 19:29

SFS 2X 2.10 is released as a patch and as such it uses the JRE from the 2.9.x installation, which is Java 7.
What you're seeing is just an error coming from the default JRE 7 unable to load your Java 8 classes.

If you want you can replace the default JRE with Java 8. If you decide to do so there's one extra step to follow:

1. go to: <YourSFS2xFolder>/lib/jetty/modules/npn/
2. duplicate one of the files in the folder, e.g. file "npn-1.7.0_45.mod" and modify the version number to match the new JRE. Example "npn-1.8.0_25.mod"

cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
deathangel
Posts: 2
Joined: 15 May 2015, 13:13

Re: Unsupported Major.Minor Version? :(

Postby deathangel » 08 Jun 2015, 22:16

Lapo wrote:SFS 2X 2.10 is released as a patch and as such it uses the JRE from the 2.9.x installation, which is Java 7.
What you're seeing is just an error coming from the default JRE 7 unable to load your Java 8 classes.

If you want you can replace the default JRE with Java 8. If you decide to do so there's one extra step to follow:

1. go to: <YourSFS2xFolder>/lib/jetty/modules/npn/
2. duplicate one of the files in the folder, e.g. file "npn-1.7.0_45.mod" and modify the version number to match the new JRE. Example "npn-1.8.0_25.mod"

cheers


No, I dont really need it, I only thought its working, because "[NEW] Completed support for Java 8 runtime" is written in changelog of this patch.
My mistake, my english is nor very well, sorry! :?

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 59 guests