Uploading arduino using a java program

Is it possible to upload arduino sketch using java?

More explanation below:

Some details about my project:

I have built a java program that starts a gui, when pressing the "start" button, the java program sends out information through the usb to whatever is connected in that specific com.

in the background i have already started an arduino project and uploaded it to receive that information from java and sends information back to the java program, everything works.

My problem is:

Now I would like to make it a "child version" - meaning having an executable or jar file that every 8 yr old child can just double click on it (like starting any application) and it will open the gui and start+upload the ardunio in the background.

I do not want the user to have to start the arduino IDE, upload it, then start eclipse, run it... i just want 1 file that i can double click and it will open the gui for me.

I have no idea how to do this, i need your help.

Is it possible to upload arduino sketch using java?

Yes.

I have no idea how to do this, i need your help.

Use the IDE (Hey, take a deep breath, and stay with me) ONCE. Enable verbose mode for compiling and uploading.

Select upload. Pay attention to the commands that are executed. For a sketch with no libraries, the compiler is invoked once. The linker is invoked once. The avrdude application is invoked once.

Your Java app can execute the same three commands.

It gets more complicated if the sketch uses libraries, as each needs to be compiled, too.

Once you know what the IDE does, though, doing it yourself is easy (or easier).

Perhaps even simpler - have your Java program call the command-line version of the Arduino IDE.

This Python program that calls the command-line IDE may give you some ideas.

...R