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

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -