Question: im having this error in my JAVA program: Exception in thread main java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key menu at java.util.ResourceBundle.getObject(Unknown Source) at

im having this error in my JAVA program:

Exception in thread "main" java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key menu

at java.util.ResourceBundle.getObject(Unknown Source)

at java.util.ResourceBundle.getString(Unknown Source)

at MenuFromProperties.main(MenuFromProperties.java:19)

the code is this:

import java.io.FileNotFoundException; import java.io.IOException; import java.net.URISyntaxException; import java.util.Locale; import java.util.ResourceBundle; import java.util.Scanner;

public class MenuFromProperties { static String[] TOP_MENU;

public static void main(String[] args) throws InterruptedException, URISyntaxException, FileNotFoundException, IOException, ClassNotFoundException {

Scanner kybd = new Scanner(System.in); Locale locale = Locale.getDefault();

ResourceBundle bundle = ResourceBundle.getBundle("menu", locale);

TOP_MENU = bundle.getString("menu").split(",");

int userChoice = Utils.userChoose(kybd, TOP_MENU); } }

and this is my properties file (menu.properties):

Menu = [0] List Library, [1] Sort Library By Composer, [2] Sort Library By Genre, [3] Sort Library by Duration, [4] Play Playlist, [5] Create Playlist, [6] Exit

Can some help me fix this error. Im not sure if its the code or something in my properties file.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!