error: cannot find symbol. Running java class with packages through cmd -


i have java application test. inside have 2 java files. a.java:

import javax.servlet.genericservlet; public class {     genericservlet inter; } 

to compile used:

javac -cp servlet-api.jar a.java 

it compiled successfully. java file b.java:

import javax.servlet.genericservlet; public class b {     genericservlet inter;     a = new a(); } 

when try use:

javac -cp servlet-api.jar b.java 

i following error:

error: cannot find symbol. a = new a(); ^ symbol: class location: class b 

p.s: please ignore name of classes & jar files involved demo purpose only.

use

javac -cp x.jar;. b.java 

to include current directory in classpath, should work.


Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

c++ - Can not find the "fiostream.h" file -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -