Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6967205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:17:27+00:00 2026-05-27T16:17:27+00:00

I’ve never seen this error before, I have also never used arrayList before, I

  • 0

I’ve never seen this error before, I have also never used arrayList before, I am just making this code to find out how it works. I’m mainly trying to write a method that deletes a 2D array element if the next one is equal to it (which is the case with the last two elements) I am compiling and running on the same machine and I have just updated java so I’m running the latest version. I am using Linux Ubuntu 11.10. This is the code:

import java.util.*; 

public class Test{
public static void main(String[] args){

    float[][] a = {{304.0f, 2743.0f},
    {304.0f, 2743.0f},
    {304.0f, 2754.0f},
    {304.0f, 2754.0f},
    {325.0f, 2764.0f},
    {346.0f, 2775.0f},
    {367.0f, 2775.0f},
    {367.0f, 2764.0f},
    {367.0f, 2754.0f},
    {356.0f, 2723.0f},
    {325.0f, 2691.0f},
    {304.0f, 2670.0f},
    {304.0f, 2639.0f},
    {356.0f, 2639.0f},
    {377.0f, 2650.0f},
    {377.0f, 2650.0f}};

    foo(a);
    for (int i = 0; i < a.length; ++i)
        System.out.println(a[i]);

}

public static float[][] foo(float[][] array){

    List<float[]> al = new ArrayList<float[]>(Arrays.asList(array));

    for (int i = 0; i < al.size(); ++i)
        if (al.get(i)[0] == al.get(i+1)[0] && al.get(i)[1] == al.get(i+1)[1])
            al.remove(i);

    float[][] b = new float[al.size()][2];

    for (int i = 0; i < al.size(); ++i)
        b[i] = al.get(i);

    return b;
}
}

The error I get is:

Exception in thread "main" java.lang.UnsupportedClassVersionError: Test : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: Test. Program will exit.

also if you can suggest an easier method to do this, I would be very grateful. Thanks very much in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:17:27+00:00Added an answer on May 27, 2026 at 4:17 pm

    All this means is that your version of javac.exe is newer than your version of java.exe. The class files javac.exe is producing can’t be read by this old java.exe. Often people have an extra old copy of java.exe someplace crazy like C:\WINDOWS, left there by a misguided installer. Find it and either delete it or fix your PATH such that your newer copy is found first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.