| <html><head> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <title>Managing Server Classpath</title><link rel="stylesheet" type="text/css" href="css/docbook.css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><meta name="keywords" content="jetty, servlet, servlet-api, cometd, http, spdy, websocket, eclipse, maven, java, server, software"><link rel="home" href="index.html" title="Jetty : The Definitive Reference"><link rel="up" href="startup.html" title="Chapter 9. Starting Jetty"><link rel="prev" href="startup-xml-config.html" title="Managing XML Based Startup Configuration"><link rel="next" href="startup-modules.html" title="Managing Startup Modules"><link xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" rel="shortcut icon" href="images/favicon.ico"><script type="text/javascript" src="js/shCore.js"></script><script type="text/javascript" src="js/shBrushJava.js"></script><script type="text/javascript" src="js/shBrushXml.js"></script><script type="text/javascript" src="js/shBrushBash.js"></script><script type="text/javascript" src="js/shBrushJScript.js"></script><script type="text/javascript" src="js/shBrushSql.js"></script><script type="text/javascript" src="js/shBrushProperties.js"></script><script type="text/javascript" src="js/shBrushPlain.js"></script><link type="text/css" rel="stylesheet" href="css/shCore.css"><link type="text/css" rel="stylesheet" href="css/shThemeEclipse.css"><link type="text/css" rel="stylesheet" href="css/font-awesome.min.css"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><tr><td style="width: 25%"><a href="http://www.eclipse.org/jetty"><img src="images/jetty-header-logo.png" alt="Jetty Logo"></a><br><span style="font-size: small"> |
| Version: 9.2.21.v20170120</span></td><td style="width: 50%"><script type="text/javascript"> (function() { |
| var cx = '016459005284625897022:obd4lsai2ds'; |
| var gcse = document.createElement('script'); |
| gcse.type = 'text/javascript'; |
| gcse.async = true; |
| gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + |
| '//www.google.com/cse/cse.js?cx=' + cx; |
| var s = document.getElementsByTagName('script')[0]; |
| s.parentNode.insertBefore(gcse, s); |
| })(); |
| </script><gcse:search></gcse:search></td></tr></table><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Managing Server Classpath</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="startup-xml-config.html"><i class="icon-chevron-left"></i> Previous</a> </td><th width="60%" align="center">Chapter 9. Starting Jetty<br><a accesskey="p" href="index.html"><i class="icon-home"></i> Home</a></th><td width="20%" align="right"> <a accesskey="n" href="startup-modules.html">Next <i class="icon-chevron-right"></i></a></td></tr></table><hr></div><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="jetty-callout"><h5 class="callout"><a href="http://www.webtide.com/">Contact the core Jetty developers at |
| <span class="website">www.webtide.com</span></a></h5><p> |
| private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... |
| scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery |
| </p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="startup-classpath"></a>Managing Server Classpath</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="startup-classpath.html#d0e7848">Interrogating the Server Classpath</a></span></dt></dl></div><p>Jetty Server Classpath is determined by a combination of |
| factors.</p><div class="variablelist"><dl><dt><span class="term">The java.class.path System Property</span></dt><dd><p>If you start Jetty with a JVM specified classpath, then Jetty |
| will use the java.class.path System Property to populate the |
| initial classpath.</p></dd><dt><span class="term">Module specified Libraries</span></dt><dd><p>With Jetty 9.1+ the module system declares various libraries |
| that are required for that module to operate, these module defined |
| libraries are added to the Jetty Server classpath when any module is |
| activated with library declarations.</p></dd><dt><span class="term">Command Line Libraries</span></dt><dd><p>The command line option <code class="literal">--lib=<path></code>can |
| be used as a final means to add arbitrary entries to the Jetty Server |
| classpath.</p></dd></dl></div><p>Of special note, there are 2 structural modules defined to ease some |
| of this for you.</p><div class="variablelist"><dl><dt><span class="term">--module=ext</span></dt><dd><p>The <code class="literal">ext</code> module will enable the |
| <code class="filename">lib/ext/*.jar</code> logic.</p><p>If this module is activated, then all jar files found in the |
| lib/ext/ paths will be automatically added to the Jetty Server |
| Classpath.</p></dd><dt><span class="term">--module=resources</span></dt><dd><p>The <code class="literal">resources</code> module will add the |
| <code class="filename">resources/</code> directory the classpath.</p><p>If you have 3rd party libraries that lookup resources from the |
| classpath, put your files in here.</p><p>Logging libraries often have classpath lookup of their |
| configuration files (eg: <code class="filename">log4j.properties</code>, |
| <code class="filename">log4j.xml</code>, |
| <code class="filename">logging.properties</code>, and |
| <code class="filename">logback.xml</code>), so this would be the ideal setup |
| for this sort of configuration demand.</p></dd></dl></div><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><i class="icon-asterisk"></i> Note</h3><p>Both the <code class="literal">ext</code> and <code class="literal">resources</code> |
| modules declare relative paths that follow <a class="link" href="startup-base-and-home.html#base-vs-home-resolution" title="Configuration Resolution Rules">Jetty Base and Jetty Home path |
| resolution rules</a>.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="d0e7848"></a>Interrogating the Server Classpath</h3></div></div></div><p>The Jetty start.jar has the ability to resolve the classpath from |
| the command line + modules + configuration, and list the classpath entries |
| it will use to start jetty.</p><p>The <code class="literal">--list-classpath</code> command line option is used |
| as such.</p><p>(Demonstrated with the <a class="link" href="startup-base-and-home.html#demo-base" title="Demo-Base in the Jetty Distribution">demo-base from the |
| Jetty Distribution</a>)</p><div class="screenexample"><pre class="screen">[demo-base]$ java -jar ../start.jar --list-classpath |
| |
| Jetty Server Classpath: |
| ----------------------- |
| Version Information on 42 entries in the classpath. |
| Note: order presented here is how they would appear on the classpath. |
| changes to the --module=name command line options will be reflected here. |
| 0: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-client-9.2.21.v20170120.jar |
| 1: 1.4.1.v201005082020 | ${jetty.base}/lib/ext/javax.mail.glassfish-1.4.1.v201005082020.jar |
| 2: 9.2.21.v20170120 | ${jetty.base}/lib/ext/test-mock-resources-9.2.21.v20170120.jar |
| 3: (dir) | ${jetty.home}/resources |
| 4: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar |
| 5: 3.1.RC0 | ${jetty.home}/lib/jetty-schemas-3.1.jar |
| 6: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-http-9.2.21.v20170120.jar |
| 7: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-continuation-9.2.21.v20170120.jar |
| 8: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-server-9.2.21.v20170120.jar |
| 9: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-xml-9.2.21.v20170120.jar |
| 10: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-util-9.2.21.v20170120.jar |
| 11: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-io-9.2.21.v20170120.jar |
| 12: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-jaas-9.2.21.v20170120.jar |
| 13: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-jndi-9.2.21.v20170120.jar |
| 14: 1.1.0.v201105071233 | ${jetty.home}/lib/jndi/javax.activation-1.1.0.v201105071233.jar |
| 15: 1.4.1.v201005082020 | ${jetty.home}/lib/jndi/javax.mail.glassfish-1.4.1.v201005082020.jar |
| 16: 1.2 | ${jetty.home}/lib/jndi/javax.transaction-api-1.2.jar |
| 17: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-rewrite-9.2.21.v20170120.jar |
| 18: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-security-9.2.21.v20170120.jar |
| 19: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-servlet-9.2.21.v20170120.jar |
| 20: 3.0.0 | ${jetty.home}/lib/jsp/javax.el-3.0.0.jar |
| 21: 1.2.0.v201105211821 | ${jetty.home}/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar |
| 22: 2.3.2 | ${jetty.home}/lib/jsp/javax.servlet.jsp-2.3.2.jar |
| 23: 2.3.1 | ${jetty.home}/lib/jsp/javax.servlet.jsp-api-2.3.1.jar |
| 24: 2.3.3 | ${jetty.home}/lib/jsp/jetty-jsp-jdt-2.3.3.jar |
| 25: 1.2.0.v201112081803 | ${jetty.home}/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar |
| 26: 3.8.2.v20130121-145325 | ${jetty.home}/lib/jsp/org.eclipse.jdt.core-3.8.2.v20130121.jar |
| 27: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-plus-9.2.21.v20170120.jar |
| 28: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-webapp-9.2.21.v20170120.jar |
| 29: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-annotations-9.2.21.v20170120.jar |
| 30: 4.1 | ${jetty.home}/lib/annotations/asm-4.1.jar |
| 31: 4.1 | ${jetty.home}/lib/annotations/asm-commons-4.1.jar |
| 32: 1.2 | ${jetty.home}/lib/annotations/javax.annotation-api-1.2.jar |
| 33: 9.2.21.v20170120 | ${jetty.home}/lib/jetty-deploy-9.2.21.v20170120.jar |
| 34: 1.0 | ${jetty.home}/lib/websocket/javax.websocket-api-1.0.jar |
| 35: 9.2.21.v20170120 | ${jetty.home}/lib/websocket/javax-websocket-client-impl-9.2.21.v20170120.jar |
| 36: 9.2.21.v20170120 | ${jetty.home}/lib/websocket/javax-websocket-server-impl-9.2.21.v20170120.jar |
| 37: 9.2.21.v20170120 | ${jetty.home}/lib/websocket/websocket-api-9.2.21.v20170120.jar |
| 38: 9.2.21.v20170120 | ${jetty.home}/lib/websocket/websocket-client-9.2.21.v20170120.jar |
| 39: 9.2.21.v20170120 | ${jetty.home}/lib/websocket/websocket-common-9.2.21.v20170120.jar |
| 40: 9.2.21.v20170120 | ${jetty.home}/lib/websocket/websocket-server-9.2.21.v20170120.jar |
| 41: 9.2.21.v20170120 | ${jetty.home}/lib/websocket/websocket-servlet-9.2.21.v20170120.jar |
| </pre></div><p>Of note is that an attempt is made to list the internally declared |
| version of each artifact on the Server Classpath, of potential help when |
| diagnosing classpath issues.</p></div></div><script type="text/javascript"> |
| SyntaxHighlighter.all() |
| </script><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="startup-xml-config.html"><i class="icon-chevron-left"></i> Previous</a> </td><td width="20%" align="center"><a accesskey="u" href="startup.html"><i class="icon-chevron-up"></i> Top</a></td><td width="40%" align="right"> <a accesskey="n" href="startup-modules.html">Next <i class="icon-chevron-right"></i></a></td></tr><tr><td width="40%" align="left" valign="top">Managing XML Based Startup Configuration </td><td width="20%" align="center"><a accesskey="h" href="index.html"><i class="icon-home"></i> Home</a></td><td width="40%" align="right" valign="top"> Managing Startup Modules</td></tr></table></div><p xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><div class="jetty-callout"> |
| See an error or something missing? |
| <span class="callout"><a href="http://github.com/jetty-project/jetty-documentation">Contribute to this documentation at |
| <span class="website"><i class="icon-github"></i> Github!</span></a></span><span style="float: right"><i>(Generated: 2015-03-13T11:47:51-05:00)</i></span></div></p><script xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" type="text/javascript"> |
| var _gaq = _gaq || []; |
| _gaq.push(['_setAccount', 'UA-1149868-7']); |
| _gaq.push(['_trackPageview']); |
| |
| (function() { |
| var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
| ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
| var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
| })(); |
| </script></body></html> |