From Alan.Bateman at oracle.com Fri Sep 1 07:17:05 2017 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 1 Sep 2017 08:17:05 +0100 Subject: wscompile issues In-Reply-To: <277ced79-f3d2-1ae3-1c5e-dfed8ed84d93@forgerock.com> References: <277ced79-f3d2-1ae3-1c5e-dfed8ed84d93@forgerock.com> Message-ID: <0db5f21a-d137-839d-b181-3f70375df8e1@oracle.com> On 29/08/2017 06:45, Peter Major wrote: > Hi, > > > I'm not quite sure if this is the right mailing list to ask, but I'm > wondering whether there is a bug in wscompile in the build 9+181 version. > > In a project of mine, I have a java ant task calling > com.sun.xml.rpc.tools.wscompile.Main directly to generate some classes, > however it seems like that although I can influence the --add-modules > parameter for the java process itself, when wscompile eventually will > try to compile the classes it generated, it will fail to specify > java.xml.ws module, and as such the compilation fails with something like: > > ???? [java] > /Users/aldaris/projects/foo/target/generated-sources/wscompile/com/mycompany/FooBar_Tie.java:91: > error: cannot access Detail > ???? [java]???????????????? e.getFaultString(), e.getFaultActor(), > e.getDetail()); > > [java]?????????????????????????????????????????????????????????????????? ^ > ???? [java]?? class file for javax.xml.soap.Detail not found > ???? [java] Note: Some input files use unchecked or unsafe operations. > ???? [java] Note: Recompile with -Xlint:unchecked for details. > ???? [java] 1 error > ???? [java] error: compilation failed, errors should have been reported > > > Is this a bug in the JDK or am I just missing something glaringly obvious? > Is this JAX-RPC or the standalone version of the JAX-WS? Just checking as I thought the tools in the later were updated several years ago to use the javax.tools API. From your mail it sounds like the `wscompile` tool is forking `javac` and isn't picking up the environment and CLI options that are needed to compile the generated code. -Alan From peter.major at forgerock.com Fri Sep 1 08:06:02 2017 From: peter.major at forgerock.com (Peter Major) Date: Fri, 1 Sep 2017 09:06:02 +0100 Subject: wscompile issues In-Reply-To: <0db5f21a-d137-839d-b181-3f70375df8e1@oracle.com> References: <277ced79-f3d2-1ae3-1c5e-dfed8ed84d93@forgerock.com> <0db5f21a-d137-839d-b181-3f70375df8e1@oracle.com> Message-ID: <5cd6e07f-b98e-e58e-c479-beaefddcde2f@forgerock.com> Hi, 2017. 09. 01. 8:17 keltez?ssel, Alan Bateman ?rta: > Is this JAX-RPC or the standalone version of the JAX-WS? Just checking > as I thought the tools in the later were updated several years ago to > use the javax.tools API. I'm using wscompile to generate JAX-RPC server side stubs based on a WSDL in a legacy application. If there is a better way to approach this (without breaking existing clients), I would love to learn about it. > From your mail it sounds like the `wscompile` > tool is forking `javac` and isn't picking up the environment and CLI > options that are needed to compile the generated code. It is actually using reflection to execute com.sun.tools.javac.Main, but the compilation arguments are missing the --add-modules parameter. Having had to look at this again, I had to realize that wscompile is in no way actually part of the JDK, it's coming from the jaxrpc-impl project. I must have gotten confused by wsgen/wsimport/wscompile at one point... :( //So it does look I was missing something glaringly obvious in the end. Thanks for your time, and sorry about the rookie mistake. Best Regards, Peter Major From Alan.Bateman at oracle.com Fri Sep 1 08:36:41 2017 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 1 Sep 2017 09:36:41 +0100 Subject: wscompile issues In-Reply-To: <5cd6e07f-b98e-e58e-c479-beaefddcde2f@forgerock.com> References: <277ced79-f3d2-1ae3-1c5e-dfed8ed84d93@forgerock.com> <0db5f21a-d137-839d-b181-3f70375df8e1@oracle.com> <5cd6e07f-b98e-e58e-c479-beaefddcde2f@forgerock.com> Message-ID: <357f48b7-bacd-7cd2-bb06-73d474bf8f08@oracle.com> On 01/09/2017 09:06, Peter Major wrote: > : > It is actually using reflection to execute com.sun.tools.javac.Main, but > the compilation arguments are missing the --add-modules parameter. > > Having had to look at this again, I had to realize that wscompile is in > no way actually part of the JDK, it's coming from the jaxrpc-impl > project. I must have gotten confused by wsgen/wsimport/wscompile at one > point... :( Right, from the class name then I suspect you are using a dusty version of the Java Web Service Development Pack or the standalone version of JAX-WS that replaced it. You may find that you've got SAAJ in that distribution but that it's just not on the class path. So you may not need `--add-modules java.xml.ws` and in the future this will not work of course without putting this module on the module path (the proposal that is Java SE and JDK eventually jettison this module). -Alan. From sergei.tsypanov at yandex.ru Mon Sep 11 19:40:28 2017 From: sergei.tsypanov at yandex.ru (=?utf-8?B?0KHQtdGA0LPQtdC5INCm0YvQv9Cw0L3QvtCy?=) Date: Mon, 11 Sep 2017 21:40:28 +0200 Subject: [PATCH] java.util.Collections enhancement In-Reply-To: <1424031505158725@web45j.yandex.ru> Message-ID: <389541505158828@web15g.yandex.ru> Hi, looking into the code of java.util.Collections I've found out that EmptyList#toArray() and EmptySet#toArray() both instantiate new instance of Object[] at each call. As far as Java array is immutable it's possible to cache empty Object array and return this cached instance. Patch.txt is attached to the body of this mail. Thanks, - Sergei Tsypanov -------------- next part -------------- A non-text attachment was scrubbed... Name: patch.txt Type: text/x-diff Size: 1396 bytes Desc: not available URL: From david.holmes at oracle.com Mon Sep 11 21:27:58 2017 From: david.holmes at oracle.com (David Holmes) Date: Tue, 12 Sep 2017 07:27:58 +1000 Subject: [PATCH] java.util.Collections enhancement In-Reply-To: <389541505158828@web15g.yandex.ru> References: <389541505158828@web15g.yandex.ru> Message-ID: Moving to core-libs-dev ... On 12/09/2017 5:40 AM, ?????? ??????? wrote: > Hi, > > looking into the code of java.util.Collections I've found out that EmptyList#toArray() and EmptySet#toArray() both instantiate new instance of Object[] at each call. As far as Java array is immutable it's possible to cache empty Object array and return this cached instance. There is a slight issue with the specification of toArray here: "The returned array will be "safe" in that no references to it are maintained by this list. (In other words, this method must allocate a new array even if this list is backed by an array). " Of course for a zero-sized array it is perfectly safe to return a cached array, but the spec currently requires that a new array be returned. Cheers, David ----- > Patch.txt is attached to the body of this mail. > > Thanks, > - Sergei Tsypanov > > patch.txt > > diff --git a/src/java.base/share/classes/java/util/Collections.java b/src/java.base/share/classes/java/util/Collections.java > --- a/src/java.base/share/classes/java/util/Collections.java > +++ b/src/java.base/share/classes/java/util/Collections.java > @@ -108,6 +108,11 @@ > private static final int INDEXOFSUBLIST_THRESHOLD = 35; > > /** > + * Cached empty array > + */ > + private static final Object[] EMPTY_ARRAY = {}; > + > + /** > * Sorts the specified list into ascending order, according to the > * {@linkplain Comparable natural ordering} of its elements. > * All elements in the list must implement the {@link Comparable} > @@ -4329,7 +4334,7 @@ > public boolean contains(Object obj) {return false;} > public boolean containsAll(Collection c) { return c.isEmpty(); } > > - public Object[] toArray() { return new Object[0]; } > + public Object[] toArray() { return EMPTY_ARRAY; } > > public T[] toArray(T[] a) { > if (a.length > 0) > @@ -4458,7 +4463,7 @@ > public boolean contains(Object obj) {return false;} > public boolean containsAll(Collection c) { return c.isEmpty(); } > > - public Object[] toArray() { return new Object[0]; } > + public Object[] toArray() { return EMPTY_ARRAY; } > > public T[] toArray(T[] a) { > if (a.length > 0) From sormuras at gmail.com Sun Sep 17 08:22:34 2017 From: sormuras at gmail.com (Christian Stein) Date: Sun, 17 Sep 2017 10:22:34 +0200 Subject: javac with --module-source-path and without --module Message-ID: Hi all, is there an option similar to special "ALL-MODULE-PATH" constant usable with "--add-modules" when you want to compile all modules that can be found on the "--module-source-path"? At the moment, I'm using this verbose command ("-d" and "-p" omitted for brevity): javac --module-source-path src/main --module foo --module bar It would be nice to delegate the "find all module directories" to the javac tool like: javac --module-source-path src/main --module ALL-MODULE-SOURCE-PATH Cheers, Christian From forax at univ-mlv.fr Sun Sep 17 11:04:45 2017 From: forax at univ-mlv.fr (Remi Forax) Date: Sun, 17 Sep 2017 13:04:45 +0200 (CEST) Subject: javac with --module-source-path and without --module In-Reply-To: References: Message-ID: <1626717642.3558687.1505646285079.JavaMail.zimbra@u-pem.fr> Hi Christian, javac --module-source-path src/main should work. R?mi ----- Mail original ----- > De: "Christian Stein" > ?: jdk9-dev at openjdk.java.net > Envoy?: Dimanche 17 Septembre 2017 10:22:34 > Objet: javac with --module-source-path and without --module > Hi all, > > is there an option similar to special "ALL-MODULE-PATH" constant > usable with "--add-modules" when you want to compile all modules > that can be found on the "--module-source-path"? > > At the moment, I'm using this verbose command ("-d" and "-p" omitted for > brevity): > > javac --module-source-path src/main --module foo --module bar > > It would be nice to delegate the "find all module directories" to the javac > tool like: > > javac --module-source-path src/main --module ALL-MODULE-SOURCE-PATH > > Cheers, > Christian From sormuras at gmail.com Sun Sep 17 12:14:05 2017 From: sormuras at gmail.com (Christian Stein) Date: Sun, 17 Sep 2017 14:14:05 +0200 Subject: javac with --module-source-path and without --module In-Reply-To: <1626717642.3558687.1505646285079.JavaMail.zimbra@u-pem.fr> References: <1626717642.3558687.1505646285079.JavaMail.zimbra@u-pem.fr> Message-ID: On Sun, Sep 17, 2017 at 1:04 PM, Remi Forax wrote: > Hi Christian, > javac --module-source-path src/main > should work. > Then javac reports javac: no source files When I add an empty module as a synthetic root reading all other modules and use: javac --module-source-path src/main --module root it works. But if your application/library consists of independent module graphs, you can't compile them in one go. An advantage of the combination of "--module-source-path" and "--module" options is, you don't have to specify any .java source file. From forax at univ-mlv.fr Sun Sep 17 12:17:24 2017 From: forax at univ-mlv.fr (forax at univ-mlv.fr) Date: Sun, 17 Sep 2017 14:17:24 +0200 (CEST) Subject: javac with --module-source-path and without --module In-Reply-To: References: <1626717642.3558687.1505646285079.JavaMail.zimbra@u-pem.fr> Message-ID: <1539900045.3564692.1505650644489.JavaMail.zimbra@u-pem.fr> > De: "Christian Stein" > ?: "Remi Forax" > Cc: "jdk9-dev" > Envoy?: Dimanche 17 Septembre 2017 14:14:05 > Objet: Re: javac with --module-source-path and without --module > On Sun, Sep 17, 2017 at 1:04 PM, Remi Forax < [ mailto:forax at univ-mlv.fr | > forax at univ-mlv.fr ] > wrote: >> Hi Christian, >> javac --module-source-path src/main >> should work. > Then javac reports > javac: no source files yes, you need to specify the source files: javac --module-source-path src/main */*/*/*/*/java R?mi > When I add an empty module as a synthetic root reading all other modules and > use: > javac --module-source-path src/main --module root > it works. But if your application/library consists of independent module graphs, > you can't compile them in one go. > An advantage of the combination of "--module-source-path" and "--module" options > is, you don't have to specify any .java source file. From sadhak001 at gmail.com Tue Sep 19 21:55:16 2017 From: sadhak001 at gmail.com (Mani Sarkar) Date: Tue, 19 Sep 2017 21:55:16 +0000 Subject: Become an early Java 9 expert: AJUG + vJUG + JUGs Worldwide Hackday Feedback on JDK 9 EA Message-ID: Hi all, My apologies for the delayed message, as everyone is getting ready for JavaOne and also busy with working on JDK 9 RC1 feedback since last month. Last month (19th August 2017) AJUG and a number of JUGs worldwide with the help and support from vJUG, re-ran the "Become an early Java 9 expert" hackday. You can find the feedback gathered in http://bit.ly/J9HackDay-AJUG-feedback, we have been trailing JDK 9 EA b181 (RC1). I hope you will be able to make good use of the feedback and post your responses in the doc, I could also post the individual issues as separate messages if they become discussion worthy. Like the previous time, points that need addressing are marked with a rightwards arrowhead ( ? ) - we have had three categories of feedbacks namely *Potential bugs, Suggestions* and *Queries* about the different aspects of Jigsaw & Java 9. Please let me know if any other individuals or lists need to be informed about this. Thanks. Cheers, Mani -- @theNeomatrix369 * | **Blog ** | *@adoptopenjdk | Dev communities *Meet-a-Project - *MutabilityDetector * | **Bitbucket * * | **Github * * | **LinkedIn * *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ *Don't chase success, rather aim for "Excellence", and success will come chasing after you!* From sadhak001 at gmail.com Tue Sep 19 21:57:50 2017 From: sadhak001 at gmail.com (Mani Sarkar) Date: Tue, 19 Sep 2017 21:57:50 +0000 Subject: Become an early Java 9 expert: AJUG + vJUG + JUGs Worldwide Hackday Feedback on JDK 9 EA In-Reply-To: References: Message-ID: Adding hubert.pan3 at gmail.com, vaslabsco at gmail.com, mgrand at markgrand.com to the conversation. On Tue, 19 Sep 2017 at 22:55 Mani Sarkar wrote: > Hi all, > > My apologies for the delayed message, as everyone is getting ready for > JavaOne and also busy with working on JDK 9 RC1 feedback since last month. > > Last month (19th August 2017) AJUG and a number of JUGs worldwide with > the help and support from vJUG, re-ran the "Become an early Java 9 expert" > hackday. > > You can find the feedback gathered in > http://bit.ly/J9HackDay-AJUG-feedback, we have been trailing JDK 9 EA > b181 (RC1). > > I hope you will be able to make good use of the feedback and post your > responses in the doc, I could also post the individual issues as separate > messages if they become discussion worthy. > > Like the previous time, points that need addressing are marked with a > rightwards arrowhead ( ? ) - we have had three categories of feedbacks > namely *Potential bugs, Suggestions* and *Queries* about the different > aspects of Jigsaw & Java 9. > > Please let me know if any other individuals or lists need to be informed > about this. > > Thanks. > > Cheers, > Mani > -- > @theNeomatrix369 * | **Blog > ** | *@adoptopenjdk | Dev > communities > *Meet-a-Project - *MutabilityDetector > * | **Bitbucket > * * | **Github > * * | **LinkedIn > * > *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ > > *Don't chase success, rather aim for "Excellence", and success will come > chasing after you!* > -- @theNeomatrix369 * | **Blog ** | *@adoptopenjdk | Dev communities *Meet-a-Project - *MutabilityDetector * | **Bitbucket * * | **Github * * | **LinkedIn * *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ *Don't chase success, rather aim for "Excellence", and success will come chasing after you!* From alex.buckley at oracle.com Wed Sep 20 01:54:26 2017 From: alex.buckley at oracle.com (Alex Buckley) Date: Tue, 19 Sep 2017 18:54:26 -0700 Subject: Become an early Java 9 expert: AJUG + vJUG + JUGs Worldwide Hackday Feedback on JDK 9 EA In-Reply-To: References: Message-ID: <59C1CA52.6030504@oracle.com> Hi Mani, On 9/19/2017 2:55 PM, Mani Sarkar wrote: > Last month (19th August 2017) AJUG and a number of JUGs worldwide with the > help and support from vJUG, re-ran the "Become an early Java 9 expert" > hackday. Thank you AJUG and vJUG! > You can find the feedback gathered in http://bit.ly/J9HackDay-AJUG-feedback, > we have been trailing JDK 9 EA b181 (RC1). A lot of feedback seems to boil down to "JDK command line tools are not so easy to use; I want my IDE!". I don't mean to make light of people's usability issues, but the module-related paths and flags in JDK 9 tools tend to operate along similar lines as the paths and flags in JDK 8 tools -- it's just that a lot of people haven't set ANY paths and flags for a long time. I see there were some more open-ended questions and this one in particular caught my attention: ----- Do I need to convert a legacy Java program to use named modules in order to take advantage of the smaller images that jlink can create? Mani: You will have to convert your applications to use Java 9?s modules system in order to take advantage of JLink fully, although please play around with older legacy apps to see what JLink produces (most likely the whole JDK and not modularised pieces). Simon: create an empty module with module-info.java and handcraft the dependencies using requires and have jlink compile it. This is experimental, would need to be tested to see how it works. ----- The direct answer to the question is "No, you do not need to convert a legacy Java program to use named modules in order to take advantage of the smaller images that jlink can create." The Java runtime that's present in even the smallest image (just java.base) still lets you to put your pre-existing JAR files on the classpath and run them with java -cp. You do not need to turn your JAR files into named modules. Even as traditional JAR files, they have access to all the APIs that you would expect from such an image. (Obviously if your JAR files try to use Swing on an image built from just java.base, that won't work.) The reduced footprint and security surface of the smaller image is plainly an advantage from jlink. Alex From sadhak001 at gmail.com Fri Sep 22 14:21:04 2017 From: sadhak001 at gmail.com (Mani Sarkar) Date: Fri, 22 Sep 2017 14:21:04 +0000 Subject: Become an early Java 9 expert: AJUG + vJUG + JUGs Worldwide Hackday Feedback on JDK 9 EA In-Reply-To: <59C1CA52.6030504@oracle.com> References: <59C1CA52.6030504@oracle.com> Message-ID: Thanks Alex for the response, and clarifying the question further with your answer. There a few issues reported as well, would you want to comment on them, should I put them on a separate thread for further discussions? Cheers, Mani On Wed, 20 Sep 2017 at 02:54 Alex Buckley wrote: > Hi Mani, > > On 9/19/2017 2:55 PM, Mani Sarkar wrote: > > Last month (19th August 2017) AJUG and a number of JUGs worldwide with > the > > help and support from vJUG, re-ran the "Become an early Java 9 expert" > > hackday. > > Thank you AJUG and vJUG! > > > You can find the feedback gathered in > http://bit.ly/J9HackDay-AJUG-feedback, > > we have been trailing JDK 9 EA b181 (RC1). > > A lot of feedback seems to boil down to "JDK command line tools are not > so easy to use; I want my IDE!". I don't mean to make light of people's > usability issues, but the module-related paths and flags in JDK 9 tools > tend to operate along similar lines as the paths and flags in JDK 8 > tools -- it's just that a lot of people haven't set ANY paths and flags > for a long time. > > I see there were some more open-ended questions and this one in > particular caught my attention: > > ----- > Do I need to convert a legacy Java program to use named modules in order > to take advantage of the smaller images that jlink can create? > > Mani: You will have to convert your applications to use Java 9?s modules > system in order to take advantage of JLink fully, although please play > around with older legacy apps to see what JLink produces (most likely > the whole JDK and not modularised pieces). > > Simon: create an empty module with module-info.java and handcraft the > dependencies using requires and have jlink compile it. This is > experimental, would need to be tested to see how it works. > ----- > > The direct answer to the question is "No, you do not need to convert a > legacy Java program to use named modules in order to take advantage of > the smaller images that jlink can create." > > The Java runtime that's present in even the smallest image (just > java.base) still lets you to put your pre-existing JAR files on the > classpath and run them with java -cp. You do not need to turn your JAR > files into named modules. Even as traditional JAR files, they have > access to all the APIs that you would expect from such an image. > (Obviously if your JAR files try to use Swing on an image built from > just java.base, that won't work.) The reduced footprint and security > surface of the smaller image is plainly an advantage from jlink. > > Alex > -- @theNeomatrix369 * | **Blog ** | *@adoptopenjdk | Dev communities *Meet-a-Project - *MutabilityDetector * | **Bitbucket * * | **Github * * | **LinkedIn * *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ *Don't chase success, rather aim for "Excellence", and success will come chasing after you!* From kanth909 at gmail.com Fri Sep 22 17:54:46 2017 From: kanth909 at gmail.com (kant kodali) Date: Fri, 22 Sep 2017 10:54:46 -0700 Subject: Where to find jlink in Java 9? Message-ID: Hi All, I just installed Java 9 but not sure where to find jLink? when I type jshell in command line I can see something but when I type jlink it says "command not found". Thanks, kant From sadhak001 at gmail.com Fri Sep 22 18:20:36 2017 From: sadhak001 at gmail.com (Mani Sarkar) Date: Fri, 22 Sep 2017 18:20:36 +0000 Subject: Where to find jlink in Java 9? In-Reply-To: References: Message-ID: Have you set your path to point to the JAVA_HOME/bin folder ? On Fri, 22 Sep 2017 18:55 kant kodali wrote: > Hi All, > > I just installed Java 9 but not sure where to find jLink? when I type > jshell in command line I can see something but when I type jlink it says > "command not found". > > Thanks, > kant > -- @theNeomatrix369 * | **Blog ** | *@adoptopenjdk | Dev communities *Meet-a-Project - *MutabilityDetector * | **Bitbucket * * | **Github * * | **LinkedIn * *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ *Don't chase success, rather aim for "Excellence", and success will come chasing after you!* From kanth909 at gmail.com Fri Sep 22 18:33:18 2017 From: kanth909 at gmail.com (kant kodali) Date: Fri, 22 Sep 2017 11:33:18 -0700 Subject: Where to find jlink in Java 9? In-Reply-To: References: Message-ID: I just download and installed from oracle website. Also I did echo $JAVA_HOME. It returns the following "/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home" On Fri, Sep 22, 2017 at 11:20 AM, Mani Sarkar wrote: > Have you set your path to point to the JAVA_HOME/bin folder ? > > On Fri, 22 Sep 2017 18:55 kant kodali wrote: > >> Hi All, >> >> I just installed Java 9 but not sure where to find jLink? when I type >> jshell in command line I can see something but when I type jlink it says >> "command not found". >> >> Thanks, >> kant >> > -- > @theNeomatrix369 * | **Blog > ** | *@adoptopenjdk | Dev > communities > *Meet-a-Project - *MutabilityDetector > * | **Bitbucket > * * | **Github > * * | **LinkedIn > * > *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ > > *Don't chase success, rather aim for "Excellence", and success will come > chasing after you!* > From sadhak001 at gmail.com Fri Sep 22 18:35:03 2017 From: sadhak001 at gmail.com (Mani Sarkar) Date: Fri, 22 Sep 2017 18:35:03 +0000 Subject: Where to find jlink in Java 9? In-Reply-To: References: Message-ID: Also check if you have downloaded jdk or jre. Jre won't have javac, jlink and dev binaries. On Fri, 22 Sep 2017 19:40 Mani Sarkar wrote: > Have you set your path to point to the JAVA_HOME/bin folder ? > > On Fri, 22 Sep 2017 18:55 kant kodali wrote: > >> Hi All, >> >> I just installed Java 9 but not sure where to find jLink? when I type >> jshell in command line I can see something but when I type jlink it says >> "command not found". >> >> Thanks, >> kant >> > -- > @theNeomatrix369 * | **Blog > ** | *@adoptopenjdk | Dev > communities > *Meet-a-Project - *MutabilityDetector > * | **Bitbucket > * * | **Github > * * | **LinkedIn > * > *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ > > *Don't chase success, rather aim for "Excellence", and success will come > chasing after you!* > -- @theNeomatrix369 * | **Blog ** | *@adoptopenjdk | Dev communities *Meet-a-Project - *MutabilityDetector * | **Bitbucket * * | **Github * * | **LinkedIn * *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ *Don't chase success, rather aim for "Excellence", and success will come chasing after you!* From sadhak001 at gmail.com Fri Sep 22 18:36:29 2017 From: sadhak001 at gmail.com (Mani Sarkar) Date: Fri, 22 Sep 2017 18:36:29 +0000 Subject: Where to find jlink in Java 9? In-Reply-To: References: Message-ID: Have you checked the contents of this folder in file manager or via the command line ? On Fri, 22 Sep 2017 19:54 Mani Sarkar wrote: > Also check if you have downloaded jdk or jre. Jre won't have javac, jlink > and dev binaries. > > On Fri, 22 Sep 2017 19:40 Mani Sarkar wrote: > >> Have you set your path to point to the JAVA_HOME/bin folder ? >> >> On Fri, 22 Sep 2017 18:55 kant kodali wrote: >> >>> Hi All, >>> >>> I just installed Java 9 but not sure where to find jLink? when I type >>> jshell in command line I can see something but when I type jlink it says >>> "command not found". >>> >>> Thanks, >>> kant >>> >> -- >> @theNeomatrix369 * | **Blog >> ** | *@adoptopenjdk | Dev >> communities >> *Meet-a-Project - *MutabilityDetector >> * | **Bitbucket >> * * | **Github >> * * | **LinkedIn >> * >> *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ >> >> *Don't chase success, rather aim for "Excellence", and success will come >> chasing after you!* >> > -- > @theNeomatrix369 * | **Blog > ** | *@adoptopenjdk | Dev > communities > *Meet-a-Project - *MutabilityDetector > * | **Bitbucket > * * | **Github > * * | **LinkedIn > * > *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ > > *Don't chase success, rather aim for "Excellence", and success will come > chasing after you!* > -- @theNeomatrix369 * | **Blog ** | *@adoptopenjdk | Dev communities *Meet-a-Project - *MutabilityDetector * | **Bitbucket * * | **Github * * | **LinkedIn * *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ *Don't chase success, rather aim for "Excellence", and success will come chasing after you!* From swpalmer at gmail.com Fri Sep 22 18:36:34 2017 From: swpalmer at gmail.com (Scott Palmer) Date: Fri, 22 Sep 2017 14:36:34 -0400 Subject: Where to find jlink in Java 9? In-Reply-To: References: Message-ID: <183A2A20-7CEF-4840-B45B-9B5D039DC7F2@gmail.com> I see you are on macOS. I expect the magic java executables that redirect to the binaries in $JAVA_HOME are missing some of the new commands in Java 9. Apple makes that part of it I think. Scott > On Sep 22, 2017, at 2:33 PM, kant kodali wrote: > > I just download and installed from oracle website. Also I did echo > $JAVA_HOME. It returns the following > > > "/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home" > >> On Fri, Sep 22, 2017 at 11:20 AM, Mani Sarkar wrote: >> >> Have you set your path to point to the JAVA_HOME/bin folder ? >> >>> On Fri, 22 Sep 2017 18:55 kant kodali wrote: >>> >>> Hi All, >>> >>> I just installed Java 9 but not sure where to find jLink? when I type >>> jshell in command line I can see something but when I type jlink it says >>> "command not found". >>> >>> Thanks, >>> kant >>> >> -- >> @theNeomatrix369 * | **Blog >> ** | *@adoptopenjdk | Dev >> communities >> *Meet-a-Project - *MutabilityDetector >> * | **Bitbucket >> * * | **Github >> * * | **LinkedIn >> * >> *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ >> >> *Don't chase success, rather aim for "Excellence", and success will come >> chasing after you!* >> From kanth909 at gmail.com Fri Sep 22 18:37:41 2017 From: kanth909 at gmail.com (kant kodali) Date: Fri, 22 Sep 2017 11:37:41 -0700 Subject: Where to find jlink in Java 9? In-Reply-To: References: Message-ID: I downloaded from here. http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html I couldn't find a link to download JRE? On Fri, Sep 22, 2017 at 11:20 AM, Mani Sarkar wrote: > Have you set your path to point to the JAVA_HOME/bin folder ? > > On Fri, 22 Sep 2017 18:55 kant kodali wrote: > >> Hi All, >> >> I just installed Java 9 but not sure where to find jLink? when I type >> jshell in command line I can see something but when I type jlink it says >> "command not found". >> >> Thanks, >> kant >> > -- > @theNeomatrix369 * | **Blog > ** | *@adoptopenjdk | Dev > communities > *Meet-a-Project - *MutabilityDetector > * | **Bitbucket > * * | **Github > * * | **LinkedIn > * > *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ > > *Don't chase success, rather aim for "Excellence", and success will come > chasing after you!* > From kanth909 at gmail.com Fri Sep 22 18:41:00 2017 From: kanth909 at gmail.com (kant kodali) Date: Fri, 22 Sep 2017 11:41:00 -0700 Subject: Where to find jlink in Java 9? In-Reply-To: References: Message-ID: yes there is jlink when I do. ls /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin so I should set my JAVA_HOME to /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home or /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin ? On Fri, Sep 22, 2017 at 11:37 AM, kant kodali wrote: > I downloaded from here. http://www.oracle.com/technetwork/java/javase/ > downloads/jdk9-downloads-3848520.html > > I couldn't find a link to download JRE? > > On Fri, Sep 22, 2017 at 11:20 AM, Mani Sarkar wrote: > >> Have you set your path to point to the JAVA_HOME/bin folder ? >> >> On Fri, 22 Sep 2017 18:55 kant kodali wrote: >> >>> Hi All, >>> >>> I just installed Java 9 but not sure where to find jLink? when I type >>> jshell in command line I can see something but when I type jlink it says >>> "command not found". >>> >>> Thanks, >>> kant >>> >> -- >> @theNeomatrix369 * | **Blog >> ** | *@adoptopenjdk | Dev >> communities >> *Meet-a-Project - *MutabilityDetector >> * | **Bitbucket >> * * | **Github >> * * | **LinkedIn >> * >> *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ >> >> *Don't chase success, rather aim for "Excellence", and success will come >> chasing after you!* >> > > From kanth909 at gmail.com Fri Sep 22 18:48:19 2017 From: kanth909 at gmail.com (kant kodali) Date: Fri, 22 Sep 2017 11:48:19 -0700 Subject: Where to find jlink in Java 9? In-Reply-To: References: Message-ID: @scott that makes sense! I am not sure when Apple is going to create them but for now, I will have this bin folder in my .bashrc I guess. On Fri, Sep 22, 2017 at 11:41 AM, kant kodali wrote: > yes there is jlink when I do. > > ls /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin > > so I should set my JAVA_HOME to /Library/Java/ > JavaVirtualMachines/jdk-9.jdk/Contents/Home or /Library/Java/ > JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin ? > > On Fri, Sep 22, 2017 at 11:37 AM, kant kodali wrote: > >> I downloaded from here. http://www.oracle.com/technetw >> ork/java/javase/downloads/jdk9-downloads-3848520.html >> >> I couldn't find a link to download JRE? >> >> On Fri, Sep 22, 2017 at 11:20 AM, Mani Sarkar >> wrote: >> >>> Have you set your path to point to the JAVA_HOME/bin folder ? >>> >>> On Fri, 22 Sep 2017 18:55 kant kodali wrote: >>> >>>> Hi All, >>>> >>>> I just installed Java 9 but not sure where to find jLink? when I type >>>> jshell in command line I can see something but when I type jlink it says >>>> "command not found". >>>> >>>> Thanks, >>>> kant >>>> >>> -- >>> @theNeomatrix369 * | **Blog >>> ** | *@adoptopenjdk | Dev >>> communities >>> *Meet-a-Project - *MutabilityDetector >>> * | **Bitbucket >>> * * | **Github >>> * * | **LinkedIn >>> * >>> *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ >>> >>> *Don't chase success, rather aim for "Excellence", and success will come >>> chasing after you!* >>> >> >> > From kanth909 at gmail.com Fri Sep 22 20:09:31 2017 From: kanth909 at gmail.com (kant kodali) Date: Fri, 22 Sep 2017 13:09:31 -0700 Subject: Do I need to have Java 9 installed to run the image generated by jLink? Message-ID: Hi All, Let's say I create a modularize my app and generate a image using jLink on machine1 and from what I understand the image has the runtime as well so if I transfer this image to machine 2 which has nothing installed(not even Java) can I simply run my app on machine? or does machine2 also need to have Java installed? Thanks! From swpalmer at gmail.com Fri Sep 22 22:36:20 2017 From: swpalmer at gmail.com (Scott Palmer) Date: Fri, 22 Sep 2017 18:36:20 -0400 Subject: Do I need to have Java 9 installed to run the image generated by jLink? In-Reply-To: References: Message-ID: I believe that is the intention. I think you use javapackager to bundle the image up into something that is self-contained. Scott > On Sep 22, 2017, at 4:09 PM, kant kodali wrote: > > Hi All, > > Let's say I create a modularize my app and generate a image using jLink on > machine1 and from what I understand the image has the runtime as well so if > I transfer this image to machine 2 which has nothing installed(not even > Java) can I simply run my app on machine? or does machine2 also need to > have Java installed? > > Thanks! From sadhak001 at gmail.com Fri Sep 22 22:40:05 2017 From: sadhak001 at gmail.com (Mani Sarkar) Date: Fri, 22 Sep 2017 22:40:05 +0000 Subject: Do I need to have Java 9 installed to run the image generated by jLink? In-Reply-To: References: Message-ID: Have a look at the examples and exercises at https://github.com/AdoptOpenJDK/jdk9-jigsaw, and you can see how to use jlink and the produced artifacts. On Fri, 22 Sep 2017 23:36 Scott Palmer wrote: > I believe that is the intention. I think you use javapackager to bundle > the image up into something that is self-contained. > > Scott > > > > On Sep 22, 2017, at 4:09 PM, kant kodali wrote: > > > > Hi All, > > > > Let's say I create a modularize my app and generate a image using jLink > on > > machine1 and from what I understand the image has the runtime as well so > if > > I transfer this image to machine 2 which has nothing installed(not even > > Java) can I simply run my app on machine? or does machine2 also need to > > have Java installed? > > > > Thanks! > > -- @theNeomatrix369 * | **Blog ** | *@adoptopenjdk | Dev communities *Meet-a-Project - *MutabilityDetector * | **Bitbucket * * | **Github * * | **LinkedIn * *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ *Don't chase success, rather aim for "Excellence", and success will come chasing after you!* From sundararajan.athijegannathan at oracle.com Sat Sep 23 01:38:58 2017 From: sundararajan.athijegannathan at oracle.com (Sundararajan Athijegannathan) Date: Sat, 23 Sep 2017 07:08:58 +0530 Subject: Do I need to have Java 9 installed to run the image generated by jLink? In-Reply-To: References: Message-ID: <59C5BB32.7030209@oracle.com> Hi, jlink produced image dir is complete - it has jvm, required platform + app modules, config. etc. to run your modular app. You don't need to install java separately on the target machine ("machine 2"). Thanks, -Sundar On 23/09/17, 1:39 AM, kant kodali wrote: > Hi All, > > Let's say I create a modularize my app and generate a image using jLink on > machine1 and from what I understand the image has the runtime as well so if > I transfer this image to machine 2 which has nothing installed(not even > Java) can I simply run my app on machine? or does machine2 also need to > have Java installed? > > Thanks! From sadhak001 at gmail.com Sat Sep 23 10:09:38 2017 From: sadhak001 at gmail.com (Mani Sarkar) Date: Sat, 23 Sep 2017 10:09:38 +0000 Subject: Do I need to have Java 9 installed to run the image generated by jLink? In-Reply-To: <59C5BB32.7030209@oracle.com> References: <59C5BB32.7030209@oracle.com> Message-ID: Hi Sundar, Although can we cannot run this app on any OS on the target machine, but the specific OS it has been compiled/linked on. So its portable across machines across the same OS type. I hope my understanding is correct, happy to be corrected. Thanks. Regards, Mani On Sat, 23 Sep 2017 02:35 Sundararajan Athijegannathan < sundararajan.athijegannathan at oracle.com> wrote: > Hi, > > jlink produced image dir is complete - it has jvm, required platform + > app modules, config. etc. to run your modular app. You don't need to > install java separately on the target machine ("machine 2"). > > Thanks, > -Sundar > > On 23/09/17, 1:39 AM, kant kodali wrote: > > Hi All, > > > > Let's say I create a modularize my app and generate a image using jLink > on > > machine1 and from what I understand the image has the runtime as well so > if > > I transfer this image to machine 2 which has nothing installed(not even > > Java) can I simply run my app on machine? or does machine2 also need to > > have Java installed? > > > > Thanks! > -- @theNeomatrix369 * | **Blog ** | *@adoptopenjdk | Dev communities *Meet-a-Project - *MutabilityDetector * | **Bitbucket * * | **Github * * | **LinkedIn * *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ *Don't chase success, rather aim for "Excellence", and success will come chasing after you!* From kanth909 at gmail.com Sun Sep 24 23:43:22 2017 From: kanth909 at gmail.com (kant kodali) Date: Sun, 24 Sep 2017 16:43:22 -0700 Subject: Does Module system in Java 9 allow circular dependency? Message-ID: Hi All, Does Module system in Java 9 allow circular dependency? For example, Say Module A requires Module B and Module B requires Module A. Is this allowed? If so how is this resolved? Thanks! From kanth909 at gmail.com Sun Sep 24 23:45:31 2017 From: kanth909 at gmail.com (kant kodali) Date: Sun, 24 Sep 2017 16:45:31 -0700 Subject: Does Module system in Java 9 allow circular dependency? In-Reply-To: References: Message-ID: Another example would be. Module A depends on Module B and Module B depends on Module C and Module C depends on Module A. On Sun, Sep 24, 2017 at 4:43 PM, kant kodali wrote: > Hi All, > > Does Module system in Java 9 allow circular dependency? For example, Say > Module A requires Module B and Module B requires Module A. Is this allowed? > If so how is this resolved? > > Thanks! > From orionllmain at gmail.com Mon Sep 25 02:04:25 2017 From: orionllmain at gmail.com (Zheka Kozlov) Date: Mon, 25 Sep 2017 09:04:25 +0700 Subject: Does Module system in Java 9 allow circular dependency? In-Reply-To: References: Message-ID: No, the module system does not allow circular dependencies. 2017-09-25 6:45 GMT+07:00 kant kodali : > Another example would be. Module A depends on Module B and Module B depends > on Module C and Module C depends on Module A. > > > > On Sun, Sep 24, 2017 at 4:43 PM, kant kodali wrote: > > > Hi All, > > > > Does Module system in Java 9 allow circular dependency? For example, Say > > Module A requires Module B and Module B requires Module A. Is this > allowed? > > If so how is this resolved? > > > > Thanks! > > > From sundararajan.athijegannathan at oracle.com Mon Sep 25 02:21:55 2017 From: sundararajan.athijegannathan at oracle.com (Sundararajan Athijegannathan) Date: Mon, 25 Sep 2017 07:51:55 +0530 Subject: Do I need to have Java 9 installed to run the image generated by jLink? In-Reply-To: References: <59C5BB32.7030209@oracle.com> Message-ID: <59C86843.7060903@oracle.com> Hi, Right. The jvm and other shared objects are obviously platform dependent and so jlink produced binaries can only be run on specific target platform. That said, his question was about whether he still needs to install Java to use the produced image. I answered that question. (i.e., the image is complete and does not require java to be installed to use). Thanks, -Sundar On 23/09/17, 3:39 PM, Mani Sarkar wrote: > Hi Sundar, > > Although can we cannot run this app on any OS on the target machine, > but the specific OS it has been compiled/linked on. > > So its portable across machines across the same OS type. > > I hope my understanding is correct, happy to be corrected. > > Thanks. > > Regards, > Mani > > > > On Sat, 23 Sep 2017 02:35 Sundararajan Athijegannathan > > wrote: > > Hi, > > jlink produced image dir is complete - it has jvm, required platform + > app modules, config. etc. to run your modular app. You don't need to > install java separately on the target machine ("machine 2"). > > Thanks, > -Sundar > > On 23/09/17, 1:39 AM, kant kodali wrote: > > Hi All, > > > > Let's say I create a modularize my app and generate a image > using jLink on > > machine1 and from what I understand the image has the runtime as > well so if > > I transfer this image to machine 2 which has nothing > installed(not even > > Java) can I simply run my app on machine? or does machine2 also > need to > > have Java installed? > > > > Thanks! > > -- > @theNeomatrix369 * | **Blog > ** | *@adoptopenjdk | Dev > communities > *Meet-a-Project - *MutabilityDetector > * | **Bitbucket > * * | **Github > ** | **LinkedIn > * > *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ > > */Don't chase success, rather aim for "Excellence", and success will > come chasing after you!/* From kanth909 at gmail.com Mon Sep 25 02:56:54 2017 From: kanth909 at gmail.com (kant kodali) Date: Sun, 24 Sep 2017 19:56:54 -0700 Subject: Do I need to have Java 9 installed to run the image generated by jLink? In-Reply-To: <59C86843.7060903@oracle.com> References: <59C5BB32.7030209@oracle.com> <59C86843.7060903@oracle.com> Message-ID: If Jlink produces an image that is "portable across machines across the same OS type". This would defeat the purpose of JVM right? If I use jlink and produce an image on mac I should be able to run on windows isn't it? On Sun, Sep 24, 2017 at 7:21 PM, Sundararajan Athijegannathan < sundararajan.athijegannathan at oracle.com> wrote: > Hi, > > Right. The jvm and other shared objects are obviously platform dependent > and so jlink produced binaries can only be run on specific target platform. > That said, his question was about whether he still needs to install Java to > use the produced image. I answered that question. (i.e., the image is > complete and does not require java to be installed to use). > > Thanks, > -Sundar > > > On 23/09/17, 3:39 PM, Mani Sarkar wrote: > > Hi Sundar, > > Although can we cannot run this app on any OS on the target machine, but > the specific OS it has been compiled/linked on. > > So its portable across machines across the same OS type. > > I hope my understanding is correct, happy to be corrected. > > Thanks. > > Regards, > Mani > > > > On Sat, 23 Sep 2017 02:35 Sundararajan Athijegannathan < > sundararajan.athijegannathan at oracle.com> wrote: > >> Hi, >> >> jlink produced image dir is complete - it has jvm, required platform + >> app modules, config. etc. to run your modular app. You don't need to >> install java separately on the target machine ("machine 2"). >> >> Thanks, >> -Sundar >> >> On 23/09/17, 1:39 AM, kant kodali wrote: >> > Hi All, >> > >> > Let's say I create a modularize my app and generate a image using jLink >> on >> > machine1 and from what I understand the image has the runtime as well >> so if >> > I transfer this image to machine 2 which has nothing installed(not even >> > Java) can I simply run my app on machine? or does machine2 also need to >> > have Java installed? >> > >> > Thanks! >> > -- > @theNeomatrix369 * | **Blog > ** | *@adoptopenjdk | Dev > communities > *Meet-a-Project - *MutabilityDetector > * | **Bitbucket > * * | **Github > * * | **LinkedIn > * > *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ > > *Don't chase success, rather aim for "Excellence", and success will come > chasing after you!* > > From david.holmes at oracle.com Mon Sep 25 03:28:33 2017 From: david.holmes at oracle.com (David Holmes) Date: Mon, 25 Sep 2017 13:28:33 +1000 Subject: Do I need to have Java 9 installed to run the image generated by jLink? In-Reply-To: References: <59C5BB32.7030209@oracle.com> <59C86843.7060903@oracle.com> Message-ID: <8f7b04f4-8360-e5ce-ce30-b1a4a8930806@oracle.com> On 25/09/2017 12:56 PM, kant kodali wrote: > If Jlink produces an image that is "portable across machines across the > same OS type". This would defeat the purpose of JVM right? If I use jlink > and produce an image on mac I should be able to run on windows isn't it? A jlink image is created for a specific platform (OS + CPU combination). It contains executables and native libraries built for a specific platform. David ----- > On Sun, Sep 24, 2017 at 7:21 PM, Sundararajan Athijegannathan < > sundararajan.athijegannathan at oracle.com> wrote: > >> Hi, >> >> Right. The jvm and other shared objects are obviously platform dependent >> and so jlink produced binaries can only be run on specific target platform. >> That said, his question was about whether he still needs to install Java to >> use the produced image. I answered that question. (i.e., the image is >> complete and does not require java to be installed to use). >> >> Thanks, >> -Sundar >> >> >> On 23/09/17, 3:39 PM, Mani Sarkar wrote: >> >> Hi Sundar, >> >> Although can we cannot run this app on any OS on the target machine, but >> the specific OS it has been compiled/linked on. >> >> So its portable across machines across the same OS type. >> >> I hope my understanding is correct, happy to be corrected. >> >> Thanks. >> >> Regards, >> Mani >> >> >> >> On Sat, 23 Sep 2017 02:35 Sundararajan Athijegannathan < >> sundararajan.athijegannathan at oracle.com> wrote: >> >>> Hi, >>> >>> jlink produced image dir is complete - it has jvm, required platform + >>> app modules, config. etc. to run your modular app. You don't need to >>> install java separately on the target machine ("machine 2"). >>> >>> Thanks, >>> -Sundar >>> >>> On 23/09/17, 1:39 AM, kant kodali wrote: >>>> Hi All, >>>> >>>> Let's say I create a modularize my app and generate a image using jLink >>> on >>>> machine1 and from what I understand the image has the runtime as well >>> so if >>>> I transfer this image to machine 2 which has nothing installed(not even >>>> Java) can I simply run my app on machine? or does machine2 also need to >>>> have Java installed? >>>> >>>> Thanks! >>> >> -- >> @theNeomatrix369 * | **Blog >> ** | *@adoptopenjdk | Dev >> communities >> *Meet-a-Project - *MutabilityDetector >> * | **Bitbucket >> * * | **Github >> * * | **LinkedIn >> * >> *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ >> >> *Don't chase success, rather aim for "Excellence", and success will come >> chasing after you!* >> >> From kanth909 at gmail.com Mon Sep 25 03:37:58 2017 From: kanth909 at gmail.com (kant kodali) Date: Sun, 24 Sep 2017 20:37:58 -0700 Subject: Do I need to have Java 9 installed to run the image generated by jLink? In-Reply-To: <8f7b04f4-8360-e5ce-ce30-b1a4a8930806@oracle.com> References: <59C5BB32.7030209@oracle.com> <59C86843.7060903@oracle.com> <8f7b04f4-8360-e5ce-ce30-b1a4a8930806@oracle.com> Message-ID: Is there a anyway to create self contained image independent of platform ? On Sun, Sep 24, 2017 at 8:28 PM, David Holmes wrote: > On 25/09/2017 12:56 PM, kant kodali wrote: > >> If Jlink produces an image that is "portable across machines across the >> same OS type". This would defeat the purpose of JVM right? If I use jlink >> and produce an image on mac I should be able to run on windows isn't it? >> > > A jlink image is created for a specific platform (OS + CPU combination). > It contains executables and native libraries built for a specific platform. > > David > ----- > > On Sun, Sep 24, 2017 at 7:21 PM, Sundararajan Athijegannathan < >> sundararajan.athijegannathan at oracle.com> wrote: >> >> Hi, >>> >>> Right. The jvm and other shared objects are obviously platform dependent >>> and so jlink produced binaries can only be run on specific target >>> platform. >>> That said, his question was about whether he still needs to install Java >>> to >>> use the produced image. I answered that question. (i.e., the image is >>> complete and does not require java to be installed to use). >>> >>> Thanks, >>> -Sundar >>> >>> >>> On 23/09/17, 3:39 PM, Mani Sarkar wrote: >>> >>> Hi Sundar, >>> >>> Although can we cannot run this app on any OS on the target machine, but >>> the specific OS it has been compiled/linked on. >>> >>> So its portable across machines across the same OS type. >>> >>> I hope my understanding is correct, happy to be corrected. >>> >>> Thanks. >>> >>> Regards, >>> Mani >>> >>> >>> >>> On Sat, 23 Sep 2017 02:35 Sundararajan Athijegannathan < >>> sundararajan.athijegannathan at oracle.com> wrote: >>> >>> Hi, >>>> >>>> jlink produced image dir is complete - it has jvm, required platform + >>>> app modules, config. etc. to run your modular app. You don't need to >>>> install java separately on the target machine ("machine 2"). >>>> >>>> Thanks, >>>> -Sundar >>>> >>>> On 23/09/17, 1:39 AM, kant kodali wrote: >>>> >>>>> Hi All, >>>>> >>>>> Let's say I create a modularize my app and generate a image using jLink >>>>> >>>> on >>>> >>>>> machine1 and from what I understand the image has the runtime as well >>>>> >>>> so if >>>> >>>>> I transfer this image to machine 2 which has nothing installed(not even >>>>> Java) can I simply run my app on machine? or does machine2 also need to >>>>> have Java installed? >>>>> >>>>> Thanks! >>>>> >>>> >>>> -- >>> @theNeomatrix369 * | **Blog >>> ** | *@adoptopenjdk | Dev >>> communities >>> *Meet-a-Project - *MutabilityDetector >>> * | **Bitbucket >>> * * | **Github >>> * * | **LinkedIn >>> * >>> *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ >>> >>> *Don't chase success, rather aim for "Excellence", and success will come >>> chasing after you!* >>> >>> >>> From kanth909 at gmail.com Mon Sep 25 03:38:15 2017 From: kanth909 at gmail.com (kant kodali) Date: Sun, 24 Sep 2017 20:38:15 -0700 Subject: Do I need to have Java 9 installed to run the image generated by jLink? In-Reply-To: References: <59C5BB32.7030209@oracle.com> <59C86843.7060903@oracle.com> <8f7b04f4-8360-e5ce-ce30-b1a4a8930806@oracle.com> Message-ID: Is there anyway to create self contained image independent of platform ? On Sun, Sep 24, 2017 at 8:37 PM, kant kodali wrote: > Is there a anyway to create self contained image independent of platform ? > > On Sun, Sep 24, 2017 at 8:28 PM, David Holmes > wrote: > >> On 25/09/2017 12:56 PM, kant kodali wrote: >> >>> If Jlink produces an image that is "portable across machines across the >>> same OS type". This would defeat the purpose of JVM right? If I use jlink >>> and produce an image on mac I should be able to run on windows isn't it? >>> >> >> A jlink image is created for a specific platform (OS + CPU combination). >> It contains executables and native libraries built for a specific platform. >> >> David >> ----- >> >> On Sun, Sep 24, 2017 at 7:21 PM, Sundararajan Athijegannathan < >>> sundararajan.athijegannathan at oracle.com> wrote: >>> >>> Hi, >>>> >>>> Right. The jvm and other shared objects are obviously platform dependent >>>> and so jlink produced binaries can only be run on specific target >>>> platform. >>>> That said, his question was about whether he still needs to install >>>> Java to >>>> use the produced image. I answered that question. (i.e., the image is >>>> complete and does not require java to be installed to use). >>>> >>>> Thanks, >>>> -Sundar >>>> >>>> >>>> On 23/09/17, 3:39 PM, Mani Sarkar wrote: >>>> >>>> Hi Sundar, >>>> >>>> Although can we cannot run this app on any OS on the target machine, but >>>> the specific OS it has been compiled/linked on. >>>> >>>> So its portable across machines across the same OS type. >>>> >>>> I hope my understanding is correct, happy to be corrected. >>>> >>>> Thanks. >>>> >>>> Regards, >>>> Mani >>>> >>>> >>>> >>>> On Sat, 23 Sep 2017 02:35 Sundararajan Athijegannathan < >>>> sundararajan.athijegannathan at oracle.com> wrote: >>>> >>>> Hi, >>>>> >>>>> jlink produced image dir is complete - it has jvm, required platform + >>>>> app modules, config. etc. to run your modular app. You don't need to >>>>> install java separately on the target machine ("machine 2"). >>>>> >>>>> Thanks, >>>>> -Sundar >>>>> >>>>> On 23/09/17, 1:39 AM, kant kodali wrote: >>>>> >>>>>> Hi All, >>>>>> >>>>>> Let's say I create a modularize my app and generate a image using >>>>>> jLink >>>>>> >>>>> on >>>>> >>>>>> machine1 and from what I understand the image has the runtime as well >>>>>> >>>>> so if >>>>> >>>>>> I transfer this image to machine 2 which has nothing installed(not >>>>>> even >>>>>> Java) can I simply run my app on machine? or does machine2 also need >>>>>> to >>>>>> have Java installed? >>>>>> >>>>>> Thanks! >>>>>> >>>>> >>>>> -- >>>> @theNeomatrix369 * | **Blog >>>> ** | *@adoptopenjdk | Dev >>>> communities >>>> *Meet-a-Project - *MutabilityDetector >>>> * | **Bitbucket >>>> * * | **Github >>>> * * | **LinkedIn >>>> * >>>> *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ >>>> >>>> *Don't chase success, rather aim for "Excellence", and success will come >>>> chasing after you!* >>>> >>>> >>>> > From david.holmes at oracle.com Mon Sep 25 06:48:33 2017 From: david.holmes at oracle.com (David Holmes) Date: Mon, 25 Sep 2017 16:48:33 +1000 Subject: Do I need to have Java 9 installed to run the image generated by jLink? In-Reply-To: References: <59C5BB32.7030209@oracle.com> <59C86843.7060903@oracle.com> <8f7b04f4-8360-e5ce-ce30-b1a4a8930806@oracle.com> Message-ID: On 25/09/2017 1:37 PM, kant kodali wrote: > Is there a anyway to create self contained image independent of platform ? No - the image has to have all the native parts and they are platform specific. There's no provision for "multi-architecture" support. David > On Sun, Sep 24, 2017 at 8:28 PM, David Holmes > wrote: > > On 25/09/2017 12:56 PM, kant kodali wrote: > > If Jlink produces an image that is "portable across machines > across the > same OS type". This would defeat the purpose of JVM right? If I > use jlink > and produce an image on mac I should be able to run on windows > isn't it? > > > A jlink image is created for a specific platform (OS + CPU > combination). It contains executables and native libraries built for > a specific platform. > > David > ----- > > On Sun, Sep 24, 2017 at 7:21 PM, Sundararajan Athijegannathan < > sundararajan.athijegannathan at oracle.com > > wrote: > > Hi, > > Right. The jvm and other shared objects are obviously > platform dependent > and so jlink produced binaries can only be run on specific > target platform. > That said, his question was about whether he still needs to > install Java to > use the produced image. I answered that question. (i.e., the > image is > complete and does not require java to be installed to use). > > Thanks, > -Sundar > > > On 23/09/17, 3:39 PM, Mani Sarkar wrote: > > Hi Sundar, > > Although can we cannot run this app on any OS on the target > machine, but > the specific OS it has been compiled/linked on. > > So its portable across machines across the same OS type. > > I hope my understanding is correct, happy to be corrected. > > Thanks. > > Regards, > Mani > > > > On Sat, 23 Sep 2017 02:35 Sundararajan Athijegannathan < > sundararajan.athijegannathan at oracle.com > > wrote: > > Hi, > > jlink produced image dir is complete - it has jvm, > required platform + > app modules, config. etc. to run your modular app.? You > don't need to > install java separately on the target machine ("machine 2"). > > Thanks, > -Sundar > > On 23/09/17, 1:39 AM, kant kodali wrote: > > Hi All, > > Let's say I create a modularize my app and generate > a image using jLink > > on > > machine1 and from what I understand the image has > the runtime as well > > so if > > I transfer this image to machine 2 which has nothing > installed(not even > Java) can I simply run my app on machine? or does > machine2 also need to > have Java installed? > > Thanks! > > > -- > @theNeomatrix369 >*? |? **Blog > >**? |? *@adoptopenjdk | Dev > communities > *Meet-a-Project - *MutabilityDetector > >*? |? **Bitbucket > >* * |? **Github > >* * |? **LinkedIn > >* > *Come to Devoxx UK 2018:* http://www.devoxx.co.uk/ > > *Don't chase success, rather aim for "Excellence", and > success will come > chasing after you!* > > > From michael.rasmussen at zeroturnaround.com Tue Sep 26 10:45:42 2017 From: michael.rasmussen at zeroturnaround.com (Michael Rasmussen) Date: Tue, 26 Sep 2017 13:45:42 +0300 Subject: Xbootclasspath/a adds CWD to boot class path Message-ID: Hi We have discovered an issue with using -Xbootclasspath/a on Java 9. if you add -Xbootclasspath/a as JVM argument, the current working directory also gets added to boot class path! take the following Test.java class: import java.util.Collections; public class Test { public static void main(String[] args) throws Throwable { System.out.println(Collections.list( ClassLoader.getPlatformClassLoader().getResources("foo.txt"))); } } $ java -fullversion openjdk full version "9+181" $ javac Test.java $ pwd /home/michael/test $ touch foo.txt $ touch /tmp/foo.txt $ java Test [] $ java -Xbootclasspath/a:/tmp Test [file:/home/michael/test/foo.txt, file:/tmp/foo.txt] As the above shows, adding the -Xbootclasspath/a, also added the current working directory to the boot class path. Using a new ClassLoader(null){} instead of the platform class loader gives the same result. A bit of digging shows that "jdk.boot.class.path.append" system property contains a leading path-separator char, like ":/tmp" (";C:/tmp" on Win), meaning in jdk.internal.loader.ClassLoaders., when that string is converted to a classpath, the empty first part gets parsed as cwd. I assume this is not the intended behavior of -Xbootclasspath/a, as the same thing doesn't happen on Java 8, also it's not documented as such. I found some related issues in Jira, such as JDK-8185540, that seems to remedy this, but it's still weird that the JVM adds the empty path element to begin with. Kind regards, Michael Rasmussen From Alan.Bateman at oracle.com Tue Sep 26 11:16:29 2017 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 26 Sep 2017 12:16:29 +0100 Subject: Xbootclasspath/a adds CWD to boot class path In-Reply-To: References: Message-ID: <1fa1fad2-b199-07c2-6d11-c0c358b3c956@oracle.com> On 26/09/2017 11:45, Michael Rasmussen wrote: > Hi > > We have discovered an issue with using -Xbootclasspath/a on Java 9. > if you add -Xbootclasspath/a as JVM argument, the current working directory > also gets added to boot class path! Just for resources, you shouldn't see classes in the working directory defined to the boot loader unless you specify the working directory to -Xbootclasspath/a. In any case, it is fixed in jdk10/master. Historically there has been inconsistencies between class loading and locating resources with the boot loader at corner cases involving empty elements in the boot class path. Those inconsistencies were sorted out early in JDK 9 but we (embarrassingly) regressed later in JDK 9. When it came up in July then it was well below the bar needed to delay the release. As regards the value of the internal jdk.boot.class.path.append property used to communicate the value of -Xbootclasspath/a then I agree this could be cleaned up. However, it should be benign, at least in jdk10/master. -Alan From david.holmes at oracle.com Tue Sep 26 11:01:16 2017 From: david.holmes at oracle.com (David Holmes) Date: Tue, 26 Sep 2017 21:01:16 +1000 Subject: Xbootclasspath/a adds CWD to boot class path In-Reply-To: References: Message-ID: <4d3b4b8a-3e6d-90be-a6da-56b8365597d4@oracle.com> Hi Michael, Moving over to core-libs-dev. The discussion in 8185540 is a bit confusing to me. David On 26/09/2017 8:45 PM, Michael Rasmussen wrote: > Hi > > We have discovered an issue with using -Xbootclasspath/a on Java 9. > if you add -Xbootclasspath/a as JVM argument, the current working directory > also gets added to boot class path! > > take the following Test.java class: > import java.util.Collections; > public class Test { > public static void main(String[] args) throws Throwable { > System.out.println(Collections.list( > ClassLoader.getPlatformClassLoader().getResources("foo.txt"))); > } > } > > $ java -fullversion > openjdk full version "9+181" > $ javac Test.java > $ pwd > /home/michael/test > $ touch foo.txt > $ touch /tmp/foo.txt > $ java Test > [] > $ java -Xbootclasspath/a:/tmp Test > [file:/home/michael/test/foo.txt, file:/tmp/foo.txt] > > As the above shows, adding the -Xbootclasspath/a, also added the current > working directory to the boot class path. Using a new ClassLoader(null){} > instead of the platform class loader gives the same result. > > A bit of digging shows that "jdk.boot.class.path.append" system property > contains a leading path-separator char, like ":/tmp" (";C:/tmp" on Win), > meaning in jdk.internal.loader.ClassLoaders., when that string > is converted to a classpath, the empty first part gets parsed as cwd. > > I assume this is not the intended behavior of -Xbootclasspath/a, as the > same thing doesn't happen on Java 8, also it's not documented as such. > > I found some related issues in Jira, such as JDK-8185540, that seems > to remedy this, but it's still weird that the JVM adds the empty path > element to begin with. > > Kind regards, > Michael Rasmussen >