1

we run builds on server with solaris. After changing jre 1.6 to jre 1.7 the utility which run all tests start to throw an exception(sorry for my English):

 [java] Exception in thread "main" java.lang.Error: Cannot load javax.swing.plaf.metal.MetalLookAndFeel
 [java]     at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1347)
 [java]     at javax.swing.UIManager.initialize(UIManager.java:1455)
 [java]     at javax.swing.UIManager.maybeInitialize(UIManager.java:1422)
 [java]     at javax.swing.UIManager.getDefaults(UIManager.java:656)
 [java]     at javax.swing.UIManager.put(UIManager.java:985)
 [java]     at org.uispec4j.interception.ui.UISpecLF.init(UISpecLF.java:11)
 [java]     at org.uispec4j.UISpec4J.init(UISpec4J.java:32)
 [java]     at org.uispec4j.UISpecTestCase.<clinit>(UISpecTestCase.java:31)
 [java]     at java.lang.Class.forName0(Native Method)
 [java]     at java.lang.Class.forName(Class.java:186)

I also try to switch another laf in build.xml to solve this problem but it doesn't help.

(jvmarg value="-Dswing.defaultlaf=com.jgoodies.looks.plastic.PlasticXPLookAndFeel" )

What is the reason? How to fixed it?

Maxim Ostrovsky
  • 227
  • 1
  • 3
  • 12
  • 2
    I think that there no issue with any L&Fs default or Custom too (excluding Substance) with JDK_7, for better help sooner post an [SSCCE](http://sscce.org/), maybe important maybe not, for why reason you intialized L&F from JVM arguments, before anything to read [Modifying the Look and Feel](http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/index.html) by default valid for majority of custom L&Fs too – mKorbel Nov 21 '12 at 10:02
  • +1 to mKorbel. Are you trying to find a programmatic solution or one that simply passes arguments to jvm when jar is run? – David Kroukamp Nov 21 '12 at 10:37
  • What arguments I have to pass? I just tried to change laf to avoid this exception but it didn't work. The excpetion throw in UISpecClass(UISpecTestCase) so I can't chnage anything there. And it was working with jre1.6 – Maxim Ostrovsky Nov 21 '12 at 10:50
  • just a confirmation: after switching to 1.7 jre, I have seen a similar error with the swingx demo application webstartable on _some_ machines - no idea why that might happen – kleopatra Nov 21 '12 at 11:14

1 Answers1

0

UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel") Like this u need to add metal look and feel by loading the driver to the UIMangaer.setLookandFeel