I created a Java project to call a Web service.
It has one Main java file and another class file.
I have used some jar files for HTTP client.
In Eclipse it runs fine.
I need to run the Java program in command prompt by passing some arguments.
In command prompt I went to src folder containing main java and sub class java file and gave the following command
javac mainjava.java
I’m getting following error
mainjava.java:14: cannot find symbol
symbol : class SubClass
here SubClass is my another java class file used to call the web service.
How to run the program by passing arguments?
javacis the Java compiler.javais the JVM and what you use to execute a Java program. You do not execute.javafiles, they are just source files.Presumably there is
.jarsomewhere (or a directory containing.classfiles) that is the product of building it in Eclipse:From directory
javaexecute: