Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books