Code Monkey home page Code Monkey logo

Comments (3)

wilkinsona avatar wilkinsona commented on July 16, 2024

When you launch an application with java -jar (I assume that's what you're doing), you cannot specify additional classpath locations. In other words, you cannot use both -jar and -cp at the same time. This is a limitation of the JVM.

You may be able to achieve your goal by launching your application differently. Something like this:

java -cp application.jar:another/location org.springframework.boot.loader.launch.JarLauncher

If you have any further questions, please follow up on Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.

from spring-boot.

nguyentthai96 avatar nguyentthai96 commented on July 16, 2024

An idea: load jar java -cp application.jar:another/location org.springframework.boot.loader.launch.JarLauncher; but it's me want configuration "spring.messages.basename" can special path file jar outsite; as load default application.properties in the folder ./config same path file boot jar.

I think didn't need classpath in ".getResources("classpath*:" + target + ".properties");" so I would like to organize folder storage struct message*.properties outsite change config text easy no rebuild source code.

from spring-boot.

wilkinsona avatar wilkinsona commented on July 16, 2024

Unfortunately, that isn't how the JDK's ResourceBundle works. Please see its getBundle method and the description of how it uses ClassLoader.getResource() for details.

As I said above, please follow up on Stack Overflow if you have any further questions.

from spring-boot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.