Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » compiling on command-line
compiling on command-line [message #979206] Sat, 10 November 2012 18:28 Go to next message
Luuk 34 is currently offline Luuk 34
Messages: 12
Registered: November 2012
Junior Member
I copied code from the internet, source attached, in to Eclipse

Compiling, and running went OK

But from command-prompt it failed:
O:\temp>echo %CLASSPATH%
o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib

O:\temp>javac AllTableName.java

O:\temp>java AllTableName
Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
Caused by: java.lang.ClassNotFoundException: AllTableName
        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)
Could not find the main class: AllTableName.  Program will exit.

O:\temp>java -version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)

O:\temp>


What am i doing wrong here?
Re: compiling on command-line [message #979724 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979729 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979735 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979743 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979749 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979757 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979765 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979773 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979781 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979789 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979797 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979805 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979813 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979821 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979829 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979837 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979845 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979853 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979861 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979870 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979878 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #979886 is a reply to message #979206] Sun, 11 November 2012 05:01 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
>
> Compiling, and running went OK
>
> But from command-prompt it failed:
>
> O:\temp>echo %CLASSPATH%
> o:\temp\mysql-connector-java-5.1.20-bin.jar;c:\Program Files\Java\jre6\lib
>
> O:\temp>javac AllTableName.java
>
> O:\temp>java AllTableName
> Exception in thread "main" java.lang.NoClassDefFoundError: AllTableName
> Caused by: java.lang.ClassNotFoundException: AllTableName
> 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)
> Could not find the main class: AllTableName. Program will exit.
>
> O:\temp>java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
>
> O:\temp>
>
> What am i doing wrong here?
>
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.
Re: compiling on command-line [message #980254 is a reply to message #979886] Sun, 11 November 2012 13:52 Go to previous message
Luuk 34 is currently offline Luuk 34
Messages: 12
Registered: November 2012
Junior Member
David Wegener wrote on Sun, 11 November 2012 06:01
On 11/10/2012 07:09 PM, Luuk 34 wrote:
> I copied code from the internet, source attached, in to Eclipse
Your question really isn't about Eclipse. This is an Eclipse forum and
not a general Java programming forum.

It looks like the classpath doesn't include the folder were the
AllTableName.class resides. If you want the JVM to find a class in the
current directory, you have to include the directory on the classpath.



Is it /me, or are you repeating yourself.... Cool

Thanks for the answer.
Previous Topic:Run configurations: obtaining the dirname of the ${resource_loc}
Next Topic:Code Folding keys don't work in flash builder eclipse
Goto Forum:
  


Current Time: Fri Oct 24 16:26:40 GMT 2014

Powered by FUDForum. Page generated in 0.06293 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software