Reputation: 433
I developed a java application with netbeans. It used jdk 1.6.
It works fine.
But now the requirement is I need to build the jar for the application from the .java files in another machine without netbeans and where jdk 1.5 is used. I cannot upgrade that machine to jdk 1.6.
Is there any way I could make my java files compile and work in jdk 1.5 machine with a possible minimal change to my source code..
The error is javax.swing.grouplayout not available in jdk 1.5
Please help...
Upvotes: 4
Views: 6568
Reputation: 841
Meanwhile the "Matisse" library is no more available, but JDK 1.6 sources, e.g. code.yawk.at. There exists class javax.swing.Grouplayout
, it has dependencies from java.awt.Component
, which was extended in JDK 1.6 by java.awt.Component.BaselineResizeBehavior
and some methods.
Solution is to build from these a class javax5.swing.Grouplayout
with nested BaselineResizeBehavior
. The package is chosen to not interfere with reserved package javax.swing
. Other dependencies from Component
have trivial implementation, there and can be substituted in javax5.swing.Grouplayout
.
Upvotes: 0
Reputation: 54421
For NetBeans, see the answer by John Doe. For Eclipse with MyEclipse so you can use Matisse, in the Outline View, select the Form. Now in the Properties View look at "Layout Generation Style" and select "Swing Layout Extensions Library" rather than "Standard Java 6 Code."
Upvotes: 2
Reputation: 867
Use the netbeans preferences and select org.jdesktop...., update manually the generated code by right-click in the form (Inspector Window -> select swing layout extensions instead of standard java6 code).
Upvotes: 6