java game builder: compiling the game

hello all :slight_smile:

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 :slight_smile:

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

Suggestions or other ideas always welcome.

Thanks.

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.

thanks! That sounds good. What would be the best way to write the game code then so it can be compiled?

Isn’t that your job? :wink:

I mean, what would be the best way to make and compile, in Java, the code of the user created “room”?

Just output the generated code to a file.
What is so hard about generating code?

Every person that knows how to write java-code can write a simple code-generator within an hour.
(In my opinion at least)

  • Longor1996