Playing with Java Compilation
I have developed an SDK in Java for wh开发者_运维知识库ich I also have a runtime. I want to restrict development using my runtime jars. My SDK is node-locked but I dont want to keep runtime node-locked so that my clients are free for developing applications using my SDK and sell and run at their clients using runtime. I havent written my own compiler and I dont want to. Can anybody suggest a trick to achieve this.
Do I understand this correctly: you want to find a way to allow free distribution of the JARs needed to run the programs developed with the SDK, but want to prevent people from using those runtime JARs to develop new apps?
If so, and if the SDK does not offer essential functionality that supports development but is not needed at runtime, then I think the best way is to make the runtime not something that is distributed as an independant JAR. Instead, have the SDK provide a build functionality that bundles the runtime and the application, and inserts some code into the runtime libraries that checks for the presence of that particular application and refuses to run otherwise.
精彩评论