문제

I'm using 3rd libraries (substance, trident) and I added them as libraries (I added the .jar's) to my project in Netbeans. This works also but if I use the builded jar outside the project directory it doesn't work like it should (the choosen UI don't show), I get the error:

java.lang.ClassNotFoundException: org.pushingpixels.substance.api.skin.SubstanceOfficeBlue2007LookAndFeel

I set that UI/LookAndFeel like that in my code:

UIManager.setLookAndFeel("org.pushingpixels.substance.api.skin.SubstanceOfficeBlue2007LookAndFeel");

How could I make this work/run?

도움이 되었습니까?

해결책

You've got 2 choices:

  1. Put the library jar on the classpath.
  2. Assemble\Build the library jar with the regular jar.

For option 1, you most likely need the jar located "near" the main jar on the file system; though, this is not necessarily a requirement. When you run the jar you then include the library jar on the classpath.

For option 2, you use some type of tool like maven's assembly plugin or the fatjar plugin in Eclipse (sorry, I don't know what the analog is in NB).

I hope this helps.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top