Running a Jar file then a JS file

Hey!

Does anyone know of a way I could run a Java file & JavaScript file at the same time without my computer running on glitch 24/7, because I’ve tried a shell NPM module and I’ve tried to use a start.sh file. But alas, no luck.

Kind Regards,
Cartar

I know you said shell files didnt work, but try this:
Create file called start.sh
Inside package.json, set the start to “./start.sh”
The content of start.sh should be something along the lines of

java FILE &
node FILE2 &
wait

I hope this helps you!

2 Likes

Hello @4xk,

I will definitely try this method out and get back to you asap to tell you if it works or not.

Kind Regards,
Ethan

1 Like

@4xk

Thank you very much! I just had to adjust the order the two files start with the server.js file first then putting a timeout on it starting then starting the Java server.

2 Likes

:smiley:
Nice, always love to help!

1 Like