Home > Archive > Java Help > April 2004 > help needed compiling java application
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
help needed compiling java application
|
|
| Geiregat Jonas 2004-04-27, 6:10 pm |
| I do the following to compile my application:
export
CLASSPATH=/usr/share/java-gnome/lib/gtk0.8.jar:/usr/share/java-gnome/lib/gnome0.8.jar:/usr/share/java-gnome/lib/glade0.8.jar:/usr/share/java-gnome/lib/gconf0.8.jar:/usr/share/java-gnome/lib/gnomevte0.8.jar:/usr/share/java-gnome/lib/gtkhtml0.8.jar
javac First.java
java First
Exception in thread "main" java.lang.NoClassDefFoundError: First/java
| |
| Chris Smith 2004-04-27, 7:11 pm |
| Geiregat Jonas wrote:
> I do the following to compile my application:
>
> export
> CLASSPATH=[...]
Your classpath doesn't contain the current working directory. So unless
you plan to put the compiled class file into one of those JAR files, you
need to add ".:" (quotes for clarity) to the beginning of your
CLASSPATH.
Better yet, copy all of those JAR files into JAVA_HOME/jre/lib/ext and
then forget the CLASSPATH environment variable entirely.
> javac First.java
> java First
> Exception in thread "main" java.lang.NoClassDefFoundError: First/java
As a second problem, that error message indicates that you're not typing
"java First" as you claim, but rather "java First.java". Remember that
the argument to the JRE is a class name, *not* a file name.
--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
| |
| Fahd Shariff 2004-04-28, 4:37 am |
| just add .: at the beginning of your CLASSPATH
| |
|
|
|
|
|