Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

manasi belhe

+ Follow
since Jun 21, 2011
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by manasi belhe

hmm... ok i understand now... thanks....
but i was trying the MooseGreetings program from the tutorial and there is a small problem
the program runs and i get the mooooooooooo output as well but it was given in the tutorial about the classpath command...

this is what was expected:
C:\java\src>java classpath . MooseGreetings

but i got this:
C:\Java\src>java MooseGreetings
C:\Java\src>java classpath.MooseGreetings
Exception in thread "main" java.lang.NoClassDefFoundError: classpath/MooseGreetings
Caused by: java.lang.ClassNotFoundException: classpath.MooseGreetings
at$ Source)
at Method)
at Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: classpath.MooseGreetings. Program will exit.

i mean i get the moooooooo which means the program is getting compiled but why am i getting this error about classpath?
actually i am really not sure what does the classpath command do?

p.s. this may be a stupid question but i am very much new to java and i have just started.... thank you so much for helping me... i may come up with even stupider questions but please help me out..
9 years ago
ok... i get this when i type just 'java' :

Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)

where options include:
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is client.

-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
set a system property
enable verbose output
-version print product version and exit
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
enable assertions
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
load native agent library by full pathname
load Java programming language agent, see java.lang.instrument

show splash screen with specified image

... i dont understand what this actually means.

and the path environment variable is
C:\Program Files\PC Connectivity Solution\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Java\jdk1.6.0_17;C:\Java\jdk1.6.0_17\bin;C:\glassfishv3\glassfish;C:\glassfishv3\glassfish\bin;D:\mysql\bin;D:\softwares.

well actually java was installed in my computer earlier by my brother. i was just trying to run a program in java... but i dont know what my brother has done to the path variable its way to much longer... and he is not around to tell me... and when i tried to check whether java is configured or not i got the errors as explained in previous message.

so is java actually configured or not?
9 years ago
hi... i am very much new to java and i am facing the exact same problem that Scott had... i have tried everything that you guys suggested but it still does not work. whether i type 'java-version' or 'javac-version' i get that it is not recognized as an internal or external command, operable program or batch file.
i do get something complicated when i type just java.
please help me out.. i have just started and it is sad to stumble on my first step....
9 years ago