java报错:listl cannot be cast toresolved to a variable

java中的错误 The import javax.interceptor cannot be resolved 这个怎么解决啊?_百度知道
java中的错误 The import javax.interceptor cannot be resolved 这个怎么解决啊?
提问者采纳
J2EE 开发时一般我们除了像在 Eclipse 创建一个普通项目之外还需要额外添加 J2EE 的 API 库,比如我们需要添加一个 Server Runtime,这个 Runtime 会带了 J2EE 开发所需要的 API,比如添加一个 WebSphere Application Server V7 或 JBoss v7 什么的。如图我添加了一个 JBoss,它就有一些 J2EE 的 API 了。注意你少的是一个 EJB 3.0+ 的类,那个服务器至少要支持 EJB 3.0.
提问者评价
其他类似问题
javax的相关知识
按默认排序
其他3条回答
不能导入javax.interceptor,未找到
包未被导入, 所以不认识javax.interceptor
应该是有些包未被引入
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁JAVA 中“Scanner cannot be resolved to a type”是什么错误_百度知道
JAVA 中“Scanner cannot be resolved to a type”是什么错误
提问者采纳
import java.util.*;
//最上面打入这行代码public class ifelse { /**
* @param args
*/ public static void main(String[] args) {
路径,程序编辑错误。
其实归根结底还是java的环境没有设置好,我也不知道是什么原因,我只安装了sun的java6.0,可系统里提供java运行环境却有好几个(可能是系统更新时不知不觉的给装上别的了),如果用update-alternatives --config java 命令设置不行,只有手工的把其他版本的java程序给删掉,再设置一下一些链接文件才搞定。
其他类似问题
按默认排序
其他3条回答
可能是你的Scanner类所在的包没有引入吧,你把代码贴出来看看就知到了
包没有引用吧。。import java.util.S
你没引入包吧, Scanner这个类在java.util.*里面
scanner的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁现在的位置:
android Toast报错 Activity context.this cannot be resolved to a variable...
android开发,我在我的 activity 插入一个按钮,如果andriod market找不到的话就使用 toast进行提示,在使用的时候出现了一些问题,下面的代码报错了 Context cannot be resolved to a variable
Uri uri = Uri.parse("market://details?id=" + getApplicationContext().getPackageName());
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
Toast.makeText(Activity.this, "Couldn't launch the market", Toast.LENGTH_LONG).show();
我试过如下调用
Toast.makeText(this, "Couldn't launch the market", Toast.LENGTH_LONG).show();
然后开发工具提示 The method makeText(Context, CharSequence, int) in the type Toast is not applicable for the arguments (new View.OnClickListener(){}, String, int)
我以前这么使用没有问题,不明白现在怎么就不行了
你过你继承了Activity,就使用下面的2个方式
Toast.makeText(ClassName.this, "Couldn't launch the market",Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), "Couldn't launch the market",Toast.LENGTH_LONG).show();
如果你的类继承了 Fragment ,就使用下面的方式
Toast.makeText(getActivity(), "Couldn't launch market",Toast.LENGTH_LONG).show();
原文地址:/.html (/.html%20)
该文章由 萌萌的IT人(/) 整理发布,转载须标明出处。
转载时请保留本文出处,谢谢您的合作
上一篇: &&下一篇:

我要回帖

更多关于 pathvariable 的文章

 

随机推荐