Error running program on EV3

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

User avatar
ProHacker
New User
Posts: 24
Joined: Mon Dec 25, 2017 8:50 am
Location: Russia

Error running program on EV3

Postby ProHacker » Fri Dec 29, 2017 10:26 am

Hi, there!
I've successfully uploaded my program, but there's an error with running.
Program name: HelloWorld
Eclipce version: Oxygen.2 Release (4.7.2)
Program code:

Code: Select all

package my.pcg;
import lejos.hardware.lcd.LCD;
import lejos.utility.Delay;

public class HelloWorld {
   public static void main(String[] args) {
      LCD.drawString("Hello, world!", 0, 0);
       Delay.msDelay(5000);
   }
}

EV3 error message:
Uncaght exeption:
java.lang.UnsupportedClassVersionError
my/pcg/HelloWorld : Unsupported major.minor version 52.0

java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:800)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
java.net.URLClassLoader.access$100(URLClassLoader.java:71)
java.net.URLClassLoader$1.run(URLClassLoader.java:361)
java.net.URLClassLoader$1.run(URLClassLoader.java:355)

Thanks for fast answers!

PS: I hope nobody retyped text from EV3's screen like me! :shock:
LeJOS rules! :D

User avatar
gloomyandy
leJOS Team Member
Posts: 6017
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Error running program on EV3

Postby gloomyandy » Fri Dec 29, 2017 1:00 pm

You don't need to retype the text! Any errors are logged to a file on the EV3 you can then use the EV3Control program to copy the file to your PC...
https://sourceforge.net/p/lejos/wiki/Us ... C%20tools/

The problem you are seeing is because you have compiled your program with a Java 8 compiler and are trying to run it on a JAVA 7 JRE (which is all that is really available for the EV3). You hava couple of choices, you can set the compliance level of your Java 8 system as shown here:
viewtopic.php?t=7789

Better still install a Java 7 JDK and setup your projects to use that. The process for configuring eclipse varies (and you still haven't told us which version you are using), but something like this should work...
https://courses.cs.washington.edu/cours ... va7Jar.pdf

Oh and had you googled "lejos Unsupported major.minor version 52.0" you would probably have found the solution already.
leJOS news https://lejosnews.wordpress.com/

User avatar
ProHacker
New User
Posts: 24
Joined: Mon Dec 25, 2017 8:50 am
Location: Russia

Re: Error running program on EV3

Postby ProHacker » Fri Dec 29, 2017 4:25 pm

Thanks for the link!
Yahoo, it works!
MY 1ST LEJOS PROGRAM WORKS!
IT'S THE BEST FORUM IN THE WORLD!
THANKS FOR EVERYONE!
LeJOS rules! :D


Return to “EV3 Software”

Who is online

Users browsing this forum: No registered users and 1 guest