<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Tooling Support for Multiple Run time Versions
</h3>
<span style="margin-bottom: 10px;">
    modified by <a href="http://community.jboss.org/people/admin">Administrator Administrator</a> in <i>JBoss Tools</i> - <a href="http://community.jboss.org/docs/DOC-13335">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p><a class="jive-link-wiki-small" href="http://community.jboss.org/docs/DOC-11954">&lt;-- Back to SOA Tooling</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Introduction</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h1>Case Study</h1><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In this case study we examine key features of multiple Java VM support in <a class="jive-link-external-small" href="http://www.eclipse.org">Eclipse</a>. We use this example not because it dictates how support for multiple versions of run times must be handled in every situation, but rather because it illustrates core design considerations for this problem.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Regardless of the Java version used to run Eclipse itself, the Eclipse Java development environment allows the user to configure which Java VM will be used for development. As will be seen below, a default choice is made for Java development, and this default can be overridden on a per-project basis.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Within the Java development environment preferences, there is a section for configuring Java run times:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: center;"><a href="http://community.jboss.org/servlet/JiveServlet/showImage/102-13335-5-1149/vm-list-dialog.jpg"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/102-13335-5-1149/450-302/vm-list-dialog.jpg </span></a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In this case, we have two Java VM versions available, with a 1.5 VM set as default. (Available Java VM run times actually can vary on two dimensions: version and vendor. In this example, we will concentrate on version differences, though the same applies to vendor differences as well.)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The user can add new Java VM options:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: center;"><a href="http://community.jboss.org/servlet/JiveServlet/showImage/102-13335-5-1150/add-vm-dialog.jpg"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/102-13335-5-1150/450-420/add-vm-dialog.jpg </span></a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Here I have added a Java 1.6 VM. Note that there are a number of archives (jar files) involved in the definition of a "Java 1.6 VM," and the tooling has determined these based on the location chosen. Also notice that adjustments to the archives list are possible (add, remove, etc.) using the buttons on the right-hand side.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Since a Java 1.5 VM is the default, a Java code using generics will compile without error and is supported by editor features such as code completion:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: center;"><a href="http://www.jboss.org/community/servlet/JiveServlet/downloadImage/1151/java5-code.jpg"><span> http://www.jboss.org/community/servlet/JiveServlet/downloadImage/1151/java5-code.jpg </span></a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The user can, however, change the Java VM level at the default or project level. For this example, I changed the Java VM level to 1.4 for the project only. Doing so results in a rebuild and errors displayed in the editor:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: center;"><a href="http://www.jboss.org/community/servlet/JiveServlet/downloadImage/1152/java5-code-err.jpg"><span> http://www.jboss.org/community/servlet/JiveServlet/downloadImage/1152/java5-code-err.jpg </span></a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>With more detail in the Problem View:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: center;"><a href="http://community.jboss.org/servlet/JiveServlet/showImage/102-13335-5-1153/problem-view.jpg"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/102-13335-5-1153/450-71/problem-view.jpg </span></a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Although this example seems very simple and obvious, it does illustrate a number of features. In particular, we can ask how useful (and usable) the Eclipse Java development environment would be if:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ul><li>The user could not choose the Java VM for development. Perhaps instead the Java VM would be only the one used to run Eclipse, and hence the Eclipse launch configuration would need to be changed to switch Java VM run times. <br/></li><li>The user could not choose a Java VM version on a per-project basis. Instead the Java VM would be global, and changing it would impact all projects in the workspace.</li><li>When adding a new Java VM option the user had to specify the set of archives by hand. That is, rather than thinking about add a "Java VM," the user had to think about adding a set of archives that together comprise the "Java VM."</li><li>The Java editor was not aware of specific features in Java VM versions. Perhaps the Java editor would not support generics even though a Java 1.5 VM was is use.</li><li>Switching the Java VM version for a project (or on a global default basis) did not register errors for code invalidated by the change.</li><li>The Java editor and (Eclipse) incremental Java compiler did not show any compile errors, but when a application was run, the Java VM threw an error for invalid byte code.</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Clearly these sorts of problems would seriously hamper efficient development of Java applications in Eclipse, and users would not consider the Eclipse Java tooling as particularly useful or usable. Luckily the Eclipse Java&#160; development environment does not suffer from these short-comings, and the relatively simple features in support of Java VM versions are keys in achieving this cohesiveness.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Design Considerations</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Comment by <a href="http://community.jboss.org/docs/DOC-13335">going to Community</a></p>

        <p style="margin: 0;">Create a new document in JBoss Tools at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2128">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>