Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Jar problem - envoirment can't find XYLayout

Status
Not open for further replies.

Darkuss

Programmer
Jan 29, 2007
3
PL
Hi

I have created an Appliaction using JBuilder Foundation 2005. When runed from JBuilder everything is ok and it works perfectly. Next I have made a jar out of it by using jdk1.4 included in JBuilder. Now when I try to run the application from console (by writing: java -jar tmp1.jar) I get an error as fallows

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/borland/jbcl/layout/XYLayout
at tmp1.Frame1.<init>(Frame1.java:69)
and so on.

From what I understand it has a problem with the XY Layout which I used often in my application. I would not like to have to change the whole Layout since I'm using many frames with many elemnts, both because it would take a lot of time and because JBuilder's Foundation Designer has problem with PaneLayout with many elements.

I hope You can help me and if you can, keep in mind that I am new in Java Programing and Envoirment and try to make the anwser simple and easy to understand/fallow.
Thx in advance.
 
Please post your solution as reference for others.

Tim
 
The jar I have previously createrd was done from console using jar.exe from jdk1.4 directory in Borland\JBuilder2005\jdk1.4\bin. It has created the jar with my project but did not include all the necessery libraries (if thats how they are called in java). The output weighted about 58kB. Since XYLayout is special for Borland, Java Envoirment surely could not understand it.

Fortunately I have found a way to make a jar directly from Borland JBuilder2005, though it is quite hidden in my opinion. You can do it by selecting File->New->Archive->Applet Jar. Then you fallow the steps in a wizard and the jar is included into your project. Next you have to rebuild the project to make the jar physicly on your hard drive.
Tip: JBuilder says that he can automaticly generate manifest file, but at least in my case the manifest didn't include the Main-Class Option so you may have to prepare the manifest by yourself and choose a proper option during the wizard setup.

Such created jar contains all necessary libraries and in my case weighted about 1,5MB. You can reduce the weight during the wizard by deselecting some libraries if you like.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top