How to run a java program with multiple classes and packages from command line? -


at moment looking way run java program command line, other adding jar file. program has following number of classes:

the name of program file - myprogram
main class - server1
second class - client handler
package name - items
3rd class - user1
4th class - user2

the main class , client handler alongside package have run first in order user 1 & user 2 run, because client classes , dependent on main class.

run java classname. long .class files there java find them. watch out when usin packages, should run java package root , type class name prefixed right package.

if have jar files need should specify them -classpath when running java.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -