I want to use javafx media library for audiofiles, but making a new Media instance throws InvocationTargetException written in minecraft enchantment table language.
I tried to instantiate it in multiple ways: by passing path.toString(), by passing a file as a string or just hardcoded string. All of them throw the same exception.
new MediaPlayer(new Media(new File(filePath).toURI().toString()));
Where filePath is C:\Users\User\Desktop\folder\java\AudioCutter\target\classes\audioFile.wav
A file or AudioInputStream with the same path works.
JavaFX is imported as a library in Intellij Idea project structure, and it works.
I use java 16.