Trouble with running java application [message #771035] |
Mon, 26 December 2011 05:03 |
Donovan Ng Messages: 3 Registered: December 2011 Location: Singapore |
Junior Member |
|
|
Hi,
I need help with compiling the code in eclipse. I have looked around the web and thought that classpath was the problem and fixed it but i am still getting this error...
Exception in thread "main" java.lang.NoClassDefFoundError: Driver
Caused by: java.lang.ClassNotFoundException: Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Can anyone help me understand further what I must do to solve this?
|
|
|
|
|
Re: Trouble with running java application [message #771928 is a reply to message #771444] |
Wed, 28 December 2011 14:55 |
|
On 2011.12.27 2:17, Donovan Ng wrote:
> I am using mac to run eclipse. It is different from setting it like
> Windows.
> Is there any reference to configure it on mac platform?
>
> Also I am planning to build its scale in near future, do you suggest I
> use Ant to prevent from re-specifying from each compilation?
Unless I've misunderstood, what you want to do is add the library (JAR)
containing the symbol that's apparently missing to "the classpath" via
right-clicking your project, choosing Build Path, then the Libraries
tab. It make no difference whether you're running Eclipse on Windows or
Macintosh.
|
|
|
|
Re: Trouble with running java application [message #772332 is a reply to message #772122] |
Thu, 29 December 2011 14:34 |
|
On 2011.12.28 20:26, Donovan Ng wrote:
> Hi,
> Would like to ask further regarding your post..
>
> If I am missing a specific .class file for eclipse, how would I know
> which one is missing for me to place it on to eclipse?
>
> Any recommended ways? I apologize as I am don't normally use an IDE to
> compile my java files. Just wanted to try something new :) THanks!
Typically, you add .class files to Eclipse projects as JARs via Build
Path. You can hand-copy a .class file to a project, but then you have to
wire things up specially for that as dropping it into a subdirectory
with the .class files created by Eclipse compilation will also subject
it to being deleted, either by Eclipse (not necessarily) or ant (well,
the way I write it would delete it). In any case, it's not a very stable
proposition.
As I don't grok exactly what you're trying to do, nor do I think I've
done what you're doing, it's hard to give experienced or knowledgeable
advice.
Give more details in your reply if you wish to pursue this.
Best,
Russ
|
|
|
Powered by
FUDForum. Page generated in 0.09969 seconds