Page 1 of 1

My first java program (haha such a rip off of FRWL...)

PostPosted: Tue Sep 13, 2005 3:54 am
by Mr. SmartyPants
I pretty much made my first java program.... kinda pointless though... (I started a programming class in school this year)

the whole thing may not appear in the screen though....

edit: okay for some reason I cant add an attachment...

I guess this will have to suffice

http://s8.yousendit.com/d.aspx?id=31LT08143BXVQ17D4CE5C9WSFQ

PostPosted: Tue Sep 13, 2005 8:09 pm
by Warrior4Christ
Exception in thread "main" java.lang.NoClassDefFoundError: apcslib/SketchPad
at draw.main(draw.java:18)

It didn't work... does it needs some other class file or other dependency?

PostPosted: Wed Sep 14, 2005 12:45 am
by Slater
get same error. I deccompiled the source... here are the imports

import apcslib.DrawingTool;
import apcslib.SketchPad;
import java.awt.Color;


where can we get these?

PostPosted: Wed Sep 14, 2005 3:51 am
by Mr. SmartyPants
oh yeah, sorry about that

wait... do you need those to run the .class file? (sorry im REALLY new at this)

PostPosted: Wed Sep 14, 2005 3:01 pm
by Slater
yep, you do. The program you wrote says "Hey! You three guys, come here I need you!" and so they need to be there for that program to do it's thing.

Take the CAA Chatroom for example, Java based. Here, we have an archive of many class files, http://www.christiananime.net/chat/ChatEverywhere.jar. Now, decompiling chat.class, we see many many imports... some of them part of the standard Java package and some of them not. Here are three examples.

import org.chateverywhere.InputDialog;
import org.chateverywhere.InputStack;
import org.chateverywhere.MD5;

These three are all included in the ChatEverywhere.jar file. WHen Chat.class is invoked, it automaticly sees that it needs these three classes and invokes them as well to run along with it. If they were not there, the chatroom would be broken, or the coding for the chatroom would be very different and a lot more complex.

In short, when compiling a .java file from .java to byte code, it doesn't import the classes you tell it to import and compile them into the output .class file. All it does is keep in the byte code the fact that the program needs those classes. So, if that program works on your computer, it will work on all of ours if you can hit us up with those three missing classes... :D

PostPosted: Wed Sep 14, 2005 5:14 pm
by Mr. SmartyPants
you may need these .jar files

http://s38.yousendit.com/d.aspx?id=3NL3R4BRM3I5N24N5CEC9PNEA4

put in:
C:\Program Files\Java\jdk1.5.0_04\jre\lib\ext
C:\Program Files\Java\jre1.5.0_04\lib\ext

or somewhat similar to those O.o methinks

ooo its a .rar by the way, not a zip