Websphere Liberty 8.5: Setting Java classpath

后端 未结 2 1127
旧时难觅i
旧时难觅i 2021-01-07 00:35

I am running Websphere Liberty 8.5. My application reads some files from the file system that are obtained via the Java CLASSPATH and I can\'t seem to find a way to append a

相关标签:
2条回答
  • 2021-01-07 01:17

    ANOTHER WARNING! It only reads JAR files! I had the same issue with endless frustration. Even if you use the <library><folder dir="..."/></library> method above, it will only read jar files from the classpath. I had a bunch of properties files that I read from the classpath in JBOSS, WebSphere (full), and Glassfish, but the same method doesn't work for Websphere Liberty. What I ended up doing is the above, and putting my properties files all in a .jar file. Very annoying but a work-around, in case you need to read non-jar files.

    0 讨论(0)
  • 2021-01-07 01:20

    It is not possible to modify the JVM application classpath (normally specified via the -classpath JVM argument or the CLASSPATH environment variable). I would recommend using a <library> to give your applications visibility to the resources. If you need a directory, you should use <library><folder dir="..."/></library>.

    (As an aside, modifying the wlp/bin scripts or setting those "internal" script variables is not a supported external.)

    0 讨论(0)
提交回复
热议问题