<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>Stanley Ho&apos;s Blog</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/stanleyh/" />
<modified>2008-05-05T16:37:38Z</modified>
<tagline></tagline>
<id>tag:weblogs.java.net,2008:/blog/stanleyh/243</id>
<generator url="http://www.movabletype.org/" version="3.01D">Movable Type</generator>
<copyright>Copyright (c) 2008, stanleyh</copyright>
<entry>
<title>Updates on Modularity in the Java platform</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/stanleyh/archive/2008/05/updates_on_modu.html" />
<modified>2008-05-05T16:37:38Z</modified>
<issued>2008-05-04T17:55:16Z</issued>
<id>tag:weblogs.java.net,2008:/blog/stanleyh/243.9662</id>
<created>2008-05-04T17:55:16Z</created>
<summary type="text/plain">There have been lots of exciting development and changes going on in the modularity areas recently.</summary>
<author>
<name>stanleyh</name>
<url>http://wiki.java.net/bin/view/People/StanleyHo</url>
<email>Stanley.Ho@Sun.COM</email>
</author>
<dc:subject>Community: Java Specification Requests</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/stanleyh/">
<![CDATA[<p>There have been lots of exciting development and changes going on in the modularity areas recently.</p>

<p><H4>Modularity discussions in JSR 277 and JSR 294 expert groups</H4></p>

<p>In the past, the design work on modularity was split between two expert groups: JSR 294 was responsible for defining the language extension to support modularity in the Java programming language, while JSR 277 was responsible for defining the deployment aspect of the module system. The original rationale was that each expert group would have members with the most appropriate expertise to design what's best in each area for the Java platform. As it turned out, there were situations when experts needed to work at both the language and deployment levels, and a single expert group would have been more effective. To help make the discussions of modularity in Java more effective, <A href="http://www.doc.ic.ac.uk/~abuckley/">Alex Buckley</A> (the spec lead of JSR 294) has joined me to become a co-spec lead in JSR 277. In case you don't know Alex, he is *THE* language guy responsible for <A href="http://java.sun.com/docs/books/jls/">the Java Language Specification</A> and <A href="http://java.sun.com/docs/books/jvms/">the Java VM Specification</A>, and I am very excited about this change. Our plan is to have all Java modularity discussions to occur in the 277 expert group from now on, and we hope this simplification will benefit everyone.</p>

<p><H4>JSR 277 early draft review 2 specification (Coming soon)</H4></p>

<p>Alex and I are currently in the middle of producing the JSR 277 early draft review 2 specification for the expert group to review and discuss. This specification will be quite different from the original JSR 277 early draft in the following ways:</p>

<p>1. New language support based on <A href="http://altair.cs.oswego.edu/pipermail/jsr294-modularity-eg/2008-March/000171.html">Alex's latest proposal</A>. If you haven't been following the language discussion around modularity, the most significant change is that there will be a new module keyword in the Java programming language:</p>

<pre>
   module org.foo.app;
   package org.foo.app;
   module class Main {
      ...
   }
</pre>

<p>Defining a Java module will be as easy as declaring a module name using the new keyword. But ... what if you want to create a deployment module with metadata that could be used in the module system? Well, it will be as simple as defining a Java module with metadata annotations:</p>

<pre>
   //
   // org/foo/app/module-info.java
   //
   @Version("1.0")
   @ImportModules({
           @ImportModule(name="org.foo.library", version="1.0+")
   })
   @MainClass("org.foo.app.Main")
   module org.foo.app;
</pre>

<p>I won't dive into all the details here, but hope the example gives you some idea.</p>

<p>2. Incorporates inputs from EDR feedbacks and EG discussions on existing design and new features.</p>

<p>Since the original early draft was published, we have received many constructive feedbacks and most of them will be addressed in the upcoming specification. In addition, the specification will include details about resource modules (for internationalization), service/service-provider modules, etc. that have been defined by the expert group.</p>

<p>3. Reorganizes the specification to make the separation between the abstract module system framework and concrete module system implementation explicitly clear.</p>

<p>The original early draft actually has two separate parts: a framework for abstract module system, and a concrete module system implementation based on JAM (JAva Module). However, the distinction in that early draft was not clear because the focus of the original early draft was to gather feedbacks on the overall design rather than individual pieces. <A href="http://atsatt.blogspot.com/">Bryan Atsatt</A>, a very valuable contributor in the EG, recently suggested that a clear distinction between the two would help reduce a lot of confusion, and we agreed. This reorganization will happen and it will be one of the most obvious changes in the upcoming specification.</p>

<p>4. Validates the specification with the reference implementation.</p>

<p>We have been building the reference implementation (RI) through the <A href="http://openjdk.java.net/projects/modules/">Modules project</A> in OpenJDK for quite some time now. The current RI has already implemented most of the functionalities as described in the upcoming EDR2, and we hope to bring the Modules project on par with the EDR2 around the same time when the specification is published. Stay tuned for more details.</p>

<p><H4>Support OSGi bundles in the Java Module System</H4></p>

<p><A href="http://weblogs.java.net/blog/mandychung/">Mandy Chung</A> and I have been working on a draft specification for <A href="http://mail.openjdk.java.net/pipermail/jsr277-eg-observer/2008-April/000262.html">supporting OSGi bundles in the Java Module System</A>, and we have just made it available for the expert group to review and discuss. We understand that people who have invested heavily in OSGi would like to preserve their existing investment going forwards, and this is what we hope the support for OSGi bundles will enable. Check out <A href="http://weblogs.java.net/blog/mandychung/">Mandy's blog</A> if you want to learn more.</p>

<p><H4>JavaOne 2008</H4></p>

<p>JavaOne is around the corner again. This year, Alex and I will be presenting a session and a BOF on modularity:</p>

<p>TS-6185: Modularity in Java™ Platform<br />
Wednesday<br />
5/7/2008<br />
10:50 AM -11:50 AM</p>

<p>BOF-5032: Modularity in the Java™ Platform<br />
Wednesday<br />
5/7/2008<br />
8:30 PM -9:20 PM</p>

<p>We'll go over the Java Module System from the language and deployment perspectives in details, and this will be a very technical and interesting talk. If you are attending JavaOne next week, we hope to see you in the session and BOF!</p>

<p>- Stanley</p>

<p><br />
P.S. *random personal note* In the past year, I haven't been blogging much as I was on frequent leaves to deal with some family emergencies. The situation has been improving and I hope to blog more along with Alex and Mandy about all the exciting/interesting stuffs going on in modularity going forwards.</p>]]>

</content>
</entry>
<entry>
<title>OpenJDK Modules project: Early snapshot, video, and more</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/stanleyh/archive/2007/06/openjdk_modules.html" />
<modified>2007-06-29T17:53:35Z</modified>
<issued>2007-06-28T11:36:41Z</issued>
<id>tag:weblogs.java.net,2007:/blog/stanleyh/243.7757</id>
<created>2007-06-28T11:36:41Z</created>
<summary type="text/plain">We have just made an early snapshot of the JSR 277 and JSR 294 implementation available through the Modules project on OpenJDK.</summary>
<author>
<name>stanleyh</name>
<url>http://wiki.java.net/bin/view/People/StanleyHo</url>
<email>Stanley.Ho@Sun.COM</email>
</author>
<dc:subject>Community: Java Specification Requests</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/stanleyh/">
<![CDATA[<p><H4>Early snapshot of JSR 277 and JSR 294 implementation</H4><br />
We have just made an early snapshot of the <A href="http://jcp.org/en/jsr/detail?id=277">JSR 277 (Java Module System)</A> and <A href="http://jcp.org/en/jsr/detail?id=294">JSR 294 (Improved Modularity Support in the Java Programming Language)</A> implementation available through the <A href="http://openjdk.java.net/projects/modules/">Modules project</A> on OpenJDK:</p>

<ul><A href="http://openjdk.java.net/projects/modules/">http://openjdk.java.net/projects/modules/</A></ul>

<p>This snapshot currently covers the core features (see <A href=http://blogs.sun.com/andreas/entry/openjdk_modules_source>Andreas's blog</A>) described in the updated specification in JSR 277, and the reflective APIs defined in JSR 294. If you are wondering how the module system works internally and want to take an early look or even contribute, I encourage you to check out the Modules project. </p>

<p>Besides the snapshot, we have also made other goodies available:</p>

<ul>
  <li>A <A href="http://openjdk.java.net/projects/modules/getting_started.html">Getting started guide</A> that helps you understand the source structure of the project.</li>
  <li>A few <A href="http://openjdk.java.net/projects/modules/samples.html">samples</A> that show you how to create and use simple modules.</li>
  <li>Documentations that describes some of the tools and functionalities available, including</li>
   <ul><li>how to execute modules from repositories through the <A href="http://openjdk.java.net/projects/modules/jdktools.html#launcher">Java launcher</A>.</li>
   <li><A href="http://openjdk.java.net/projects/modules/jdktools.html#jam">jam tool</A> - think of it as the jar tool for the world of modules.</li>
   <li><A href="http://openjdk.java.net/projects/modules/visibility_policy.html">visibility policy</A> - a mechanism that allows you to pick and choose which modules to use in a specific deployment when there could be zillion of modules available from the repositories.</li></ul>
   <li>A <A href="http://openjdk.java.net/projects/modules/getting_started.html#NetBeans">NetBeans project</A> (requires NetBeans 6.0 M9 or later) for easy browsing and editing of the relevant source files from the IDE.</li>
</ul>

<p>Obviously, this is just the beginning. You should expect the snapshot will be updated periodically and new goodies will be posted going forwards, as we evolve the implementation and add many functionalities in the coming months.</p>

<p>If you are interested in discussing the implementation in the Modules project, we have made two discussion lists available for the Java community to join:</p>

<ul>
  <li><A href=http://mail.openjdk.java.net/mailman/listinfo/modules-dev>modules-dev@openjdk.java.net</A>: 
Technical discussion about the implementation of the Modules project</li>
  <li><A href=http://mail.openjdk.java.net/mailman/listinfo/modules-discuss>modules-discuss@openjdk.java.net</A>: 
General discussion of the Modules project and how to use modules</li>
</ul>

<p>If you want to discuss the Modules project with its developers, or how to use JSR 277 and JSR 294, be a subscriber today!</p>

<p><br />
<H4>JSR 277 on Google Video</H4><br />
A few weeks ago, <A href="http://blog.cierniak.org/">Michal Cierniak</A> (Michal has been spending part of his <A href=http://www.google.com/support/jobs/bin/static.py?page=about.html>20% time</A> as a contributing member in the expert group) and I presented the Java Module System (JSR 277) as part of the Advanced Topics in Programming Languages Series at Google. This presentation was based on the current design described in the updated JSR 277 specification, and the video is now available online <A href=http://video.google.com/videoplay?docid=-8224544168880829029>here</A>. You could also google the video directly using "JSR 277" from the <A href=http://video.google.com>Google Video</A> site. If you want to learn more about the current design of JSR 277, this would be a good place to start!</p>

<p><br />
<H4>More on updating the JSR 277 specification ...</H4><br />
Since the early draft was available, I have been discussing the feedbacks we received from the community with the expert group and incorporating their inputs into an updated specification. This updated specification has evolved significantly from the early draft, and this is also what the recent discussions in the EG mailing list based on. To help those of you who are observers of the EG mailing list to follow the discussions more easily, I am going to make the updated specification (and possibly other strawmans as well) publicly available soon. Stay tuned!<br />
</p>]]>

</content>
</entry>
<entry>
<title>OpenJDK and Modules</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/stanleyh/archive/2007/05/openjdk_and_mod.html" />
<modified>2007-05-09T03:17:10Z</modified>
<issued>2007-05-09T03:16:57Z</issued>
<id>tag:weblogs.java.net,2007:/blog/stanleyh/243.7312</id>
<created>2007-05-09T03:16:57Z</created>
<summary type="text/plain">The JSR 277 EG observer mailing list is now available on OpenJDK, and there is also a new project on OpenJDK for the implementation development of JSR 277 and 294.</summary>
<author>
<name>stanleyh</name>
<url>http://wiki.java.net/bin/view/People/StanleyHo</url>
<email>Stanley.Ho@Sun.COM</email>
</author>
<dc:subject>JSR</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/stanleyh/">
<![CDATA[<p>Unless you having been living in a cave, you should have heard that the <A href="http://openjdk.java.net">OpenJDK</A> is finally here today! :-)</p>

<p>I have been planning to make the <A href="http://jcp.org/en/jsr/detail?id=277">JSR 277: Java Module System</A> expert group mailing list publicly readable for quite some time now, but the infrastructure in jcp.org has been pretty unstable in the last two months to make this possible and usable. Now the <A href="http://openjdk.java.net">OpenJDK</A> web site is available and offers better infrastructure, I have made the <A href="http://mail.openjdk.java.net/mailman/listinfo/jsr277-eg-observer">observer mailing list</A> available from there today. This mailing list is read-only, and you will be able to observe the EG traffic going forwards. If you are interested, be a subscriber today!</p>

<p>Another exciting news is that we have also created a <A href="http://openjdk.java.net/projects/modules/">Modules</A> project on <A href="http://openjdk.java.net">OpenJDK</A>. This project will cover the reference implementation of the modularity specifications defined by <A href="http://jcp.org/en/jsr/detail?id=277">JSR 277</A> and <A href="http://jcp.org/en/jsr/detail?id=294">JSR 294</A> as well as the related work in the JDK. Although there aren't much information on this page at the point of this writing, the intention is to make the source code, discussion list, and other implementation-related documentations available soon.</p>

<p>Finally, I'll be presenting a session (TS-2318) on <A href="http://jcp.org/en/jsr/detail?id=277">JSR 277</A> at <A href="http://java.sun.com/javaone/sf/index.jsp">JavaOne</A> this Thursday 4:10pm-5:10pm. <A href="http://blogs.sun.com/abuckley/">Alex</A> and <A href="http://blogs.sun.com/andreas/category/Modularity">Andreas</A> will also be presenting a session (TS-2401) on <A href="http://jcp.org/en/jsr/detail?id=294">JSR 294</A> this Thursday 9:35am-10:35am. If you want to learn more about the latest development of JSR 277 and JSR 294, come to the sessions! I hope to see you all there.<br />
</p>]]>

</content>
</entry>
<entry>
<title>More JSR-277 Early Draft Q &amp; A</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/stanleyh/archive/2006/11/more_jsr277_ear.html" />
<modified>2006-11-03T18:52:52Z</modified>
<issued>2006-11-03T18:51:51Z</issued>
<id>tag:weblogs.java.net,2006:/blog/stanleyh/243.5855</id>
<created>2006-11-03T18:51:51Z</created>
<summary type="text/plain">Since the JSR-277 early draft became available, many comments have been raised by some reviewers. Some of the comments are valid concerns and good suggestions, and these are good inputs that will be discussed in the EG (Expert Group). On the other hand, some other are misconception and misinformation, and that&apos;s what I would like to address in this blog.</summary>
<author>
<name>stanleyh</name>
<url>http://wiki.java.net/bin/view/People/StanleyHo</url>
<email>Stanley.Ho@Sun.COM</email>
</author>
<dc:subject>Community: Java Specification Requests</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/stanleyh/">
<![CDATA[<p>Since the JSR-277 early draft became available, many comments have been raised by some reviewers. Some of the comments are valid concerns and good suggestions, and these are good inputs that will be discussed in the EG (Expert Group). On the other hand, some other are misconception and misinformation, and that's what I would like to address in this blog.</p>]]>
<![CDATA[<p>Before we begin, let me remind everyone that JSR-277 is only in the early draft stage, and it is by no means complete. The design in the early draft is deliberately kept simple, so we can make the spec available to the Java community sooner for feedbacks. Thus, it should be no surprise if you find issues or holes in the early draft (otherwise, it's not really an "early" draft anymore, right?). In any case, if you have any feedback on the early draft, please send them to <A href="mailto:jsr-277-comments@jcp.org">jsr-277-comments@jcp.org</A>. </p>

<p>Now, are you ready? Here we go:</p>

<p><H4>Q: What are the advantages of JSR-277 compared to other existing systems?</H4></p>

<p>Many existing systems (e.g. .NET, OSGi, NetBeans, Maven, Ivy, etc.)  offer reasonable solutions in their problem space, but they are not trying to solve the same problem as JSR-277. Because JSR-277 will become part of the core Java platform, it has several distinct advantages that allows us to solve problems in a different (and we  think more elegant) ways than existing systems, for example, </p>

<p>* It can, in theory at least, define a better solution since it has the ability to mandate deep changes to the underlying architecture of the SE platform, and in particular class loading, which is something that no previous module system could do. <br />
* It can integrate with JSR-294, which will move module definitions from crufty XML files into the Java language itself. Kind of like  replacing Java EE 1.4 deployment descriptors with in-code  annotations in Java EE 5. <br />
* It is extensible. That should make it possible for other systems  to interact with the Java Module System and even make it possible  for them to offer new features made possible by the integration of JSR-277 into the Java platform. We are still working out many of  the details and would appreciate feedback on this topic. </p>

<p>To learn from the experience of existing systems, JSR-277 has a large (20 members) and very diverse EG to accommodate a variety of viewpoints (e.g. a few members are .NET experts, two are OSGi experts who co-authored the R4 modularity spec, one is Maven's creator and one is Maven expert, one is Ivy's creator, etc.).</p>

<p><H4>Q: Does the module system do built-in type consistency checking?</H4></p>

<p>Yes. After each module instance is connected to all of its imports, shallow validation is performed on the module instance. One of the checks shallow validation will go through is to ensure that there is no overlap in the exported types from imported modules. Let's look at an example,</p>

<p>    <I>A import B v1.0, C v1.0<br />
    B import D v1.1<br />
    C import D v1.0</I></p>

<p>Suppose type T is in D. If type T is neither re-exported from B or C, then T is not visible to A at all and there is no type inconsistency. If type T is re-exported only from B or only from C, there is still no type inconsistency. Only when type T is re-exported from both B and C, there is a type consistency issue, but it will be caught by shallow validation automatically and A will not be fully initialized. </p>

<p>It is true that if B returns an object of type T to A via a "cast" to a superclass such as java.lang.Object, and B passes that object to C with tries to cast it to T, then that will fail. However, this is a rare scenario in real applications and we expect that the deep validation would catch this kind of inconsistency.</p>

<p>It is still fair to say that type consistency checking is not explicitly spell out in the early draft, and it probably requires lots of refinements in the next few months. If you have any good suggestion to contribute in this area, I'm sure the EG would appreciate your inputs.</p>

<p><H4>Q: Can modules be loaded or unloaded at runtime? Does it require a JVM restart?</H4></p>

<p>Yes, modules can be loaded or unloaded at runtime.</p>

<p>New modules can be installed into a repository at runtime for the module system to use and load them. Existing modules can also be uninstalled from the repository at runtime so they will not be used when other modules request them subsequently.</p>

<p>When a new repository is created at runtime, modules from the new repository will become available to the module system dynamically. When a repository is shutdown, all modules will be torn down so they can be unloaded eventually. (See Section C.10 in the early draft - how to tear down a module is a future work item for the EG). In fact, we expect module-based Java applets and JNLP applications will be supported by using the URLRepository class, so web-based modules can be loaded and unloaded from a codebase dynamically in a JVM. </p>

<p>In any case, JVM restart is NOT required to load or unload modules.</p>

<p><H4>Q: Mapping a module file (defined in JSR-294) to the module metadata (in JSR-277) seems like a huge constraint. Does it mean that the deployment module is rigidly bound to the development module?</H4></p>

<p>Actually, I consider this degree of integration between JSR-277 and JSR-294 a big advantage. This allow us to move module definitions from crufty XML files into the Java language itself. This is kind of like replacing Java EE 1.4 deployment descriptors with in-code annotations in Java EE 5. Also, by specifying the module information directly in the source file, the compiler can validate the module information to ensure its correctness (How many hours did you spend on debugging manually written metadata?); it'll also be possible for developers to compile a module and generate a JAM file for deployment in a single step - without going through a separate step for writing separate metadata and packaging like what we have been doing for years.</p>

<p><H4>Q: Why didn't the spec use a XML representation format for module metadata?</H4></p>

<p>The format for the module metadata will be defined in JSR-294, and the actual format has not yet been decided by the JSR-294 EG. What is shown in the JSR-277 early draft is just a logical representation of the information in the module metadata file and should not be mistaken for the physical file format. Make no mistake, XML is a reasonable representation format for typical metadata. On the other hand, because the module metadata will be used directly by the JVM to enforce module membership and module-level access control, I won't be surprised if the JSR-294 EG decides to use a more compact representation format.</p>

<p><H4>Q: Does JSR-277 have split package problem?</H4></p>

<p>Split package refers to the issue that classes from the same package can come from different modules through the import. We currently do not plan to support split packages in JSR-277. It will be spelled out more explicitly in the JSR-277 specification in the future.</p>

<p><H4>Q: Isn't specifying the import policy declaratively in the metadata a better choice than expressing the import policy in Java code?</H4></p>

<p>Not necessarily. Designing declarative metadata is typically based on a set of requirements. However, as soon as there are new requirements arise that the existing design can no longer satisfy these requirements, the declarative metadata will need to be extended. Imagine if you want to use a module with metadata v2 in a module system that only recognizes metadata v1, you'll likely run into some problems. Import policy has no such problem because developers can express any logic they want in the code as long as the programming language and the class libraries support it, and the import policy can be executed and supported by all versions of the module system.</p>

<p>It's a valid concern that some import policies may not be written properly thus may cause side effect to the module system. However, it is not much different from encountering problems while executing code in the static initializer or instance initializer today. Even if the import policy results in exception during execution, this is really not an issue as long as the JVM can recover gracefully from it.</p>

<p>It's also a valid concern that expressing the import policy in Java code may be difficult for tools and management systems to analyze module dependencies, and this will be addressed in the next question.</p>

<p><H4>Q: Without declarative metadata, it seems impossible for tools and management systems to analyze module dependencies.</H4></p>

<p>It is not uncommon for the module system to have many repositories at runtime. Contents in the repositories are opaque, and they could be stored in different media (for instance, file system, database, HTTP server); the Repository APIs would effectively hides that from the application/tool. In addition, new repositories could be created and existing repositories could be removed at runtime. Also, it is possible that some implementations of the module system could provide mechanism to override/block/redirect module dependencies based on some deployment policies. Given there are so many potential variations in deployment, if tools and management systems attempts to analyze the module dependencies by accessing the physical metadata from the modules in the repositories, the task would be very complicated. Perhaps asking a different question would help:</p>

<p><I>Does it really make sense for tools and management systems to parse all the module metadata from the repositories and analyze module dependencies on their own, given all the capabilities in accessing the modules from the repositories and in supporting any potential override mechanism are already built into the module system?</I></p>

<p>Obviously, the answer is no. In fact, if the module system can provide APIs to expose dependency information it already has for a specific module, tools and management systems can simply make use of the dependency information provided by the module system. Hence, it is not necessary for module metadata to be declarative in order for tools and management systems to analyze module dependencies. As mentioned in Section C.5 in the early draft, missing dependency prediction is one of the future work items for the EG. </p>

<p><H4>Q: Does the module system support module lifecycle?</H4></p>

<p>The early draft specification does not spell out any lifecycle support in details, but it is on the EG's radar. As mentioned in Section C.6 in the early draft, more explicit lifecycle is one of the future work items. If you have any requirements on this feature, I'm sure the EG would like to hear them.</p>

<p><H4>Q: Does the module system support optional import dependency?</H4></p>

<p>Optional import dependency is currently not supported in the early draft. However, the EG may consider such feature if there are reasonable use cases and sufficient demands. If you have any requirements, I'm sure the EG would appreciate your feedbacks.</p>

<p><H4>Q: Is the built-in repository model too simplistic?</H4></p>

<p>Yes, but for good reasons. One of the strengths of the Java Module System is its extensibility. It makes it possible for 3rd parties to plug in custom repository implementations to address complex or unforeseeable cases when these cases arise. Hence, we can keep the built-in repository model very simple, and it doesn't have to deal with every possible use cases.</p>

<p><H4>Q: The early draft does not specify how the module-aware compiler should compile the module sources.</H4></p>

<p>The language aspect and compilation aspect of a module will be defined in JSR-294, instead of JSR-277. Having said that, we will likely provide more explicit instructions in the future for module-aware compilers to generate versioning constraints properly when compiling JSR-294 module in the context of JSR-277.<br />
</p>]]>
</content>
</entry>
<entry>
<title>JSR-277 Early Draft Specification</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/stanleyh/archive/2006/10/jsr277_early_dr.html" />
<modified>2006-11-17T20:56:51Z</modified>
<issued>2006-10-27T14:00:25Z</issued>
<id>tag:weblogs.java.net,2006:/blog/stanleyh/243.5806</id>
<created>2006-10-27T14:00:25Z</created>
<summary type="text/plain">The JSR-277 early draft specification has recently been published - this is what I&apos;ve been spending significant amount of time during the past year, and I&apos;m very glad that it is finally available to the Java community for review.</summary>
<author>
<name>stanleyh</name>
<url>http://wiki.java.net/bin/view/People/StanleyHo</url>
<email>Stanley.Ho@Sun.COM</email>
</author>
<dc:subject>Community: Java Specification Requests</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/stanleyh/">
<![CDATA[<p>The <A href="http://jcp.org/en/jsr/detail?id=277">JSR-277 early draft specification</A> has recently been published - this is what I've been spending significant amount of time during the past year, and I'm very glad that it is finally available to the Java community for review.</p>

<h4>What is JSR-277?</h4>

<p>JSR-277 (Java Module System) is an architecture for the development and deployment of module-based applications and libraries. Applications and libraries written as Java modules are easier to develop and deploy, with first-class modularity, packaging, and deployment support in the Java SE platform. </p>]]>
<![CDATA[<p>This architecture defines the following components:<ul><li>A distribution format (i.e., a Java module) and its metadata as a unit of delivery for packaging collections of Java classes and related resources. The metadata contains information about the module, classes and resources within the module, and its dependencies upon other modules. The metadata also includes list of exports to restrict classes and resources from being exposed outside the module unintentionally.</li><br />
<li>A versioning scheme that defines how a module declares its own version as well its versioned dependencies upon other modules.</li><br />
<li>A repository for storing, discovering, and retrieving modules with versioning and isolation support.</li><br />
<li>Runtime support in the application launcher and the class loaders for discovering, loading, and integrity checking of modules.</li></ul></p>

<p>JSR-277 is currently targeted for Java SE 7.</p>

<h4>What were the motivations behind this JSR?</h4>

<p>Java Archives (JARs) are widely used as both the distribution format and the execution format for Java applications. The JAR file format dates back to the mid-1990s, and it has not scaled particularly well in either of these roles. JAR files are hard to distribute, hard to version, and hard to reference in general.</p>

<p>Distributing a simple Java application is considered to be a complicated task by many developers because it often involves creating a native installer to package multiple JAR files into a distribution unit, and it sometimes involves converting the application into a Java applet or JNLP (Java Network Launching Protocol) application for web-based deployment.</p>

<p>The versioning support in the JAR file format is for expressing dependencies on Java extensions (a.k.a optional packages), but not the version of the JAR file itself. There is also no reliable mechanism for expressing, resolving, and enforcing the dependency of one JAR file upon another. Referencing a JAR file, moreover, involves specifying it in the classpath. Since the path of a JAR file may change during deployment, developers are forced to fix up all the references to the deployed JAR files as part of the deployment process.</p>

<p>Developers also find it quite difficult to deploy installed Java extensions because they can easily run into issues like versioning conflict and namespace collision. It is also basically impossible to arrange for multiple versions of installed extension to be shared across multiple JRE installations.</p>

<p>These issues have been collectively known as the Classpath Hell, the JAR Hell, and the Extension Hell for years. The overall goal of the JSR-277 is to define first-class modularity, packaging, and deployment support in the SE platform that are capable to address these issues once and for all.</p>

<h4>What makes JSR-277 so different compared to existing systems?</h4>

<p>This is definitely one of the most frequently asked questions. The complete answer would never fit into a blog, but there are several points I want to highlight:</p>

<ul><li><B>JSR-277 is generally less complex.</B>

<p>We deliberately made the design simpler by following this principle - make simple things simple, and make complex things possible. Because JSR-277 is targeted for Java SE 7, we have flexibility to update the JVM and classes libraries in the SE platform to better support JSR-277, thus reducing the overall design complexities. Also, the JSR-277 architecture is very extensible - 3rd parties may plug custom implementations to address complex or unforeseeable cases when these cases arise, so the core architecture can be kept simple.</p>

<p>Note: It is also fair to say that the module system described in the early draft is relatively simple because the early draft is by no means complete.</li></p>

<p><li><B>JSR-277 has powerful repository.</B></p>

<p>Repository is a mechanism for discovering, storing, and retrieving modules, and multiple versions of modules can be deployed side-by-side in a repository. Typically, the module system has one or more repositories at runtime, and the repository architecture is very extensible. Let's look at some implications:</p>

<ul><li>Multiple repositories could be used to achieve different degree of module sharing in the corporate environment - an per-user repository may be provided to share modules across all JREs but specifically for the current user, and a global repository may be provided by the system administrators to share modules across all JREs for all users within the corporate environment.</li>
<li>URL repository could be used to expose modules from a specific codebase on the server. Module could be downloaded and deployed on demand when the module is needed at runtime.</li>
<li>Custom repository implementations could be easily plugged into the module system. The storage model in the repository is abstract, so it is possible to implement the repository using different media, for instance, file system, database, etc. It is also possible to implement the repository using existing repository systems as back-ends, e.g. Ivy and Maven.</li>
<li>Module must be deployed into a repository before the module system can discover and make use of it. This deployment step offers repository implementation an opportunity to transform a module into a more efficient format for run time access. For instance,
<ul><li>Index can be built for all classes and resources in a module to optimize classloading at runtime.</li>
<li>Native code can be generated for the frequently used classes in a module to optimize runtime performance.</li>
<li>Byte code in a module can be verified at deployment time, thus eliminating the impact of byte code verification in a module at runtime.</li>
<li>Digital signature in a module can be verified and the certificates in the digital signature can be extracted at deployment time, thus eliminating the impact of digital signature verification in a module at runtime.</li></ul>
</li></ul></li>

<p><li><B>JSR-277 has powerful reflective APIs.</B></p>

<p>Key abstractions in JSR-277, e.g. module definition, module instance, repository, etc., are all reified through the reflective APIs. This enables the module system to expose functionalities to everyone in a very consistent manner. Suppose the Java launcher needs to access the classloader object of a specific version of a module from the repository and an application needs to access the same thing - the Java launcher and the application simply invoke the reflective APIs to get what they want from the module system.</li></p>

<p><li><B>VM support for module-level access control (through JSR-277 integration with JSR-294)</B></p>

<p>Each module defines exports that defines what classes and resources that are visible to other modules. At runtime, module-level access control is enforced at the VM level, thus keeping the Java platform secure by disallowing other modules to access module-private/non-exported classes in another module.</li></p>

<p><li><B>Development and deployment integration (through JSR-277 integration with JSR-294)</B></p>

<p>In typical module development, developers would start from writing a development module (defined in JSR-294), then compile and package the artifacts into a deployment module (defined in JSR-277). Basically, the development module is the source form of the metadata in the deployment module, and there are several implications:</p>

<ul><li>The metadata in the deployment module is generated by compiling the development module. If there are errors in the development module, they would be caught by the compiler. Therefore, it significantly reduces the likelihood of malformed metadata in the deployment module.</li>
<li>Whenever there are code changes in Java classes that belongs to the development module, recompiling these classes would force the recompilation of the corresponding development module. In other words, the metadata of the deployment module is always kept up-to-dated automatically whenever the code that belongs to the development module is recompiled, thus freeing the developers from doing manual bookkeeping on the metadata.</li>
<li>This also simplifies development and the build process (also IDEs) because everything is in the Java source files.</li></ul>

<p>In addition, exports in the deployment module are declared in the development module. If a class in a module attempts to access module-private/non-exported classes in another module, the error would be caught early on by the compiler during development rather than causing failure at runtime.</li></p>

<p><li><B>Extensibility</B></p>

<p>A trademark of many Java platform APIs is extensibility and allows 3rd parties to deliver innovations that plug into the JRE. For example, ClassLoaders, service providers, etc. JSR-277 is not only a module system by itself, but it is also an architecture that is extensible by other module systems (e.g. OSGi, NetBeans, etc.). Although the details still need to be worked out, the goal is to allow some degrees of interoperability between JSR-277 and other module systems. By providing custom module and repository implementations, other module systems may expose their modules through the repository for other JSR-277 modules to import. Similarly, through the powerful JSR-277 reflective APIs, other module systems may also allow their modules to import JSR-277 modules. A more extreme case would be for two or more other module systems to expose their modules as JSR-277 modules through the repository, and the framework in JSR-277 would enable modules from these module systems to interoperate with each others.</li></p>

<p><li><B>JSR-277 has integrated JSR-200 (Pack200) support for its distribution format</B></p>

<p>JSR-277 defines a distribution format for module called JAM (JAva Module), and it is based on the JAR file format. JSR-200 (Pack200) defines a hyper-compression scheme for the JAR file format. Hence, developers may use Pack200 to further compress modules for distribution. The module system supports packed module archives directly; a packed module archive is automatically unpacked if it is provided to the module system. Thus, JSR-277 module is typically packed for distribution, and its small physical size makes it very convenience to distribute, especially for download.</li></ul></p>

<h4>What should you do?</h4>

<p>I hope you now have more ideas of what JSR-277 is about, and I encourage you to learn more by reading the <a href="http://jcp.org/en/jsr/detail?id=277">early draft specification</a>. The EG definitely would like to gather constructive feedback on the directions and the open issues indicated in the early draft. If you have comments, please send them to <a href="mailto:jsr-277-comments@jcp.org">jsr-277-comments@jcp.org</a>.</p>

<p><B>For those who have problems seeing the comments, this is a problem with the blogging software. Please visit both <A href="http://weblogs.java.net/blog/stanleyh/archive/2006/10/jsr277_early_dr.html">http://weblogs.java.net/blog/stanleyh/archive/2006/10/jsr277_early_dr.html</A><br />
<A href="http://weblogs.java.net/blog/stanleyh/archive/2006/10/jsr277_early_dr_1.html">http://weblogs.java.net/blog/stanleyh/archive/2006/10/jsr277_early_dr_1.html</A></B></p>]]>
</content>
</entry>
<entry>
<title>New security dialogs coming to a Tiger update near you.</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/stanleyh/archive/2005/10/new_security_di_1.html" />
<modified>2008-01-02T17:42:16Z</modified>
<issued>2005-10-14T11:42:55Z</issued>
<id>tag:weblogs.java.net,2005:/blog/stanleyh/243.3416</id>
<created>2005-10-14T11:42:55Z</created>
<summary type="text/plain">The upcoming J2SE 5.0u6 will contain the new security dialogs for Java Web Start and Java Plug-in.</summary>
<author>
<name>stanleyh</name>
<url>http://wiki.java.net/bin/view/People/StanleyHo</url>
<email>Stanley.Ho@Sun.COM</email>
</author>
<dc:subject>Deployment</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/stanleyh/">
<![CDATA[<p>A few months ago, I blogged about how we plan to revamp the user experience in Java Web Start and Java Plug-in in Mustang. After considering all the inputs from the Java community, we have decided to make the new security dialogs available in the upcoming J2SE 5.0u6. Here are some screenshots from 5.0u6:</p>]]>
<![CDATA[<p><I>Signed application with valid certificate:</I></p>

<p><img alt="tiger_security_warning_signed.png" src="http://weblogs.java.net/blog/stanleyh/archive/5.0u6_security_dialogs/tiger_security_warning_signed.png" width="516" height="327" /></p>

<p><br />
<I>More information on the valid certificate:</I></p>

<p><img alt="tiger_more_information.png" src="http://weblogs.java.net/blog/stanleyh/archive/5.0u6_security_dialogs/tiger_more_information.png" width="388" height="320" /></p>

<p><br />
Hopefully, it will significantly improve the deployment user experience of your applications very soon.</p>

<p>- Stanley</p>

<p><br />
<I>P.S. Thanks Andy Herrick in the Java Deployment team for backporting this feature; the codebases between Mustang and Tiger are quite different, so this backport is actually more difficult than it seems.</I><br />
</p>]]>
</content>
</entry>
<entry>
<title>JSR 277: Java Module System</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/stanleyh/archive/2005/06/jsr_277_java_mo_1.html" />
<modified>2006-06-09T00:45:50Z</modified>
<issued>2005-06-14T20:03:35Z</issued>
<id>tag:weblogs.java.net,2005:/blog/stanleyh/243.2559</id>
<created>2005-06-14T20:03:35Z</created>
<summary type="text/plain">Sun has recently submitted the Java Module System JSR to revise the Java packaging architecture, and I am very exciting to announce that the JCP has begun voting on this JSR!</summary>
<author>
<name>stanleyh</name>
<url>http://wiki.java.net/bin/view/People/StanleyHo</url>
<email>Stanley.Ho@Sun.COM</email>
</author>
<dc:subject>Community: JDK</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/stanleyh/">
<![CDATA[<p>Sun has recently submitted the Java Module System JSR to revise the Java packaging architecture. This is an area that has been long overdue for an overhaul, and the goal is to make it easier to bundle, distribute, and deploy Java applications and Java extensions (aka optional packages).</p>]]>
<![CDATA[<p>I am very exciting to announce that the JCP has begun voting on this JSR! </p>

<p>For more details, please check out <A href=http://www.jcp.org/en/jsr/detail?id=277>JSR 277: Java Module System</A>.</p>

<p>- Stanley</p>]]>
</content>
</entry>
<entry>
<title>Security and networking enhancements in Java Deployment</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/stanleyh/archive/2005/06/security_and_ne_1.html" />
<modified>2006-06-09T00:45:50Z</modified>
<issued>2005-06-13T22:02:07Z</issued>
<id>tag:weblogs.java.net,2005:/blog/stanleyh/243.2566</id>
<created>2005-06-13T22:02:07Z</created>
<summary type="text/plain">Find out what security and networking enhancements are coming in Java Web Start and Java Plug-in in Mustang (JavaSE 6)!
</summary>
<author>
<name>stanleyh</name>
<url>http://wiki.java.net/bin/view/People/StanleyHo</url>
<email>Stanley.Ho@Sun.COM</email>
</author>
<dc:subject>Community: JavaDesktop</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/stanleyh/">
<![CDATA[<p>In Mustang (JavaSE 6), there are many security and networking enhancements in Java Web Start and Java Plug-in that make your deployment more secure and simple. Let's have a quick look!</p>]]>
<![CDATA[<p><H3>New security warning dialog box and more information dialog box</H3>They are the most visible security related changes in Java Web Start and Java Plug-in. Check out <A href="http://weblogs.java.net/blog/stanleyh/archive/2005/04/deployment_good_1.html">Goodbye scary security dialog box!</A> and <A href="http://weblogs.java.net/blog/stanleyh/archive/2005/06/deployment_new_1.html">New user experience in Java Web Start</A> for more details. </p>

<p><H3>Certificate validation enhancements</H3>To enhance the security in our certificate validation algorithm, Java Web Start and Java Plug-in will use the <A href="http://java.sun.com/j2se/1.5.0/docs/guide/security/certpath/CertPathProgGuide.html">Java Certificate Path APIs</A> that is compliance with <A href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280</A>. </p>

<p>Java Web Start and Java Plug-in will also support <A href="http://www.ietf.org/rfc/rfc3280.txt">certificate revocation list (CRL)</A>. Basically, CRL is a list of certificates that have been revoked by the Certificate Authority. If a certificate contains a CRLDistributionPoints extension, Java Web Start and Java Plug-in will download the CRL from the URI specified in the CRLDistributionPoints extension for certificate validation. There will be a new deployment configuration option to let companies setup their own company-wide CRL to control the certificate validation policy. In addition, Java Web Start and Java Plug-in will support <A href="http://www.ietf.org/rfc/rfc2560.txt">online certificate status protocol (OCSP)</A> if the certificate provides an OCSP server URL in its AIA extension. There will also be a deployment configuration option to let companies to use their OCSP servers to control the certificate validation policy in the Intranet. Both CRL and OCSP support could be enabled/disabled independently from the Java Control Panel.</p>

<p>These improvements should be transparent to most developers and most users. However, if your certificate is not compliant with the RFC standards, especially in the case of self-generated certificate or certificate generated by internal PKI, your signed applications may break. Therefore, it is important to test your applications with the Mustang snapshot, so you could identify any potential certificate problem early.</p>

<p><H3>Save password option in login dialog box</H3> Java Web Start and Java Plug-in will give you an option to save username and password in the login dialog during authentication; if you try to access the same server at a later time in the same session, and previously selected to save your password, your credentials will be forwarded automatically without any additional user interaction.  If you did not select to save your password the login dialog will be pre-filled with the saved username and domain name and the user only has to enter their password. On Windows, Java Web Start and Java Plug-in also recognize the saved username and password in Internet Explorer. For example, if you login into a web site in Internet Explorer and encounter a Java applet that requires authentication, Java Plug-in will automatically recognize your saved username and password in Internet Explorer and use it for authentication in the Java side, so you won't be prompted for login again.</p>

<p><I>Screenshot of login dialog box with save password option during Integrated Windows authentication on Windows 2000:</I></p>

<p><img alt="save-password.jpg" src="http://weblogs.java.net/blog/stanleyh/archive/mustang-security-networking/save-password.jpg" width="343" height="324" /></p>

<p><H3>Password protected keystore</H3>Some users may protect their keystores with password. Java Web Start, Java Plug-in, and Java Control Panel will fully recognize password-protected keystore if any of the deployment keystore (i.e. root CA certificate store, SSL CA certificate store, trusted signing certificate store, trusted SSL certificate store, and client authentication certificate store) is protected.</p>

<p><I>Screenshot of keystore password dialog box on Windows XP:</I></p>

<p><img alt="password.jpg" src="http://weblogs.java.net/blog/stanleyh/archive/mustang-security-networking/password.jpg" width="345" height="220" /></p>

<p><H3>Elimination of HTTPS security warning for valid certificate</H3>If the HTTPS server certificate is valid and is verified, Java Web Start and Java Plug-in will no longer show a HTTPS security warning dialog. In majority of the secure server deployments, using a valid server certificate should be the norm, so this change will improve the deployment user experience if your application uses HTTPS. This feature could be enabled/disabled from the Java Control Panel.</p>

<p><H3>Automatic certificate selection in client authentication</H3>User often has only one client certificate on the system for the purpose of client authentication. To simplify the user experience for client authenticaiton, if there is only one client certificate on the system that matches the requirements in HTTPS client authentication, Java Web Start and Java Plug-in will send the client certificate to the server automatically without prompting the user to select the certificate. This feature could be enabled/disabled from the Java Control Panel.</p>

<p><H3>Automatic proxy detection</H3>Internet Explorer and Mozilla Firefox provide an option that enables web clients to automatically detect proxy settings without user intervention through <A href="http://www.web-cache.com/Writings/Internet-Drafts/draft-ietf-wrec-wpad-01.txt">WPAD (Web Proxy Auto-Discovery Protocol)</A>. Java Web Start and Java Plug-in will support this proxy option on all platforms if they are configured to use browser settings and the browser is configured to use WPAD for proxy discovery.</p>

<p><H3>Summary</H3>These security and networking enhancements in Java Web Start and Java Plug-in should improve your overall deployment experience in Mustang. Most of the enhancements are already integrated into Mustang, except "Save password option in login dialog" and "Elimination of HTTPS security warning for valid certificate". The remaining enhancements will be available in a Mustang snapshot in a few weeks. If you are interested in these enhancements, I encourage you to download the <A href="http://www.java.net/download/jdk6/binaries/">Mustang snapshot</A> today to try them out!</p>

<p>- Stanley</p>

<p><br />
<I>Note: Thanks Dennis Gu and Ashley Woodsom in the Java Deployment team for making these enhancements happen. Dennis is main contributor for the "Certificate validation enhancements", "Password protected keystore", and "Automatic certificate selection in client authentication" support; Ashley is the main contributor for the "Automatic proxy detection" and the upcoming "Save password option in login dialog box" support.</I></p>]]>
</content>
</entry>
<entry>
<title>New user experience in Java Web Start</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/stanleyh/archive/2005/06/deployment_new_1.html" />
<modified>2006-06-09T00:45:50Z</modified>
<issued>2005-06-07T10:06:25Z</issued>
<id>tag:weblogs.java.net,2005:/blog/stanleyh/243.2434</id>
<created>2005-06-07T10:06:25Z</created>
<summary type="text/plain">The promoted Mustang build 39 contains the initial putback of the new user experience in Java Web Start, and you can download and try it out today! </summary>
<author>
<name>stanleyh</name>
<url>http://wiki.java.net/bin/view/People/StanleyHo</url>
<email>Stanley.Ho@Sun.COM</email>
</author>
<dc:subject>Community: JavaDesktop</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/stanleyh/">
<![CDATA[<p>As I mentioned in <A href="http://weblogs.java.net/blog/stanleyh/archive/2005/04/deployment_good_1.html">my earlier blog</A>, we have decided to revamp the user experience in Java Web Start in Mustang, and the <A href="http://weblogs.java.net/blog/stanleyh/archive/2005/04/deployment_good_1.html">scary security dialog</A> was the first to go. Here is more exciting news! I am very glad to announce that Andy Herrick and Margarita Fisher have completed the initial implementation of the new user experience for Java Web Start, and it is available in the promoted <A href="http://www.java.net/download/jdk6/binaries/">Mustang snapshot</A> (build 39). You can download and try it out today.</p>

<p><br />
</p>]]>
<![CDATA[<p><H3>What's new in user experience?</H3></p>

<p><br />
<H3>Splash Screen</H3>The default splash screen has been updated, and it looks pretty nice! Also, Java Web Start will no longer generate a splash screen for your application automatically if the application does not provide a custom splash, because the generated splash never looks great from users' prespective. In other words, in Mustang, your users will either see the new default splash screen, or a custom splash screen if the application specifies one, when the application is launched. If you are serious in perfecting the user experience, we strongly recommend you to provide a good custom splash screen for your JNLP application.</p>

<p><br />
<H3>Download Window</H3>The download window has been completely changed to look more friendly. I am also very glad to say that the blinking progress bar is finally gone!</p>

<p><br />
<H3>Desktop Integration Dialog Box</H3>If your application is signed, the desktop integration information will be integrated as part of the security warning dialog box, so your users will be informed by only a single dialog box for security and desktop integration. If your application is unsigned, your users will see a single dialog box about desktop integration, no matter how many file extensions or MIME type associations the application has requested.</p>

<p><br />
<H3>More Information Dialog Box</H3>After I blogged about the <A href="http://weblogs.java.net/blog/stanleyh/archive/2005/04/deployment_good_1.html">new security warning dialog box</A>, many people commented that the UI does not reveal sufficient security related information to the users. The puzzle is now solved! Clicking on the "More Information" link in the new security warning dialog box will now reveal an additional dialog box which contains more detailed information, so the users would be better informed.</p>

<p><br />
<H3>Java Cache Viewer</H3>As part of the Unified Download Engine work in Mustang, a new cache viewer has been added for the download cache shared between Java Web Start and Java Plug-in, and you could launch the viewer directly from the Java Control Panel. Does anyone miss the JNLP Application Viewer in Tiger or the JNLP Application Manager in earlier versions of Java Web Start? I certainly don't, especially after I have used the new viewer!</p>

<p><br />
<H3>There are other exciting features and improvements in the pipeline.</H3>We will continue to make a series of UE/UI changes in Java Web Start before Mustang goes beta, including graphics and layouts, so what you see at this point is just a snapshot of what we have been cooking, but it should give you some ideas about the direction we are headed. Certainly, your feedback will help us a great deal before these changes are finalized. </p>

<p>- What do you think about the new user experience?<br />
- What other improvement do you like to see?</p>

<p>So, what are you still waiting for? <B><A href="http://www.java.net/download/jdk6/binaries/">Download Mustang </A>today and experience these improvements! Most importantly, tell us what you think.</B></p>

<p>- Stanley</p>

<p><br />
<I>P.S. Thanks Andy and Rita in the Java Deployment team for doing a nice job on the implementation! Special thanks go to Chris Le Dantec, Coleen Baik, and Mike Albers in the xDesign team.</I><br />
</p>]]>
</content>
</entry>
<entry>
<title>Java Deployment in J2SE 5.0</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/stanleyh/archive/2005/06/java_deployment.html" />
<modified>2006-06-09T00:45:50Z</modified>
<issued>2005-06-06T02:17:43Z</issued>
<id>tag:weblogs.java.net,2005:/blog/stanleyh/243.2518</id>
<created>2005-06-06T02:17:43Z</created>
<summary type="text/plain">There are many new deployment features and enhancements in J2SE 5.0. Let&apos;s have a quick look!</summary>
<author>
<name>stanleyh</name>
<url>http://wiki.java.net/bin/view/People/StanleyHo</url>
<email>Stanley.Ho@Sun.COM</email>
</author>
<dc:subject>Community: JavaDesktop</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/stanleyh/">
<![CDATA[<p>Java Deployment is a term that collectively represents the set of deployment technologies available in J2SE, including Java Web Start for JNLP application deployment, Java Plug-in for Java applet deployment, JDK/JRE installer, Java Update, and many others. Let's have a quick look to see what new features and enhancements are available in Java Deployment in J2SE 5.0 (aka Tiger) for your next deployment.</p>

<p><br />
</p>]]>
<![CDATA[<p><H3>What's New?</H3></p>

<p><B>The common theme</B> across all the new features and enhancements in various deployment technologies in Tiger is <B>Ease-of-Deployment</B>. Specifically, the primary motivation behind adding many new deployment features and enhancements is to simplify your life as a deployer.</p>

<p>For Java Web Start and Java Plug-in, developers told us that they wanted a more consistent deployment model between these products. Moreover, we received many feature requirements for enterprise deployment support, better networking support, security enhancements, desktop integration improvements, etc. Obviously, we must have a robust and extensible architecture if we are to continue evolving these deployment technologies, but we already reached saturated points in various subsystems that made feature extension difficult. Thus, we decided to rearchitecture Java Web Start and Java Plug-in in J2SE 5.0 to ensure there is a good foundation to evolve our deployment platforms going forwards. After the rearchitecture, ~70% of Java Web Start and Java Plug-in are supported by a common set of subsystems, including configuration, security, networking, download, etc. It does not only make many of the existing features behave more consistently across deployment platforms, but it also allows us to add features and enhancements in a rapid rate that has not been seen before.</p>

<p>Why does it matter to you? As a developer and a deployer, these changes will enable you to develop and deploy Java applets and JNLP applications more easily and avoid many deployment surprises. Let's take a more detailed look at some of the new deployment features and enhancements introduced in J2SE 5.0.</p>

<p><br />
<H3>Configuration (for Java Web Start and Java Plug-in)</H3></p>

<p>To make configuration customization easier, Java Web Start and Java Plug-in now share a <B>configuration infrastructure</B>. Users only need to customize their settings once, and the affected configuration would be applied to both products. We also provide a <B>Java Control Panel</B> to help users easily customize their configuration.</p>

<p>Moreover, to enable flexible configuration customization, Java Web Start and Java Plug-in expose <A href="http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/properties.html">a variety of configuration options</A>, e.g. proxy settings, certificate stores, security policies, etc. These options allow users and administrators to have more controls over their deployments. </p>

<p>Futhermore, to make configuration deployment more manageable, Java Web Start and Java Plug-in support <B>enterprise configuration and lock-down</B>. The feature is very useful in enterprise deployment, because it enables administrators to provide default values of selected set of configuration settings for users in the enterprise, and it also allows administrators to lock-down selected set of configuration settings altogether to prevent users from customization.</p>

<p><br />
<H3>Security Enhancements (for Java Web Start and Java Plug-in)</H3></p>

<p>To allow web servers to determine the identification of the client, <B>HTTPS client authentication</B> is now fully supported by Java Web Start and Java Plug-in. If your applications connect to a server that requires client authentication, your users will be prompted to select a client certificate available on the system.</p>

<p>Many companies used the browser keystore as a way to distribute certificates and keys to be used by their internal applications. To make distribution of certificates and keys easier for Java applications, Java Web Start and Java Plug-in now support <A href="http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/keystores.html">browser keystore</A> in Internet Explorer and Mozilla. Certificates and keys in the browser keystore are used for signature signing verification, HTTPS server authentication, and HTTPS client authentication. If the certificates and keys are on the <B>smartcards</B>, they are also recognized by Java Web Start and Java Plug-in if they are exposed in the browser keystore.  </p>

<p>To avoid deployment surprise due to expired certificate, Java Web Start and Java Plug-in now support <A href=http://java.sun.com/j2se/1.5.0/docs/guide/security/time-of-signing-beta1.html">signature timestamp</A>. Consider the following situation: an application is signed without signature timestamp and is rolled out for mass deployment, and the certificate is expired afterwards. In this case, this application would be considered to be signed by an expired certificate, and your users may be present with security dialog that indicates the certificate has expired when your users try to run the application. On the other hand, with signature timestamp support, developers may generate a timestamp along with the signature when the applet or application is signed. Java Web Start and Java Plug-in will consider that the application is properly signed if it has a valid signature timestamp even though the certificate has expired at time-of-deployment.</p>

<p><br />
<H3>Download Reduction (for Java Web Start and Java Plug-in)</H3></p>

<p>Pack200 is a hyper-compression technology defined in <A href="http://www.jcp.org/en/jsr/detail?id=200">JSR 200</A>, and it achieves approximately 1-to-9 compression ratio for JAR. To minimize application download size, Java Web Start and Java Plug-in support <A href="http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/pack200.html">HTTP compression and Pack200 compression for JAR download</A>. If a server returns gzip-compressed or Pack200-compressed JAR during JAR download, Java Web Start and Java Plug-in will uncompress these files automatically.</p>

<p><br />
<H3>Networking Improvements (for Java Web Start)</H3></p>

<p>Java Web Start now supports <B>SOCKSv4 and SOCKSv5</B>, in additional to support for HTTP, HTTPS and FTP. Moreover, Java Web Start also fully support <B>automatic proxy script on Windows.</B> </p>

<p>To allow JNLP applications to take advantages of session management, Java Web Start now provides build-in <B>cookie support</B> in HTTP and HTTPS connections.</p>

<p><br />
<H3>JNLP 1.5 and Desktop Integration (for Java Web Start)</H3></p>

<p>We have added many enhancements in the <A href="http://www.jcp.org/en/jsr/detail?id=56"/><B>JNLP 1.5 specification</B></A> implemented by Java Web Start in J2SE 5.0. First, the version-id syntax has been extended, so developers have <B>more flexibility in specifying version-range</B>. Moreover, the "java-vm-args" has been added to <B>support various "safe" VM options</B> for your JNLP deployment. </p>

<p>To improve desktop integration support, developers now have more controls over how their JNLP applications are integrated through <B>shortcuts creation, file extensions and MIME association, and related content integration in the start menu</B>. On Windows, Java Web Start also automatically integrates downloaded JNLP applications with the <B>"Add/Remove Programs"</B> in the Windows Control Panel, so users may uninstall any JNLP application directly from the Windows Control Panel.</p>

<p>To allow JNLP application to run as a singleton, a new <I>javax.jnlp.SingleInstanceService</I> was introduced into the JNLP APIs. In addition, there are various minor API enhancements as well. </p>

<p>To allow JNLP application to be deployed from a different source, Java Web Start now contains an <B>import facility</B>. This can be used for CD installs, where code is initially loaded from one location and then updated from another. It can also be used to pre-install applications and libraries in either the user or system cache without running the applications. </p>

<p><br />
<H3>User Experience (for Java Web Start)</H3></p>

<p>The major change was the elimination of Java Web Start Application Manager. Having a separate application to manage downloaded JNLP applications is important, but we believe that the most natural way to launch JNLP applications is through either the desktop shortcut or JNLP link in the browsers. The majority of the functionality of the Application Manager is now contained in the Java Control Panel.</p>

<p>We have also beefed up the <B>debugging support in Java Console</B> in Java Web Start similar to the one already available in Java Plug-in, so developers may debug their applications more easily.</p>

<p><br />
<H3>User Experience (for Java Plug-in)</H3></p>

<p>We have added a new <B>animation to provide better feedback</B> to end users when the applet is loaded. If you run applets using Java Plug-in in Internet Explorer, Mozilla, or Firefox, you will see a new animation appear in the applet whitebox area during applet loading. </p>

<p>We have also made many improvements in JavaScript/Java communication by tightening up the security model, and by speeding up the performance up to 4 times in some cases. These improvements should improve the responsiveness of your applets in the browser.</p>

<p><br />
<H3>Improvements in JRE/JDK Installer and Java Update</H3></p>

<p>The main improvements are <B>better proxy support on Windows 2003 as well as authenticated proxy support</B> for all Windows platforms. Also, we have further <B>reduced the minimal download size of the JRE 5.0 online installer</B> compared to 1.4.2, despite there are many new 5.0 feature.</p>

<p><br />
<H3>Conclusion</H3></p>

<p>As you could see, the list of improvements in deployment in J2SE 5.0 is very long, and there are still many features and enhancements I did not cover in this blog. Nonetheless, I hope I have given you a high level overview of the new deployment features and enhancements available in J2SE 5.0, so you may <B>leverage these new features and enhancements in your next deployment</B>.</p>

<p>o Which are the new deployment features in J2SE 5.0 you like?<br />
o Which are the new deployment features in J2SE 5.0 you plan to use in your next deployment?<br />
o How will these new deployment features improve your life as a deployer?</p>

<p>Let me know.</p>

<p>- Stanley</p>

<p><br />
<I>Note: Some of you may also be interested to know about what's coming in Mustang, and I will talk about "Java Deployment in J2SE 6.0" in an upcoming blog. Stay tuned.</I><br />
</p>]]>
</content>
</entry>
<entry>
<title>Deployment: Understand JRE download size</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/stanleyh/archive/2005/05/deployment_unde_1.html" />
<modified>2006-06-09T00:45:50Z</modified>
<issued>2005-05-06T09:56:37Z</issued>
<id>tag:weblogs.java.net,2005:/blog/stanleyh/243.2400</id>
<created>2005-05-06T09:56:37Z</created>
<summary type="text/plain">Do you fully understand the JRE download size issue?</summary>
<author>
<name>stanleyh</name>
<url>http://wiki.java.net/bin/view/People/StanleyHo</url>
<email>Stanley.Ho@Sun.COM</email>
</author>
<dc:subject>Community: JavaDesktop</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/stanleyh/">
<![CDATA[<p>I talked to many developers recently about the Windows JRE download size issue. The conversation often went like this:</p>

<p><I>Stanley: What do you see as the major obstacle of your deployment?<br />
Developer: JRE download size is definitely a problem, especially on Windows.<br />
Stanley: Why?<br />
Developer: The JRE is 25MB, and it is beyond what most consumers are willing to download.<br />
Stanley: Actually, the full download size of JRE 5.0 is ~15MB, and you could get a minimal download of ~7.2MB if you use the online installer.<br />
Developer: Really? I didn't know that. I thought the JRE was '25MB' because that's what I've always heard.</I><br />
 <br />
Obviously, there are some misunderstanding among Java developers about the JRE download size. It is time to do a reality check!<br />
</p>]]>
<![CDATA[<p>If you go to the <A "href=http://java.sun.com/j2se/1.5.0/download.jsp">J2SE 5.0 Update 3 download page</A> and download the JRE, you will see these numbers:</p>

<p><img alt="jre_50u3_download_size.jpg" src="http://weblogs.java.net/blog/stanleyh/archive/jre_download_size/jre_50u3_download_size.jpg" width="536" height="38"/></p>

<p><br />
<B>Apparently, the offline installation is ~15MB, and the online installation is only 221KB?!</B> <I>Note: most JRE installers for Linux/Solaris are also ~15MB.</I> </p>

<p><br />
<B>What exactly are the online and offline installation?</B></p>

<p>The online installer was introduced in Mantis (J2SE 1.4.2) in response to the critical install issues at that time:</p>

<p>1. The JRE was big for most end users to download, and average users only needed the core features.<br />
2. If you developed in Java long enough, you probably still remember there were separate English and I18N bundles. If you installed the wrong bundle on the machine, the only way to fix it was to uninstall the wrong bundle and reinstall the right bundle. Obviously, there were lots of frustration over this issue, and it forced most developers to always bundle the (larger) I18N JRE with their applications.<br />
3. There were a few goodies developers wanted but they were only bundled with the JDK, e.g. sound bank, color profiles, additional fonts, etc. Their unavailability generally discouraged their usage.<br />
4. Lack of incremental update between JRE releases.</li></p>

<p><br />
To address these issues, William Harnois, Kumar Srinivasan, and I decided to implement the install-on-demand feature in the Windows JRE installer. Our approach was to separate the Windows JRE into three features:</p>

<p>1. Core: Western JRE, with Java Plug-in and Java Web Start. This feature is always installed.<br />
2. Other: Other languages and locales. It is installed by default on platforms that support non-Western locales<br />
3. Extras: Sound bank, Color profile pycc.pf, Lucida fonts beyond Lucida Sans Regular.</p>

<p><br />
<I>Architecture of the Windows JRE online installer:</I></p>

<p><img alt="jre_online_installer.jpg" src="http://weblogs.java.net/blog/stanleyh/archive/jre_download_size/jre_online_installer.jpg" width="420" height="263" /></p>

<p><br />
<I>Architecture of the Windows JRE offline installer:</I></p>

<p><img alt="jre_offline_installer.jpg" src="http://weblogs.java.net/blog/stanleyh/archive/jre_download_size/jre_offline_installer.jpg" width="420" height="263" /></p>

<p><br />
<B>With install-on-demand, the online installer is simply a bootstrap that understands how to pull down the rest of the features from the web, while the offline installer basically packages everything into a single bundle.</B></p>

<p>Using the online installer, end users only need to download the critical features of the JRE to run their Java applications. One thing to notice is that the full set of J2SE APIs are available if you download only the core feature, so there is no platform fragmentation issue. The next obvious question is: what is the minimal download using the online installer?</p>

<p>If you look at the online installer architecture carefully, the only components that users must download are: bootstrap, MSI database, and the core feature, and the total size of these components is what we called the minimal download size. In JRE 5.0, the minimal download size is ~7.2MB. If you install the <I>Other</I> and <I>Extras</I> features, it is ~10MB.</p>

<p>Wait a minute! If the total download size for all features is only 10MB, how come the size of the offline installer is ~15MB? This is because some Windows systems do not have the Windows installer engine installed, but the installer engine is required for our JRE installation, so the offline installer must bundle the engine together for distribution, and it adds additional overhead! The online installer does not have this issue because it could download the Windows installer engine from the web if necessary.</p>

<p><B>The good news is: the online installer could give you ~7.2MB minimal download, and it is much smaller than many developers thought!</B></p>

<p>There is more! If you install a JRE update release (i.e. W.X.Y_Z) using an online installer and you already have an installed JRE in the same family (i.e. W.X.Y or other W.X.Y_Z) on the machine, the download could be further reduced through incremental update with base image patching!</p>

<p><br />
<B>What is incremental update?</B></p>

<p>In traditional patching, a patch is often generated between the last up-to-date version and the new version of the software image.</p>

<p><img alt="traditional_patching.jpg" src="http://weblogs.java.net/blog/stanleyh/archive/jre_download_size/traditional_patching.jpg" width="412" height="262" /></p>

<p><br />
In this approach, you could run into all sorts of versioning slew issues. For example, a patch can only be applied if the installed image matches the version that the patch targets. Synching up the mismatch version of the installed image could be very painful, and users may be forced to install dozens of patches in order to bring their local images up to date. Patch installation also yields a different user experience than installing your regular application, and patch management could be very complicated. Fortunately, most of these issues could be avoided in base image patching.</p>

<p>In base image patching, a particular version of the software is defined as the baseline, and its software image is defined as the base image. Patches for subsequent releases of the software are always generated with respect to the base image:</p>

<p><img alt="base_image_patching.jpg" src="http://weblogs.java.net/blog/stanleyh/archive/jre_download_size/base_image_patching.jpg" width="410" height="263" /></p>

<p>In this approach, a patch can be applied only if the base image is already installed. What is really interesting is that the patch size generated through base image patching is very comparable to the one from traditional patching when we applied this scheme to the JRE.</p>

<p>Since Mantis, we have supported incremental update by leveraging base image patching under the cover of the JRE installer. When a JRE installer is built, the installer actually contains a base image and a patch. For example,</p>

<p>- 1.4.2    -> 1.4.2 base image + no-op patch<br />
- 1.4.2_01 -> 1.4.2 base image + 1.4.2_01 patch<br />
- 1.4.2_02 -> 1.4.2 base image + 1.4.2_02 patch<br />
- 1.4.2_0X -> 1.4.2 base image + 1.4.2_0X patch<br />
- 5.0   -> 5.0 base image + no-op patch<br />
- 5.0u1 -> 5.0 base image + 5.0u1 patch<br />
- 5.0u2 -> 5.0 base image + 5.0u2 patch<br />
- 5.0u3 -> 5.0 base image + 5.0u3 patch<br />
- 5.0uX -> 5.0 base image + 5.0uX patch</p>

<p>When a JRE is installed, the installer will always attempt to store the base image in a repository on the machine first in case the base image is absent. If the base image is present, the installer will retrieve the base image and apply its patch to generate the appropiate version of the JRE image for your installation.</p>

<p>Why does it matter to you? If you always use the offline installer, it probably won't make any difference. However, <B>if you use the online installer, the incremental update support could significantly reduce your minimal JRE download size even further. For example, if you already have a 5.0 family JRE installed on the machine, installing a new 5.0 family JRE will only download ~2MB (patch + installer overhead).</B> As a result, the download is much smaller, and the installation is much faster!</p>

<p>Because of the benefits in download reduction, we actually used the online installer for java.com and Java Update in many download scenarios.</p>

<p><I>As a side note: Java Update is a software to deliver JRE update to end users regularly and automatically. Contrary to common belief, Java Update does NOT do any patching; it is actually the downloaded online installer that does the magic!</I></p>

<p><br />
<B>Consider bundling the JRE online installer.</B></p>

<p>If you need to bundle a JRE with your application, you may consider bundling the JRE online installer and take advantages of all the download reduction benefits I outlined above. The bootstrap is less than 250KB! Incremental update is only ~2MB! Even if you don't have a base image on the system, the minimal download is only ~7.2MB. There is a catch though Your users must be online during the JRE installation, and the success rate of the installation is subjected to the network and server condition.</p>

<p>Hopefully, you should now have a better understanding on the JRE download size issue. Of course, we will continue to think hard on how to reduce the download size even further. Tell us what you think!</p>

<p>- Stanley</p>

<p><br />
<I>Note 1: Some of you may wonder how I came up with download size number. The number was determined by simply adding up all the necessary files the online installer must download for the core feature. However, the online installer is hosted on the server side, so it is difficult for general developers to calculate the number themselves.</I></p>

<p><I>Note 2: The Windows JDK installer also follows similar architecture.</p>]]>
</content>
</entry>
<entry>
<title>Deployment: Goodbye scary security dialog box!</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/stanleyh/archive/2005/04/deployment_good_1.html" />
<modified>2006-06-09T00:45:50Z</modified>
<issued>2005-04-30T08:22:28Z</issued>
<id>tag:weblogs.java.net,2005:/blog/stanleyh/243.2379</id>
<created>2005-04-30T08:22:28Z</created>
<summary type="text/plain">The promoted Mustang build 34 contains the putback of the new security warning dialog box for Java Web Start, and you can download it today! </summary>
<author>
<name>stanleyh</name>
<url>http://wiki.java.net/bin/view/People/StanleyHo</url>
<email>Stanley.Ho@Sun.COM</email>
</author>
<dc:subject>Community: JavaDesktop</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/stanleyh/">
<![CDATA[<p>During the post-Tiger planning, we talked to numerous developers to determine what features and enhancements we should work on in Mustang. Many feedbacks we received are related to the user experience in Java Web Start, especially around the security warning dialog box for signed application.</p>]]>
<![CDATA[<p><B>Why is security warning necessary?</B></p>

<p>A signed Java application is simply just, signed. It does not mean that the application should be granted with all permission automatically, because the application could be signed by anyone, including hacker. Therefore, before Java Web Start runs a signed application, it is critical to ask users if they want to trust the signer before granting all permissions to the application for execution.</p>

<p><B>Security warning UI should reveal proper level of information to help users making the right decision.</B></p>

<p>However, there is a fine line between revealing too little information that misleads the users to make the wrong decision, and revealing too much information that scares the users away. Based on the feedbacks, the current security warning UI in Java Web Start is simply too scary looking, and many developers have hard time to convince users to run their applications during deployment. </p>

<p>Here comes the good news!</p>

<p>We have decided to revamp the user experience in Java Web Start in Mustang. Even better, <B>the promoted <A href="http://www.java.net/download/jdk6/binaries/">Mustang build 34</A> contains the initial putback of the new security warning dialog box, and you can download it today!</B> To give you a taste, here are some screenshots:</p>

<p><br />
<I>Signed application with valid certificate:</I></p>

<p><img alt="security_warning_signed.jpg" src="http://weblogs.java.net/blog/stanleyh/archive/goodbye_scary_dialog_box/security_warning_signed.jpg" width="518" height="325" /></p>

<p><br />
<I>Signed application with expired certificate:</I></p>

<p><img alt="security_warning_expired.jpg" src="http://weblogs.java.net/blog/stanleyh/archive/goodbye_scary_dialog_box/security_warning_expired.jpg" width="518" height="325" /></p>

<p><br />
<I>Self-signed application:</I></p>

<p><img alt="security_warning_self_signed.jpg" src="http://weblogs.java.net/blog/stanleyh/archive/goodbye_scary_dialog_box/security_warning_self_signed.jpg" width="518" height="325" /></p>

<p><br />
<I>Note: The messages in the security warning UI are changed based on the nature of the signer certificate. You should try out Mustang to see how the new security warning dialog box will look like for your application.</I></p>

<p><br />
We understand that any change like this has a profound impact to the success of your Java deployment, and your feedback will certainly help us to shape the final product to satisfy your needs. We will continue to make a series of UE/UI changes in Java Web Start before Mustang code freeze, including graphics and layouts, so the input we want at this point is around the messages in the dialog box, not the cosmetic UI issues:</p>

<p>- Do the messages still make the dialog box look scary to your users?<br />
- Do the messages reveal proper level of security related information?<br />
- What improvement do you like to see in the new dialog box?</p>

<p><b>Tell us what you think.</b></p>]]>
</content>
</entry>

</feed>