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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started