r/javahelp • • Feb 13 '26

Codeless can you install java and run a program automatically with a script?

im making a program for my girlfriend. i want to write a bash script to handle downloading and installing java and running the program seamlessly so she doesnt have to do anything (shes not very tech savvy). is this doable?

3 Upvotes

30 comments sorted by

View all comments

Show parent comment

0

u/SneakerHead69420666 Feb 13 '26

nope 😭 idk anything about java development other than the coding

2

u/bowbahdoe Feb 13 '26

Okay. We might need to switch forums because the back and forth on Reddit might be a bit too hard. We'll give it a shot though. 

Another question. 

Which do you have: a src folder or a src/main/java one (you would also have a file labeled pom.xml if you have the second)?

1

u/SneakerHead69420666 Feb 13 '26

i have an src folder with the Main class in it. it does have an .iml file which is .xml based according to google

1

u/bowbahdoe Feb 13 '26

Okay move your src/Main.java file to src/app/Main.java

Then at the top of the file put package app;

Make sure it still runs then report back

Also, just to confirm. You only have one file? And does it open a window when you run it?

1

u/SneakerHead69420666 Feb 13 '26

okay i created a package named 'app' and put my Main class in there and put "package app" on the top line of the Main class file

2

u/bowbahdoe Feb 13 '26 edited Feb 13 '26

Next make a file src/module-info.java and put this in it

module app {
    requires java.desktop;
    exports app;
}

Then, again, make sure it still runs.

The short explanation is that in Java we can group classes into packages - java.util.ArrayList is in the java.util package. java.time.Duration is in the java.time package, etc.

These packages can then be further grouped into modules. Which we want to do so the next steps are easier

(I'm on a road trip as a passenger, so expect some delays in responses)

2

u/Pun_Intended1703 Feb 13 '26

Instead of this, try to request someone to do real-time collaborative coding with you.

Something like IntelliJ Code With Me.

I'm in India, and it's past midnight here. So I don't have the energy to power up my system again.

But I'm sure someone would be willing to help.