title: How to set Classpath on Jboss EAP openshift image
body: <p>Image used : <a href="https://access.redhat.com/containers/#/registry.access.redhat.com/jboss-eap-7/eap70-openshift" rel="nofollow noreferrer">https://access.redhat.com/containers/#/registry.access.redhat.com/jboss-eap-7/eap70-openshift</a></p>
  
  <p>I can set an ENV variable but it does not work.</p>
  
  <p>Dockerfile :</p>
  
  <pre><code>FROM registry.access.redhat.com/jboss-eap-7/eap70-openshift
  ENV CLASSPATH $CLASSPATH:/opt/eap/standalone/lib/required_libs/fscontext.jar
  </code></pre>
  
  <p>It sets this variable but I still get following exception,</p>
  
  <pre><code>Caused by: java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory from [Module "org.jboss.as.naming:main" from local module loader @b97c004 (finder: local module finder @4590c9c3 (roots: /opt/eap/modules,/opt/eap/modules/system/layers/openshift,/opt/eap/modules/system/layers/base/.overlays/layer-base-jboss-eap-7.0.6.CP,/opt/eap/modules/system/layers/base,/opt/eap/modules/system/add-ons/keycloak))]
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:348)
      at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:113)
  </code></pre>
  
  <p>Setting classpath inside container also does not work.</p>
  
  <p>Looking for setting a classpath which would show up in java process like below :</p>
  
  <pre><code>[root@9a290d7939bb ~]# ps -ef | grep java
  root         1     0  0 Jul18 ?        00:05:49 /usr/lib/jvm/java-1.8.0/bin/java -Dnop -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.library.path=/opt/webserver/lib -Djava.security.egd=file:/dev/./urandom -javaagent:/opt/jolokia/jolokia.jar=config=/opt/jolokia/etc/jolokia.properties -XX:+UseParallelGC -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m -XX:+ExitOnOutOfMemoryError -Djava.endorsed.dirs=/opt/webserver/endorsed **-classpath /opt/webserver/fscontext.jar:/opt/webserver/ldap.jar** -Dcatalina.base=/opt/webserver -Dcatalina.home=/opt/webserver -Djava.io.tmpdir=/opt/webserver/temp org.apache.catalina.startup.Bootstrap start
  </code></pre>