Fedora Linux Support Community & Resources Center
  #1  
Old 26th January 2006, 10:15 PM
Andrey:) Offline
Registered User
 
Join Date: Jan 2006
Posts: 7
Java KeyboardReader Problem

Hello guy, iam newbie with Java and trying to learn.
I was expiriwncing problems with KeyboardReader method. So i thought it was due to old version of Java libs but i have updated them all . Whenever i write some program where KeyboardReader method needs to be used, after succsesfull compilation the program gives me this eror :


[root@localhost Java]# javac KbRdPr.java
[root@localhost Java]# java KbRdPr
Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: KeyboardReader
at java.lang.VMClassLoader.transformException(java.la ng.Class, java.lang.Throwable) (/usr/lib/libgcj.so.6.0.0)
at java.lang.VMClassLoader.resolveClass(java.lang.Cla ss) (/usr/lib/libgcj.so.6.0.0)
-bash: [root@localhost: command not found
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
at KbRdPr.main(java.lang.String[]) (Unknown Source)
at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
Caused by: java.lang.ClassNotFoundException: Script not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./,file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(java.lang.String ) (/usr/lib/libgcj.so.6.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.6.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.6.0.0)
...5 more


Could it be Because of my KeyboardReader.class file is in the same directory or does it need to be placed in particular directory?
Please help newbie.
Reply With Quote
  #2  
Old 26th January 2006, 10:21 PM
Shakes's Avatar
Shakes Offline
Registered User
 
Join Date: Feb 2005
Location: Scotland
Posts: 445
You're talking like KeyboardReader is a method but it seems to think that it should be a class. I don't see the class in the api. If it's a third party thing that your using then you need to make sure it's in your classpath. Do you want to paste some code?
Reply With Quote
  #3  
Old 26th January 2006, 10:24 PM
Andrey:) Offline
Registered User
 
Join Date: Jan 2006
Posts: 7
So how do i do that ?
Reply With Quote
  #4  
Old 26th January 2006, 10:37 PM
Shakes's Avatar
Shakes Offline
Registered User
 
Join Date: Feb 2005
Location: Scotland
Posts: 445
Actually I don't thnk that your classpath will be wrong since ti compiled. Can you copy and paste your code or attach it as a file?
Reply With Quote
  #5  
Old 26th January 2006, 10:59 PM
Andrey:) Offline
Registered User
 
Join Date: Jan 2006
Posts: 7
//
//To check functionality of keyboardreader


class KbRdPr

{
public static void main (String args[])
{
KeyboardReader kb = new KeyboardReader();

double a, b, c;

System.out.println("Please Enter Number:");
a=kb.getDouble();
System.out.println("plese again:");
b=kb.getDouble();
c=a*b;
System.out.println("result:" + c);
}
}


This is the program that iam tring to run. The KeyboardReader.class file atached as i downloaded alrerady compiled . Could that be a problem?
Attached Files
File Type: zip KeyboardReader.zip (1.3 KB, 88 views)
Reply With Quote
  #6  
Old 27th January 2006, 01:42 AM
Andrey:) Offline
Registered User
 
Join Date: Jan 2006
Posts: 7
Finaly
I sorted it out:
i needed to download The update form Sun for J2SE(TM) Runtime Environment 5.0 .
The information found here http://stanton-finley.net/fedora_cor...otes.html#Java found EXTREMLY USEFULL.

And i kept the KeyboardReader in the same directory

Thanx for your help.
Andrey
Reply With Quote
Reply

Tags
java, keyboardreader, problem

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java problem shadowwyvern Using Fedora 3 19th May 2007 03:56 AM
java problem faustjoe Installation and Live Media 4 3rd April 2007 11:08 PM
i think i have a java problem stlouis1 Using Fedora 21 26th January 2007 06:54 AM
Java problem in FC3 firestorm Using Fedora 4 12th November 2005 08:38 PM


Current GMT-time: 21:11 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat