4 Replies Latest reply: Aug 27, 2011 6:19 PM by 884922 RSS

    JRL Questions

    884922
      Hello,

      I am a bit confused on the following portion of the license. I would like to start a project that allows a C++ programmer to access the JDK via the JNI (like a wrapper). I am debating as to whether I need to base my code on the OpenJDK or JDK6.


      III. RESEARCH USE RIGHTS.

      A. License Grant. Subject to the conditions contained herein, Sun
      grants to You a non-exclusive, non-transferable, worldwide, and
      royalty-free license to do the following for Your Research Use only:

      1. Reproduce, create Modifications of, and use the Technology
      alone, or with Modifications;

      2. Share source code of the Technology alone, or with
      Modifications, with other Licensees; and

      3. Distribute object code of the Technology, alone, or with
      Modifications, to any third parties for Research Use only, under a
      license of Your choice that is consistent with this License; and
      publish papers and books discussing the Technology which may include
      relevant excerpts that do not in the aggregate constitute a
      significant portion of the Technology.

      I would really appreciate if you could tell me whether I need to base my code on the OpenJDK or if I can use JDK 6. Here are some more details about the project I am starting.

      - Includes comments that will be generated using Doxygen. Documentation will be equivalent to OpenJDK or JDK 6.
      - The source code, documentation, and resulting DLL will be distributed free of charge.

      - C++ will be direct port of JDK 6 or OpenJDK using the JNI. In other words, int hashCode (in Java) will be replaced by jint hashCode (in C++), public class Object (in Java) will become class Object (in C++), etc.



      What does "under a license of Your choice that is consistent with this License" mean? Can you give an example of an additional license that might be applicable?

      I might also like to modify and sell a version of the JDK if possible. How much would it cost to distribute a C++ translation of JDK 6 or 7? Would I be paying an annual fee, purchasing a license for each individual copy I distribute, or paying a royalty fee for each copy that I sell? Would the Oracle Partner Program allow me to distribute a modified version of Java?

      Thank you for your time. If you think these questions would do better in another thread, please let me know.
        • 1. Re: JRL Questions
          EJP
          I don't think you've described your project correctly. It isn't a 'port' of a JDK at all. It is a wrapper around the JRE. Otherwise what does JNI have to do with it? So you are just writing C++ code and some JNI that eventually talks to a JRE. So if you do it right, you don't actually care which JRE is underneath: either of those should work; you don't have to distribute the JRE itself at all, you can use whatever the user has installed as long as the version agrees; so you aren't bound by the JRE licence at all as far as I can see, only by your own licence for your own code.
          • 2. Re: JRL Questions
            884922
            I don't think you've described your project correctly. It isn't a 'port' of a JDK at all. It is a wrapper around the JRE.
            Yes, I apologize for describing it as a 'port' when it is in fact a 'wrapper'.
            you can use whatever the user has installed as long as the version agrees; so you aren't bound by the JRE LICENCE at all as far as I can see, only by your own licence for your own code.
            That would be fantastic. I am happy to mark this thread as answered, but I would appreciate the opinion of others as well. Thanks for the response EJP :)
            • 3. Re: JRL Questions
              EJP
              Well no need to apologize, but it shows that understanding what you're doing, and describing it correctly to yourself, solves many a problem you do have, and eliminates many a problem you only think you have, because you misled yourself.
              • 4. Re: JRL Questions
                884922
                Yay, I just got the following code to work!

                     // Create and set up the window.
                     JFrame* frame = new JFrame("HelloWorldSwing");
                     
                     // Add the ubiquitous "Hello World" label.
                     JLabel* label = new JLabel("Hello World");
                     frame->getContentPane()->add(label);

                     // Display the window
                     frame->pack();
                     frame->setVisible(true);

                Now that I know how to write the wrapper, I will be writing a translator in ANTLR to speed up the process. In case you're curious, I have decided to apply the MIT license to this project. Thanks again EJP.