Logger cannot be resolved Java 570425394 Error occured

0 votes
Logger cannot be resolvedJava(570425394)
Dec 1, 2020 in Java by Boopathy
• 370 points
10,142 views

1 answer to this question.

0 votes
Hey, @Boopathy,

Could you please post your code here?
answered Dec 1, 2020 by Gitika
• 65,770 points
//The MethodLog((Level,String)in the type logger is not applicable for the arguments(System.logger.Level.string)  java [39,41]

//The MethodLog((Level,String)in the type logger is not applicable for the arguments(System.logger.Level.string)  java [37,43]

//Two error occured.

package tasks;

import java.lang.System.Logger.Level;

import java.util.logging.Logger;

public class SmallestPositiveNumber {

    /*

     * Input: Array of numbers

     *

     * Output: Print the smallest positive number in the array & its position

     *

     * Sample input 1: Array - [10, 25, 100, 0] Sample output 1:

     * "Smallest positive number in the array is '0' & its position is '3'"

     *

     * Sample input 2: Array - [1, 2, 10, 5] Sample output 2:

     * "Smallest positive number in the array is '1' & its position is '0'"

     *

     * Sample input 3: Array - [1, 2, 10, -5] Sample output 3:

     * "Input contains negative value. Provide positive numbers"

     */

    public static void main(String[] args) {

        int arr[] = { 10, 50, 32, 59, 37 };

        int minimum = 0;

        int position = 0;

        for (int i = 0; i < arr.length; i++) {

            if (arr[i] > 0 && minimum >= 0)

            {

            if ( arr[i] < minimum)

             {

                minimum=arr[i];

                position=i;

            }

        else

           {

            Logger.getAnonymousLogger().log(Level.INFO, "Input contains negative value. Provide positive numbers");

            }

        }

        Logger.getAnonymousLogger().log(Level.INFO, "Smallest number in the array is" + minimum + "& its position is " +position);

    

    }

}

}

Hi, @Boopathy,

Changing the JRE System Library might work. 

  • Right-click on your project
  • Select Build Path and then click Configure Build Path
  • Under Libraries tab JRE System Library

  • Then choose the Workspace default JRE option

Hope this helps!

Check out Java Certification course here to know more.

Thanks!

Related Questions In Java

+3 votes
14 answers

“A Non-static method cannot be referenced from a static context” error

Hey Techies, Non-static variables are part of the objects ...READ MORE

answered Dec 10, 2020 in Java by Roshni
• 10,480 points
249,690 views
0 votes
1 answer

Error: setOnItemClickListener cannot be used with a spinner

Hello @kartik, See the first line of your ...READ MORE

answered Jun 1, 2020 in Java by Niroj
• 82,840 points
3,574 views
0 votes
1 answer

Following error is occurring "Can't start Eclipse - Java was started but returned exit code=13"

There are combinations of Operating System, JDK ...READ MORE

answered Apr 19, 2018 in Java by Rishabh
• 3,620 points
2,978 views
0 votes
1 answer

Can Static methods be inherited in java?

A subclass inherits all of the public ...READ MORE

answered Apr 30, 2018 in Java by Daisy
• 8,140 points
1,930 views
+5 votes
4 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,450 points

edited Nov 7, 2018 by Omkar 81,223 views
+1 vote
1 answer

How to handle drop downs using Selenium WebDriver in Java

First, find an XPath which will return ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,500 points
8,359 views
0 votes
1 answer

What are the differences between getText() and getAttribute() functions in Selenium WebDriver?

See, both are used to retrieve something ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,500 points
17,433 views
0 votes
1 answer

Selenium JARS(Java) missing from downloadable link

Nothing to worry about here. In the ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,500 points

edited Aug 4, 2023 by Khan Sarfaraz 4,876 views
0 votes
4 answers

“Cannot find symbol” compilation error

The "Cannot find symbol" errors generally occur when you ...READ MORE

answered Dec 16, 2020 in Java by Gitika
• 65,770 points
42,404 views
0 votes
6 answers

How can we define global variables in java?

To define Global Variable you can make ...READ MORE

answered Dec 15, 2020 in Java by Gitika
• 65,770 points
117,860 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP