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

The geek forum. PHP, Perl, HTML, hardware questions etc.. it's all in here. Got a techie question? We'll sort you out. Ask your questions or post a link to your own site here!

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

Postby Mr. SmartyPants » Tue Sep 13, 2005 3:54 am

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
User avatar
Mr. SmartyPants
 
Posts: 12541
Joined: Sat Aug 21, 2004 9:00 am

Postby Warrior4Christ » Tue Sep 13, 2005 8:09 pm

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?
Everywhere like such as, and MOES.

"Expect great things from God; attempt great things for God." - William Carey
User avatar
Warrior4Christ
 
Posts: 2045
Joined: Sat Aug 20, 2005 8:10 pm
Location: Carefully place an additional prawn on the barbecue

Postby Slater » Wed Sep 14, 2005 12:45 am

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?
Image
User avatar
Slater
 
Posts: 2671
Joined: Sat May 22, 2004 10:00 am
Location: Pacifica, Caliphornia

Postby Mr. SmartyPants » Wed Sep 14, 2005 3:51 am

oh yeah, sorry about that

wait... do you need those to run the .class file? (sorry im REALLY new at this)
User avatar
Mr. SmartyPants
 
Posts: 12541
Joined: Sat Aug 21, 2004 9:00 am

Postby Slater » Wed Sep 14, 2005 3:01 pm

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
Image
User avatar
Slater
 
Posts: 2671
Joined: Sat May 22, 2004 10:00 am
Location: Pacifica, Caliphornia

Postby Mr. SmartyPants » Wed Sep 14, 2005 5:14 pm

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
User avatar
Mr. SmartyPants
 
Posts: 12541
Joined: Sat Aug 21, 2004 9:00 am


Return to Computing and Links

Who is online

Users browsing this forum: No registered users and 90 guests