I'm currently writing on a tool that is client server based. Because of unstable IP-Adresses, my idea is to let the server-Application compile a client-application with the right IP of the server.
Step-by-step:
- The serverapplication starts.
- The user looks, what current IP his server-computer has (this can be done manually over a webbrowser).
- With this IP he creates (compiles) a client which search a connection to this IP (once started).
- To make this possible, it's necessary to compile the client, after the IP has been set.
- The client runs as background application without any GUI or console-window. So adding the IP on the client side isn't what I search for. The biggest newbies should be able to just run the client and their work ist done.
I tought that I could just unpack javac (out of the Java-application), then write the class to a file (as complete string) and then run a console command, which uses the javac.exe to compile a runnable jar file. But of course it isn't that easy. My problem is that I don't want to put the whole JDK-Folder to the server-application, just to compile the client. Does anyone of you know a proper way how I could handle this?
Important is, that I have to fight with computers, which haven't a JDK installed, just the standard JRE which hasn't a compiler on board (of course).