0
votes

Actually, he cannot find java.io.

It recognizes import java.io.*; import java.io.IOException;

but when I try InputStream = this.getClass().getResourceAsStream("users.xml");, i get the following error:

C:\Users\cpantaziu\Documents\NetBeansProjects\url\src\main\java\com\mkyong\common\controller\FailRegisterController.java:[120,12] cannot find symbol symbol : variable InputStream.

Tools -> Java Platforms ses my jdk 1.6.

Why am I getting this?

2
When You write code like above, netbeans does not mark it in red? - tostao

2 Answers

3
votes

you have to assign a reference variable:

InputStream ref= this.getClass().getResourceAsStream("users.xml");
2
votes

You must name a variable:

InputStream is = this.getClas()...