running java application from command line -
I have an eclipse project which I want to run from the command line in Ubuntu, after searching on the Internet, I am trying.
java-cp Com.abc.utils.MyClassName
I release this command from the directory that eclipses all the class files I'm using this but I get this error:
"main" java.lang.NoClassDefFoundError: com / abc / utils / MyClassName
What am I doing wrong in the exception and how to run the application from the command line?
Your order is correct You missed something Please check that
1. You have compiled your code and have been created in the MyClassName.class
file classes / com / abc / utils /
directory.
2. You are running this command from the proper directory. Your current directory should be a class directory where your com
directory is located. If not, switch to classes
directory
$ cd / path / to / project / folder / classes /
This helps.
In addition to this, if you want to learn how the eclipse automatically transfers the .class
and .java
Try compiling multi-package applications.
$ javac -d
will be helpful.
Comments
Post a Comment