Hi everyone!
I have a directories in UNIX:
/home/t_bmf/Java/HelloWorld/src/helloworld :will contain a .java file
/home/t_bmf/Java/HelloWorld/bin :will contain all .class file
let say a have a code:
a command to compile this even outside the directory /home/t_bmf/Java/HelloWorld/src/helloworld
javac -d /home/t_bmf/Java/HelloWorld/bin /home/t_bmf/Java/HelloWorld/src/helloworld/HelloWorld.java
this will generate a directory /home/t_bmf/Java/HelloWorld/bin/helloworld
and file inside this is HelloWorld.class
to run this program I must be in directory /home/t_bmf/Java/HelloWorld/bin and using this command:
java helloworld.HelloWorld
Question:
I already how to run the HelloWorld.class, but I must be in helloworld /home/t_bmf/Java/HelloWorld/bin
to run it.
Is there's a way to run the class even when I am not in directory /home/t_bmf/Java/HelloWorld/bin?
let's say I'm in /home/t_bmf, can I still run the HelloWorld.class?
Thank you so much!