#Artifact not opening when running

1 messages · Page 1 of 1 (latest)

cerulean kettleBOT
#

@vivid tiger has a question:

jxstjxck

yall i built my artifact in intellij and when running this jar it just doesnt open and quits. it runs normal in intellij. i dont know what to do or what i did wrong.

#

<@&987246399047479336> please have a look, thanks.

soft ferry
#

did you try running the jar by double clicking it?

#

try running it from console it might show some errors

vivid tiger
#

which console

#

intellij's or mac terminal

#

i ran it in the intellij console and it says that i am missing a txt file that i reference in my code

#

does this mean i have to include this txt with the jar

soft ferry
#

yeah kinda

#

you should put it in the resources folder

#

but you cant write to that file later on

#

its just for reading its content

#

so it depends on your use case

vivid tiger
#

i made a new txt file that i use for storing some information for the user. i am setting its path in the code using a string to the path src/assets/preferences/metatune_preferences.txt which the src is the project folder. does this mean i have to change the file path to be a folder within the jar file

soft ferry
#

no, the problem your approach has is that it works for on your pc, but wont on others

#

you basically hard code the location

#

there are different approaches, people usually create a dedicated folder for storing information in appdata or user.home/yourapp or similar

vivid tiger
#

ok thank you

#

im going to try this

mint mango
#

kumbaya