so today I made a small game creation tool which allows to add objects (like Game Maker) to the game "room".So now I need to face a new challange: the compiling and sharing of games made with my creator

How would I do this? I want to create a jar file based of the game that they made.

You might be able to work something out with writing the code to a file and using Runtime.exec() or ProcessBuilder, passing javac and jar -c etc. to compile and package. I haven't heard good things about the reliability of process creation, though. You would also have to include the jdk files required (javac, jar, etc.), because otherwise not many people are going to be able to compile the files.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org