Hello, I’ve heard java is preinstalled on containers, my question is are you able to execute jar files in a container?
Thanks
Hey @SpeedyCraftah yes, Java is installed and should work pretty much as expected.
How would I execute jar files though. Through console?
Or you can use the start script in a glitch.json file to execute java -jar hello.jar
. https://glitch.com/edit/#!/the-simplest-possible-ruby-poc?path=glitch.json:1:0 is a very simple example.
Thanks! That’s all I needed
tried this method and got Error: Unable to access jarfile filename.jar?
Hi @saappir, welcome to the Glitch forum! I’m sorry you’re having trouble; can you provide your project name so we can take a closer look?
hey thanks for the quick reply, my project is -> https://glitch.com/~unexpected-organization
(gotta say, i’m pretty new to this, please forgive my noobness)
Hey @saappir, it looks to me like your shell script isn’t working as expected because the jar file you’re trying to execute isn’t available. I see that you’ve uploaded it to assets; that stores it in Amazon’s S3 and not in your project’s file system, so your script can’t access it. You’ll need to open your project’s console and then run the wget
command using the url you can retrieve as show here.
Hope this helps!
still getting this error
Error: Unable to access jarfile filename.jar
Serving at e[4mhttp://352513e28798:3000e[0m, e[4mhttp://127.0.0.1:3000e[0m, e[4mhttp://172.17.0.139:3000e[0m
try this:
java -jar <FILENAME>.jar || echo -e "\e[38;5;21m error with java parsing" && exit
I can’t find the original project you listed here @saappir, so if you’re working in another project can you please share that name?
hey @cori the original project showed a crashpage for no reason, so i remixed it. it’s now called generated-marigold
odd… i should work???
@saappir you’re still running into the same problem I mentioned earlier. The assets
drawer represents files currently stored in Amazon’s S3 storage, not i n your project. You need to download the file to your project using the steps I linked to to get the file locally where your project can run it.