×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Jar problem - envoirment can't find XYLayout

Jar problem - envoirment can't find XYLayout

Jar problem - envoirment can't find XYLayout

(OP)
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.

RE: Jar problem - envoirment can't find XYLayout

(OP)
OK I have solved the problem myself.

RE: Jar problem - envoirment can't find XYLayout

Please post your solution as reference for others.

Tim

RE: Jar problem - envoirment can't find XYLayout

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close