Hi everyone
let's say i have a program in UNIX directory /home/me/java/src
I have manage to compile it successfully(class file will be in bin directory) using command below:
javac -d /home/t_bmf/java/bin HelloWorld.java
My problem now is how would I execute the class in bin directory in UNIX?
I already tried different ways on how to execute it as suggested in my internet research
The one I tried is this:
java $CLASSPATH:.:bin/HelloWorld
but I got this error message:
Exception in thread "main" java.lang.NoClassDefFoundError: :/:bin/HelloWorld
Caused by: java.lang.ClassNotFoundException: :.:bin.HelloWorld
at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 47)
Could not find the main class: :.:bin/HelloWorld. Program will exit.
Thank you for your Help!..