#AudioClip giving exception
1 messages ยท Page 1 of 1 (latest)
I uploaded your attachments as Gist.
<@&987246487241105418> please have a look, thanks.
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
I uploaded your attachments as Gist.
this is the full exception
there is a file in part14-Part14_08.Hurray called Applause-Yannick_Lemieux.wav
file:Applause-Yannick_Lemieux.wav
you don't need the file:
just the path to the file
jdk or jre
jdk i should download right?
ok downloading rn
also where is the file located?
#1146755827689070632 message
it failed i will download it manualy
no it doesnt work java.lang.UnsupportedClassVersionError: hurraa/HurraaSovellus has been compiled by a more recent version of the Java Runtime (class file version 64.0), this version of the Java Runtime only recognizes class file versions up to 61.0
It seems like you are not using the same version for compiling and running, please use an ide
i am using an ide
intellij
sdk-temurin-20, language level-sdk default
maybe i also need to download temurin jre 20?
No
And this error happens because you put the lib in the classpath instead of the modulepath
Are you using maven or gradle?
so in the libraries i shouldn't have put javafx/lib?
neither.(i am doing mooc)
also i gtg for like 10-15 mins i will be having lunch
ok i am back
? that is what the javafx docs i got told to use in this server told me to do
again where is that file located?
There is a folder, which contains the pom.xml, and the file is there
Pom.xml ? That's maven
How did you add javafx ?
go to project structure-> libraries->click the "+" and then go to my javafx lib folder, then edit the vm configurations to include javafx
also i gtg now i am going to the beach
Right so remove it
And share your pom please
It has worked in the past with javafx, and i will tomorrow because rn it is late for me
Closed the thread due to inactivity.
If your question was not resolved yet, feel free to just post a message to reopen it, or create a new thread. But try to improve the quality of your question to make it easier to help you ๐
I uploaded your attachments as Gist.
no, not from the pom, from the project structure
well what do i do now
now try to run it
i am playing btd6 rn i will do it later
java: package javafx.application does not exist
it gives this error while compiling
also every import is red
and no javafx in "external libraries"
and i cant create anything javafx related
yes that's normal
how do you run it ?
at the left, there is a list of elements
yes that
so
click on the little arrow
and create a run configuration
click maven
doesnt have maven
maybe i need to activate some plugin?
i disabled some for perfomance
intellij should have maven support by default ๐ค
well when i downloaded it it had like 80 plugins and was taking too much ram
so i disabled some
try to run current file
well no
first
right click the pom
then maven should be here
then reload project
wait tmc startup actions
add as maven project?
show a screenshot please
i cant
of the context menu
when i click another app(snipping tool) the thing that appeared after clicking right click on the pom.xml
disappears
add a timer of the screenshot
try add as maven project
ah no the imports are still red
one minute it is downloading something
nope
downloaded for like 4 mins
then still errors
still error imports
show profiles
select java 11
now refresh project?
now select the second thing
there is only Lifecycle, plugins and dependencies
i looked in plugins-> javafx and there is javafx:run there
do i double click on it?
yes
wdym
i have used javafx in 10+ exercise without using it with maven
is mooc asking you to use javafx.scene.media ?
yes
for AudioClip
AudioClip package is javafx.scene.media.AudioClip
only way mooc taught to play sounds
ok
like javafx-base
yes
jor javafx-control
try to add javafx-media
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-media</artifactId>
<version>11.0.2</version>
</dependency>
like add this
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-media</artifactId>
<version>11.0.2</version>
</dependency>
``` under
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11.0.2</version>
</dependency>
yes
ok
now try again
ide gives error
which error ?
ah
right click on pom
maven
reload project
do that each time you edit the pom
like ?
which version of java are you using ?
try it yes
what's the error ?
try java 11 rather
that is the whole output
i dont have java 11
only the jbr but that doesnt work
install it then
there must be more
you can ask intellij to download it you know
the last time it didnt work
ok currently running the installer
currently intellij is indexing jdk
same error
show the error
click on the run or the thing above
rerun?
I uploaded your attachments as Gist.
the error had to be in a file because of discord message size limitations
I uploaded your attachments as Gist.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
[ERROR] Command execution failed.
and the top one ?
the one that has 2 sec,924 ms nxt to it in my screenshot?
yes
I uploaded your attachments as Gist.
which version of java are you using ?
11
because the errors suggests that you are using java 8 or lower ๐ค
what
i dont even have anything lower than java 8
in mc moding i had a problem where my project used jdk 17
but gradle used jdk 8
and i had to change it
then it worked
but maven doesnt have a way to set a jdk for it
open the console and enter java -version
how
or after
by going into environement variables
do echo %JAVA_HOME% please
in terminal?
yes
you shouldn't have a jre at the first place
what does that do
shows the content of java home
then open the environment variables please
in Path user there is no java, in Path system there is a jdk 11, 4 jdk 8 and another jdk
oh wait 3 jdk 8 and 1 jre 8
java home on user there is java 17, and system java 8
in user path?
there is a jdk 17 in user JAVA_HOME
ah so you already have a java home ?
in user and system yes
remove the one from system
cant i just edit the location?
remove it
what is the difference from changing the location?
yes. java home in system has a jre 8 in it. why delete it and not just change the location in it to a jdk 11+
?
you shouldn't have two java home
but one is in system and another in user?
but when i was downloading jdk 11 it added itself to the system. why would jdk 11 do that?
because you ran the installer
you shouldn't run the installer
but download java as a zip
did you remove every java from path ?
no java in neither path
ah yeah i forgot
so change it from 17->11?
yes or no
you can keep java 17
and show a screenshot of what you put in java home
yes
add %JAVA_HOME%\bin
if you only deleted java stuff, you didn't delete anything important
system
oh ok
yes but the java stuff is right next to the system32
but windows works fine so i think i didnt delete anything
ok now what
click on ok as many times as there are open windows
and once everything is closed
open a cmd
and enter echo %JAVA_HOME%
and java -version
C:\Program Files\Eclipse Adoptium\jdk-17.0.6.10-hotspot
echo gives this
'java' is not recognized as an internal or external command,
operable program or batch file.
java gives this
show what you put in path variable
did you open a new cmd ?
yes
hmm
move this from system path to user path
yes
ok
ey java -version works
gives openjdk version 17.0.6
is there a restart button?
now, close and launch it
if you need to change your java version
now you can simply change JAVA_HOME
you don't need to touch path anymore
for mc servers i used the path to the java i wanted to run it instead of java
well now what
did you restarted intellij ?
yes
now try javafx:run again
show it please
I uploaded your attachments as Gist.
I uploaded your attachments as Gist.
I uploaded your attachments as Gist.
only the top one
all the errors i could find
for the error
Caused by: java.lang.IllegalArgumentException: uri.getScheme() == null! uri == 'Applause-Yannick_Lemieux.wav'
ah it runs ๐
now fix your code
em what
no
that was the initial error...
that error was the reason i started this thread
wait what ?
no it wasn't
Caused by: java.lang.IllegalAccessError: class com.sun.media.jfxmediaimpl.NativeMediaManager (in unnamed module @0x264e54a) cannot access class com.sun.glass.utils.NativeLibLoader (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.utils to unnamed module @0x264e54a
yea, I don't know why intellij is not able to find it
but yet it runs correctly
can you screenshot the whole intellij window ?
when i click green arrow button this comes up
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.077 s
[INFO] Finished at: 2023-09-01T15:50:47+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException
maybe i need to set a project somewhere
in the "current file", at the right there is an arrow, click on it, run config, then select maven, then run javafx:run
hmm, you can try to close intellij, delete .idea and restart it hoping it would fix it
there is only edit configs
yes
in this window
there should be a lot of stuff to put
I mean
a lot of fields
select maven
in command line
yes
in profile, you can chose java11 but it's not mandatory
[ERROR] No plugin found for prefix 'javafx' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\User.m2\repository), tmc (https://maven.mooc.fi/releases), tmc-snapshots (https://maven.mooc.fi/snapshots), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
did you let it autocomplete ?
autocomplete what
it didnt do anything when i select javafx:run
maybe i need to reload maven?
what did appear then ?
nothing
wdym
i clicked it, (in the run config), clicked apply, clicked ok and then clicked green arrow button
can you do that please ?
what appear in the run field ?
javafx:run
remove that, and let it auto complete
ah so it autocompleted to javafx:run ?
what does that do? am i going to lose something in my other projects?
ok
intellij is updating indexes
tmc is doing startup actions
(i hate that)
no it isnt working
but the javafx import errors are gone
but it is still showing this
ahhhh
show the error again please
just do be sure
that it is the same
[ERROR] No plugin found for prefix 'javafx' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\User.m2\repository), tmc (https://maven.mooc.fi/releases), tmc-snapshots (https://maven.mooc.fi/snapshots), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
why that is good ๐
-_-
try to run from the maven window at the right
at least here it works
how
like you did before
javafx:run?
yes
I uploaded your attachments as Gist.
I uploaded your attachments as Gist.
this is the orignal error again
right so
Caused by: java.lang.IllegalArgumentException: uri.getScheme() == null! uri == 'Applause-Yannick_Lemieux.wav'
as you can see
Applause-Yannick_Lemieux.wav is invalid
why
em. i dont get it
so try "file:Applause-Yannick_Lemieux.wav"
it tried to get its scheme, but that failed. cause there is none
like think about a url like http://www.foo.com
the scheme is http here
but ur path is missing all of that
no scheme, it fails
nope that didnt work(zabuzard continue what you are saying, i am reading)
what's the error ?
did the error message change now? please show
[ERROR] No plugin found for prefix 'javafx' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\User.m2\repository), tmc (https://maven.mooc.fi/releases), tmc-snapshots (https://maven.mooc.fi/snapshots), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
third time this comes up
?
this is the third time this error happened
Caused by: java.lang.IllegalArgumentException: uri.getScheme() == null! uri == 'Applause-Yannick_Lemieux.wav'
that is part of the exception
i dont think i need to show any more
ah
like I said
try to use what I gave you
file:...
or try this actually "file://Applause-Yannick_Lemieux.wav"
didnt work
i accidentaly wrote fle:
alathreon, i gtg now, i will be back tomorrow. thanks for all the help
if you think of anything post, here and i will just see it tomorrow
Closed the thread due to inactivity.
If your question was not resolved yet, feel free to just post a message to reopen it, or create a new thread. But try to improve the quality of your question to make it easier to help you ๐
ok tj-bot, lets get back to this problem.
uri.getScheme() == null! uri == 'Applause-Yannick_Lemieux.wav
that is the error when running
ur supposed to use what ala told u to write instead
and...?
didnt work
and the error message was...
I uploaded your attachments as Gist.
if people have to pull everything out ur nose and repeat things constantly, they will just stop helping u all together eventually
i am trying my best
that error message is the old one
use file://Applause-Yannick_Lemieux.wav
ur sharing the error message that u get if u write
Applause-Yannick_Lemieux.wav
instead of
file://Applause-Yannick_Lemieux.wav
i did use file://Applause-Yannick_Lemieux.wav
let me see if reloading maven project helps
have u saved the file before running?
doesnt intellij do that like automatically. i remember i only had to save file for eclipse, then i didnt have to for intellij
well i went to file->Save all and then run again and that didnt work
if i need to do something to fix this, or to do something to give more information, please tell me
save your project and make a new screenshot , that will help to update it to current day
like file->save all?
make it save your code and rerun the project
if the file is not saved i have absolutely 0 idea how to save it
i even checked out of intellij to see if it is saved
and your sure u need a uri and not a url ?
not sure if this has been mentiond above ( wall of text ) but try to adapt this to your needs :
new AudioClip(TestClass.class.getResource("test.mp3").toExternalForm());
if u only say "didn't work", we can't help u
ur constantly doing this and it always requires 2 ping pongs
by didnt work there i meant same exception
cause we don't know what the new error message is, or whether it's still the same
then say that please
i will. didnt think of doing it
the problem is different
maven isnt detecting the changes
first google hit for "javafx audioclip no scheme":
https://stackoverflow.com/q/48891937
has the solution in the comments
its what fa said
the problem is different now. maven isnt detecting changes in the file! look! it says error on line 14, but line 14 is empty!!!
rebuild your project