Java command terminal -


alright trying run java file it's not doing want terminal.

i have main directory called packagetester.

packagetester contains src , bin

src has packagea packageb

pacakgea has helloa.java packageb has hellob.java

bin has class files

bin has packagea packageb

pacakgea has helloa.class packageb has hellob.class

to compile files used following command when in pacakagetester directory: javac -d bin -sourcepath source src/package*/* , works !

now how run hellob.class contains main method , has object of helloa.

i thought when @ packagetester directory, can do: java bin/packageb/hellob not work because cannot seem find .class file. appreciated figure out how execute file correctly

the root of bin should in classpath in order packageb.hellob found packageb/hellob.class while parsing classpath.

the easiest way change directory bin , execute java packageb.hellob there.

alternatively, can execute java -cp bin packageb.hellob packagetester directory, or somewhere else if replace bin absolute path.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -