[enchanting] Problems to start Echanting on W7

This is the place to ask question about Enchanting, talk about your Enchanting projects or simply find out more about Enchanting on the NXT.

Moderator: clintonb

[enchanting] Problems to start Echanting on W7

Postby thomasroch » Mon Jan 07, 2013 11:23 pm

Hi,
on my W7 32-bit-system, I have running:
JDK 1.6
NXT-Driver 1.02
Lejos 0.9.1
Javaeditor.

Lejos runs fine. Javaeditor compiles and uploads programs to the NXT-brick.

But: After installing Enchanting 0.21 and startimg, nothing happens

After starting enchanting\backend\run.bat, I get the message:
C:\Program Files\Enchanting\BackEnd>run
JAVA_HOME=C:\Program Files\Java\jdk1.6.0_20
FANTOM_HOME=C:\Programme\IVI Foundation\VISA\WinNT\Bin\NiViUsb.dll
Found all dependencies.
Exception in thread "main" java.lang.UnsupportedClassVersionError: EnchantingBridge : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
1)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: EnchantingBridge. Program will exit.

Would somebody help me?

Thx
Thomas
thomasroch
New User
 
Posts: 2
Joined: Mon Jan 07, 2013 11:20 pm

Re: [enchanting] Problems to start Echanting on W7

Postby skoehler » Tue Jan 08, 2013 10:57 am

thomasroch wrote:Exception in thread "main" java.lang.UnsupportedClassVersionError: EnchantingBridge : Unsupported major.minor version 51.0


Somebody or something compiled Java code with Java 7, and now you're trying to execute it with Java 6.
skoehler
leJOS Team Member
 
Posts: 1108
Joined: Thu Oct 30, 2008 4:54 pm

Re: [enchanting] Problems to start Echanting on W7

Postby thomasroch » Tue Jan 08, 2013 6:02 pm

Hi,

I solved the problem by myself:

I had to delete the lejos_nxt_java_home - environmentvariable. After this, everything is well.

Bye
Thomas
thomasroch
New User
 
Posts: 2
Joined: Mon Jan 07, 2013 11:20 pm

Re: [enchanting] Problems to start Echanting on W7

Postby skoehler » Tue Jan 08, 2013 6:11 pm

thomasroch wrote:I had to delete the lejos_nxt_java_home - environmentvariable. After this, everything is well.


Did it point to Java 7 JDK before you deleted it?
skoehler
leJOS Team Member
 
Posts: 1108
Joined: Thu Oct 30, 2008 4:54 pm

Re: [enchanting] Problems to start Echanting on W7

Postby clintonb » Wed Jan 09, 2013 6:46 am

skoehler wrote:Somebody or something compiled Java code with Java 7, and now you're trying to execute it with Java 6.


I was trying to think about how this could've happened. Enchanting includes a JDK; the code was compiled with it, and is run with it. I wouldn't expect any version issues, because it is the same version.

Thinking about it more deeply, the JDK coming with Enchanting is OpenJDK 7. This was used to compile the backend code. Somehow his other JDK is being used to run the code. [Darn. This means my attempt to reproduce the issue by downloading Oracle's JDK won't work, as I got the latest instead of 1.6.]

Thomas, do you have a C:\Program Files\Enchanting\ThirdParty\openjdk directory with stuff in it? I'm really surprised that the JAVA_HOME statement doesn't point to that, as setting JAVA_HOME to the included Java is one of the first things to happen after you call 'run'.
clintonb
Active User
 
Posts: 80
Joined: Fri May 28, 2010 1:44 am
Location: Cardston, Alberta, Canada

Re: [enchanting] Problems to start Echanting on W7

Postby skoehler » Wed Jan 09, 2013 2:31 pm

So then maybe LEJOS_NXT_JAVA_HOME pointed to a JDK 1.6 ?
skoehler
leJOS Team Member
 
Posts: 1108
Joined: Thu Oct 30, 2008 4:54 pm

Re: [enchanting] Problems to start Echanting on W7

Postby clintonb » Wed Jan 09, 2013 4:42 pm

skoehler wrote:So then maybe LEJOS_NXT_JAVA_HOME pointed to a JDK 1.6 ?


I think you are right. It seems easy enough to fix, but I'd like to reproduce the problem first to be sure my fix actually works.

There is no corresponding environment variable used on the Mac or Linux, is there?

Cheers,
Clinton
clintonb
Active User
 
Posts: 80
Joined: Fri May 28, 2010 1:44 am
Location: Cardston, Alberta, Canada

Re: [enchanting] Problems to start Echanting on W7

Postby skoehler » Wed Jan 09, 2013 7:50 pm

clintonb wrote:I think you are right. It seems easy enough to fix, but I'd like to reproduce the problem first to be sure my fix actually works.


Yes, of course. I'm still hoping for a reply from thomas.

clintonb wrote:There is no corresponding environment variable used on the Mac or Linux, is there?

LEJOS_NXT_JAVA_HOME is used on all three platforms! And on all three platforms, it is preferred over JAVA_HOME.
Only if neither is set, java and javac are assumed to be on the PATH.

The reason is, tat LEJOS_NXT_JAVA_HOME allows to set a JDK only specific to leJOS while JAVA_HOME is used by many many other programs.
skoehler
leJOS Team Member
 
Posts: 1108
Joined: Thu Oct 30, 2008 4:54 pm

Re: [enchanting] Problems to start Echanting on W7

Postby clintonb » Tue Jan 15, 2013 12:06 am

I have fixed the issue, and the fix will be included with Enchanting 0.2.3.

Cheers,
Clinton
clintonb
Active User
 
Posts: 80
Joined: Fri May 28, 2010 1:44 am
Location: Cardston, Alberta, Canada

Re: [enchanting] Problems to start Echanting on W7

Postby bitbucket » Sun Feb 17, 2013 4:46 am

I have a similar problem and wanted to see if you needed to test anything or get data from my setup before I try the fix mentioned above.

I am running a 64 bit version of Windows 7. Under control panel the "Java (32 Bit)" control applet indicates version 1.6 update 17. I am using Enchanting version 0.2.3.

With 64 Bit windows 32 bit programs are installed under "C:\Program Files (86)\" by default.

I am resisting the urge to change settings and update java in case the developer wants to do any tests or check any settings.

Unfortunately this version of Java is known to have a severe security flaw and I will need to update it quickly..
bitbucket
New User
 
Posts: 3
Joined: Sun Feb 17, 2013 4:15 am

Re: [enchanting] Problems to start Echanting on W7

Postby bitbucket » Sun Feb 17, 2013 2:59 pm

Do to the security issue with Java I went and updated to version 1.7.0_13.

I still have the same problem.

Below is the output from running verbose_enchanting.windows.bat:

C:\Program Files (x86)\Enchanting>"C:\Program Files (x86)\Enchanting\verbose_enchanting.windows.bat"

C:\Program Files (x86)\Enchanting>REM starts enchanting

C:\Program Files (x86)\Enchanting>pushd .

C:\Program Files (x86)\Enchanting>REM be sure we are in the batch file's directory

C:\Program Files (x86)\Enchanting>cd "C:\Program Files (x86)\Enchanting\verbose_enchanting.windows.bat"\..\

C:\Program Files (x86)\Enchanting>cd BackEnd

C:\Program Files (x86)\Enchanting\BackEnd>call run.bat start /wait ..\FrontEnd\EnchantingFE.exe -- [ignored]
JAVA_HOME=C:\Program Files (x86)\Enchanting\ThirdParty\openjdk
FANTOM_HOME=C:\VXIPNP\WinNT\Bin\NiViUsb.dll
Found all dependencies.
Error: Could not find or load main class EnchantingBridge
C:\Program Files (x86)\Enchanting>
bitbucket
New User
 
Posts: 3
Joined: Sun Feb 17, 2013 4:15 am

Re: [enchanting] Problems to start Echanting on W7

Postby clintonb » Mon Feb 18, 2013 2:10 pm

Hi bitbucket.

Enchanting, on Windows, includes its own Java Development Kid (JDK), so it should be unaffected by whatever other version(s) of Java you have installed.

Nice job running things in verbose mode. Java is not obviously the issue.

Are you running Enchanting 0.2.3, and installed it with the installer package (as opposed to, say, downloading a source version)? What files exist in your 'BackEnd' directory?

Thanks,
Clinton
clintonb
Active User
 
Posts: 80
Joined: Fri May 28, 2010 1:44 am
Location: Cardston, Alberta, Canada

Re: [enchanting] Problems to start Echanting on W7

Postby bitbucket » Mon Feb 18, 2013 4:53 pm

I used the standard Windows installer.

The files in the backend directory are unmodified from the installer. Please let me know if you need my to provide a complete directory listing.

I just modified the run.bat file to have the command "nxjpc -cp . EnchantingBridge" to specify a claspath of the current directory. It allowed the class files to be found.

Running the verbose mode again launched the program successfully.

Btw.

Installing Echanting 0.2.3 on a 32 bit windows version worked fine without modification (Though I did get an error regarding communicationg with the backend server when I tried to flash the NXT, I then just installed legos seperately and flashed from it.).
bitbucket
New User
 
Posts: 3
Joined: Sun Feb 17, 2013 4:15 am

Re: [enchanting] Problems to start Echanting on W7

Postby bullestock » Sun Mar 31, 2013 8:51 pm

bitbucket wrote:I used the standard Windows installer.

I just modified the run.bat file to have the command "nxjpc -cp . EnchantingBridge" to specify a claspath of the current directory. It allowed the class files to be found.


I just installed 0.2.3 on two machines, one running XP SP2 and the other Win7 x64. Both required the above change, otherwise the backend did not start.
bullestock
New User
 
Posts: 14
Joined: Fri Mar 04, 2011 9:52 pm

Re: [enchanting] Problems to start Echanting on W7

Postby clintonb » Wed Apr 03, 2013 4:24 am

bullestock wrote:
bitbucket wrote:I used the standard Windows installer.

I just modified the run.bat file to have the command "nxjpc -cp . EnchantingBridge" to specify a claspath of the current directory. It allowed the class files to be found.


I just installed 0.2.3 on two machines, one running XP SP2 and the other Win7 x64. Both required the above change, otherwise the backend did not start.


That is good to know, but I find it very, very curious. Why does it work for so many people without this change?

Thanks for the head's up.
Clinton
clintonb
Active User
 
Posts: 80
Joined: Fri May 28, 2010 1:44 am
Location: Cardston, Alberta, Canada

Next

Return to Enchanting Questions and Projects

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff