From tjwatson at us.ibm.com Fri Sep 7 13:02:20 2012 From: tjwatson at us.ibm.com (Thomas Watson) Date: Fri, 7 Sep 2012 15:02:20 -0500 Subject: [Penrose-discuss] Questions about creating a simple module Message-ID: From http://planet.jboss.org/post/java_8_extensible_module_definitions_with_json I see that David Bosschaert has added support to penrose builds for json modue-info files. This is great since it seems like it would be an easy way to insert the necessary json text file into an existing jar to make it a module without having to use the latest jigsaw javac to compile the module-info.java file. But I am struggling with creating a very simple "hello module". My basic assumption is that I could insert a module-info.json file into the root of a simple jar file that looked like this: { "module" : { "name" : "x.test.mod1", "version" : "1.0", "exports" : [ { "name" : "x.test.mod1"} ] } } But when I do that and follow the quick start guide for jigsaw I get the following error trying to add such a jar to the module jmod -L mlib install x.test.mod1.jar org.openjdk.jigsaw.ConfigurationException: x.test.mod1.jar: not a modular JAR file Am I doing something wrong? How do I go about creating and running a modular JAR with json descriptor with penrose? Tom From zhangshj at linux.vnet.ibm.com Mon Sep 10 00:35:51 2012 From: zhangshj at linux.vnet.ibm.com (Shi Jun Zhang) Date: Mon, 10 Sep 2012 15:35:51 +0800 Subject: [Penrose-discuss] Questions about creating a simple module In-Reply-To: References: Message-ID: <504D9857.7080701@linux.vnet.ibm.com> On 9/8/2012 4:02 AM, Thomas Watson wrote: > > From > http://planet.jboss.org/post/java_8_extensible_module_definitions_with_json > I see that David Bosschaert has added support to penrose builds for json > modue-info files. This is great since it seems like it would be an easy > way to insert the necessary json text file into an existing jar to make it > a module without having to use the latest jigsaw javac to compile the > module-info.java file. But I am struggling with creating a very simple > "hello module". My basic assumption is that I could insert a > module-info.json file into the root of a simple jar file that looked like > this: > > { > "module" : > { > "name" : "x.test.mod1", > "version" : "1.0", > "exports" : [ { "name" : "x.test.mod1"} ] > } > } > > But when I do that and follow the quick start guide for jigsaw I get the > following error trying to add such a jar to the module > > jmod -L mlib install x.test.mod1.jar > org.openjdk.jigsaw.ConfigurationException: x.test.mod1.jar: not a > modular JAR file > > Am I doing something wrong? How do I go about creating and running a > modular JAR with json descriptor with penrose? > > Tom > HI Tom, "jmod install" command can install a jmod file or a folder contains compiled module class files. A regular jar file plus a module info file cannot be installed directly. You can use the following step to install a "hello module" 1. extract you x.test.modl.jar to a folder. For example, named as "classes" 2. move module-info.json to classes/META-INF/ 3. jmod -L mlib install classes x.test.modl -- Regards, Shi Jun Zhang From tjwatson at us.ibm.com Mon Sep 10 06:24:59 2012 From: tjwatson at us.ibm.com (Thomas Watson) Date: Mon, 10 Sep 2012 08:24:59 -0500 Subject: [Penrose-discuss] Questions about creating a simple module In-Reply-To: <504D9857.7080701@linux.vnet.ibm.com> References: <504D9857.7080701@linux.vnet.ibm.com> Message-ID: > Shi Jun Zhang wrote on 09/10/2012 02:35:51 AM: > HI Tom, > > "jmod install" command can install a jmod file or a folder contains > compiled module class files. A regular jar file plus a module info file > cannot be installed directly. > > You can use the following step to install a "hello module" > > 1. extract you x.test.modl.jar to a folder. For example, named as "classes" > > 2. move module-info.json to classes/META-INF/ > > 3. jmod -L mlib install classes x.test.modl > > > -- > Regards, > > Shi Jun Zhang > > Thanks Shi Jun Zhang, Do you have instructions for creating a jmod file using a json module descriptor? Is it just a matter of running the proper jpkg command against the directory "classes" that contains the META-INF/module-info.json file? jpkg -m classes jmod x.teset.mod1 Thanks. Tom From tjwatson at us.ibm.com Mon Sep 10 07:13:09 2012 From: tjwatson at us.ibm.com (Thomas Watson) Date: Mon, 10 Sep 2012 09:13:09 -0500 Subject: [Penrose-discuss] Questions about creating a simple module In-Reply-To: <504D9857.7080701@linux.vnet.ibm.com> References: <504D9857.7080701@linux.vnet.ibm.com> Message-ID: Do you know if "module jar" [1] is supported yet? If so is such a thing supported by using a META-INF/module-info.json file? Tom [1] http://openjdk.java.net/projects/jigsaw/doc/topics/modularjar.html From david.bosschaert at gmail.com Mon Sep 10 12:14:15 2012 From: david.bosschaert at gmail.com (David Bosschaert) Date: Mon, 10 Sep 2012 21:14:15 +0200 Subject: [Penrose-discuss] Questions about creating a simple module In-Reply-To: References: <504D9857.7080701@linux.vnet.ibm.com> Message-ID: Hi Tom, Yes, I'm pretty sure its possible to deploy a modular jar that contains META-INF/module-info.json (and no module-info.class). Shi Jun is right in that the tooling support is not yet complete, but the steps he posted should work. The penrose demos (in http://hg.openjdk.java.net/penrose/penrose) are converted to use META-INF/module-info.json, so they should show how you can use this in a module jar. The system tests [1] and [2] may also be of help to you... [1] shows a basic module using JSON metadata, while [2] shows a simple module that contains custom metadata in the JSON module definition. Best regards, David http://hg.openjdk.java.net/penrose/jigsaw/jdk/file/8ddc73840820/test/org/openjdk/jigsaw/hello-json.sh http://hg.openjdk.java.net/penrose/jigsaw/jdk/file/8ddc73840820/test/org/openjdk/jigsaw/hello-json-custom.sh On 10 September 2012 16:13, Thomas Watson wrote: > Do you know if "module jar" [1] is supported yet? If so is such a thing > supported by using a META-INF/module-info.json file? > > Tom > > [1] http://openjdk.java.net/projects/jigsaw/doc/topics/modularjar.html From zhangshj at linux.vnet.ibm.com Mon Sep 10 22:41:49 2012 From: zhangshj at linux.vnet.ibm.com (Shi Jun Zhang) Date: Tue, 11 Sep 2012 13:41:49 +0800 Subject: [Penrose-discuss] Questions about creating a simple module In-Reply-To: References: <504D9857.7080701@linux.vnet.ibm.com> Message-ID: <504ECF1D.6040802@linux.vnet.ibm.com> On 9/10/2012 9:24 PM, Thomas Watson wrote: >> Shi Jun Zhang wrote on 09/10/2012 02:35:51 > AM: >> HI Tom, >> >> "jmod install" command can install a jmod file or a folder contains >> compiled module class files. A regular jar file plus a module info file >> cannot be installed directly. >> >> You can use the following step to install a "hello module" >> >> 1. extract you x.test.modl.jar to a folder. For example, named as > "classes" >> 2. move module-info.json to classes/META-INF/ >> >> 3. jmod -L mlib install classes x.test.modl >> >> >> -- >> Regards, >> >> Shi Jun Zhang >> >> > Thanks Shi Jun Zhang, > > Do you have instructions for creating a jmod file using a json module > descriptor? Is it just a matter of running the proper jpkg command against > the directory "classes" that contains the META-INF/module-info.json file? > > jpkg -m classes jmod x.teset.mod1 > > Thanks. > > Tom Unfortunately it seems that the jpkg tool will need module-info.class to package the module. We need to do some code change to make jpkg support JSON format module info. -- Regards, Shi Jun Zhang From zhangshj at linux.vnet.ibm.com Tue Sep 11 01:13:17 2012 From: zhangshj at linux.vnet.ibm.com (Shi Jun Zhang) Date: Tue, 11 Sep 2012 16:13:17 +0800 Subject: [Penrose-discuss] Questions about creating a simple module In-Reply-To: References: <504D9857.7080701@linux.vnet.ibm.com> Message-ID: <504EF29D.9030301@linux.vnet.ibm.com> On 9/11/2012 3:14 AM, David Bosschaert wrote: > Hi Tom, > > Yes, I'm pretty sure its possible to deploy a modular jar that > contains META-INF/module-info.json (and no module-info.class). Shi Jun > is right in that the tooling support is not yet complete, but the > steps he posted should work. The penrose demos (in > http://hg.openjdk.java.net/penrose/penrose) are converted to use > META-INF/module-info.json, so they should show how you can use this in > a module jar. > > The system tests [1] and [2] may also be of help to you... [1] shows a > basic module using JSON metadata, while [2] shows a simple module that > contains custom metadata in the JSON module definition. > > Best regards, > > David > > http://hg.openjdk.java.net/penrose/jigsaw/jdk/file/8ddc73840820/test/org/openjdk/jigsaw/hello-json.sh > http://hg.openjdk.java.net/penrose/jigsaw/jdk/file/8ddc73840820/test/org/openjdk/jigsaw/hello-json-custom.sh > > > On 10 September 2012 16:13, Thomas Watson wrote: >> Do you know if "module jar" [1] is supported yet? If so is such a thing >> supported by using a META-INF/module-info.json file? >> >> Tom >> >> [1] http://openjdk.java.net/projects/jigsaw/doc/topics/modularjar.html Modular jar is already supported, but the modular jar with module-info.json is not supported yet. I will try to do some modification to make it work. -- Regards, Shi Jun Zhang From tjwatson at us.ibm.com Tue Sep 11 05:38:17 2012 From: tjwatson at us.ibm.com (Thomas Watson) Date: Tue, 11 Sep 2012 07:38:17 -0500 Subject: [Penrose-discuss] Questions about creating a simple module In-Reply-To: <504EF29D.9030301@linux.vnet.ibm.com> References: <504D9857.7080701@linux.vnet.ibm.com> <504EF29D.9030301@linux.vnet.ibm.com> Message-ID: > From: > > Shi Jun Zhang > > Modular jar is already supported, but the modular jar with > module-info.json is not supported yet. I will try to do some > modification to make it work. > > -- > Regards, > > Shi Jun Zhang > > Thanks Shi Jun, Let me know when you have something I can try. Tom. From tjwatson at us.ibm.com Tue Sep 11 05:45:03 2012 From: tjwatson at us.ibm.com (Thomas Watson) Date: Tue, 11 Sep 2012 07:45:03 -0500 Subject: [Penrose-discuss] Questions about creating a simple module In-Reply-To: <504ECF1D.6040802@linux.vnet.ibm.com> References: <504D9857.7080701@linux.vnet.ibm.com> <504ECF1D.6040802@linux.vnet.ibm.com> Message-ID: > From: > > Shi Jun Zhang > > Unfortunately it seems that the jpkg tool will need module-info.class to > package the module. We need to do some code change to make jpkg support > JSON format module info. > > -- > Regards, > > Shi Jun Zhang > > Thanks Shi Jun, That makes sense to me. It is not critical to get this working right now. I would rather we focus on getting the modular jars working with JSON first. That is the first format I would like to focus since it seems like the logical first format that would be used for developing modules that can run in both an OSGi framework and in the jigsaw modular system. Tom. From tjwatson at us.ibm.com Tue Sep 11 11:25:25 2012 From: tjwatson at us.ibm.com (Thomas Watson) Date: Tue, 11 Sep 2012 13:25:25 -0500 Subject: [Penrose-discuss] Questions about creating a simple module In-Reply-To: References: <504D9857.7080701@linux.vnet.ibm.com> Message-ID: David Bosschaert wrote on 09/10/2012 02:14:15 PM: > Hi Tom, > > Yes, I'm pretty sure its possible to deploy a modular jar that > contains META-INF/module-info.json (and no module-info.class). Shi Jun > is right in that the tooling support is not yet complete, but the > steps he posted should work. The penrose demos (in > http://hg.openjdk.java.net/penrose/penrose) are converted to use > META-INF/module-info.json, so they should show how you can use this in > a module jar. > > The system tests [1] and [2] may also be of help to you... [1] shows a > basic module using JSON metadata, while [2] shows a simple module that > contains custom metadata in the JSON module definition. > > Best regards, > > David > > http://hg.openjdk.java.net/penrose/jigsaw/jdk/file/8ddc73840820/ > test/org/openjdk/jigsaw/hello-json.sh > http://hg.openjdk.java.net/penrose/jigsaw/jdk/file/8ddc73840820/ > test/org/openjdk/jigsaw/hello-json-custom.sh > Sorry if this is a resend. I tried to send this message earlier but never saw it show up on the list: Thanks David, My understanding of this list is that I will be able to obtain answers that are under the duel license (licensed under the 3-clause BSD license and also GPLv2) as stated in the mail list info at http://mail.openjdk.java.net/mailman/listinfo/penrose-discuss Keeping that in mind, answers that point to example code that is only licensed under GPLv2 will not help. I will be using this list to ask lots of questions that others would likely find out simply by looking at the GPL source code. Unfortunately I don't have that option and I need to keep to a channel that avoids exposure to GPLv2 only source. Tom