0

I am making a java web application that a hosting service is running for me, and I must recompile and send it to the host every time I make a change. I would like to be able to put all of my libraries in a folder in the host, and only have to compile my jar that will know that its dependencies are next to it.

I have used the IntelliJ IDEA builder located in File > Project Structure. I export all library jars used in a folder next to the main jar named lib, and I have learned about wildcards so I set the classpath to be \lib\*. This did not work and I was thrown a chunky NoClassDefFoundError in my server's console.

I know this must be possible. How should I change my approach?

EDIT: I have researched a bit deeper, and the answer to this question states at the bottom that the wildcard system is not honored in the jar manifest attribute. Do I have to include all files individually (And if so, how?) ?

HydroPage
  • 121
  • 12
  • Have you tried this? https://stackoverflow.com/questions/219585/including-all-the-jars-in-a-directory-within-the-java-classpath – hnbanh Jul 08 '19 at 03:42
  • Yes, that's where I learned about wildcards. The answer explains it is better to do `*` rather than `*.jar`, and also described a known bug in 1.8 where there has to be a preceding slash in the classpath – HydroPage Jul 08 '19 at 03:54
  • @Ale Lav add command in your question which you have used. – Dhrumil Patel Jul 08 '19 at 05:33
  • @DhrumilPatel I'm not using any command to execute this. If you want higher clarification, I'm making a Minecraft server plugin that the server will take care to run for me, but the jar's dependencies are about 8MB, when the real jar is about 4KB, I could save so much time. – HydroPage Jul 08 '19 at 12:18

0 Answers0