Java Newbie - import cs1.Keyboard;
From: Jason Beauford (Jbeauford_at_mill-max.com)
Date: 10/02/03
- Previous message: Warwick Molloy: "Re: Protecting code and data in Windows"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 2 Oct 2003 11:34:10 -0400 To: <secprog@securityfocus.com>
Not sure if this is the correct forum but here goes...
I am learning Java and just encountered something strange...
When I run my .class file from a directory outside the one that contains
the cs1\Keyboard.class folder (ie. C:\ rather than C:\Java where C:\Java
contains C:\Java\cs1\Keyboard.class), I get an "Exception in thread
"main" java.lang.NoClassDefFoundError: cs1/Keyboard" error.
However if I run this from the directory which contains the folder
(C:\Java which again contains C:\Java\cs1\Keyboard.class) it runs
perfectly.
My understanding of the "import cs1.Keyboard;" statement is that the
java compiler is importing this class file into the program when it
compiles so it can use it when needed making it independent of directory
structure.
Is this not the case?
Can anyone provide a better solution for using Keyboard.class properly
or maybe some other type of Keyboard input..?
Thanks in advance.
Kind Regards,
JMB.
- Previous message: Warwick Molloy: "Re: Protecting code and data in Windows"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|