Forums Register Login

Why cant i run like "java filename.class"

1
+Pie Number of slices to send: Send
why cant i run a java program like java filename.class..
any reason for that???
+Pie Number of slices to send: Send
The javac command expects a filename because the compiler needs to convert a file from one format to another.

The java command doesn't expect a filename; instead, it expects the fully qualified name of a class (a name that unambiguously identifies a class in a Java application); because the application launcher needs to call the main method in the class. For example, com.xyz.Test.main(args).
+Pie Number of slices to send: Send
Thanks dude..
Let's get him boys! We'll make him read this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 786 times.
Similar Threads
inbuild classes shows only filename.class why ?
Setting Classpaths
Command Line
Deploy a servlet
Runs Only in Appletviewer
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:20:23.