<iframe align="center" marginwidth="0" marginheight="0" src="http://www.zealware.com/csdnblog336280.html" frameborder="0" width="336" scrolling="no" height="280"></iframe>
[When]
第一次使用Netbean 4.0/5.0开发程序的时候,用户可能在运行程序时,遇到下面这种报错,导致模拟器一闪而过:
正在通过存储根 DefaultColorPhone 来运行
域名不正确,请切换到 'untrusted'
java.lang.SecurityException: untrusted domain is not configured
at com.sun.midp.security.Permissions.forDomain(Permissions.java:530)
at com.sun.midp.dev.DevMIDletSuiteImpl.create(DevMIDletSuiteImpl.java:148)
at com.sun.midp.dev.DevMIDletSuiteImpl.create(DevMIDletSuiteImpl.java:91)
at com.sun.midp.main.Main.runLocalClass(Main.java:453)
at com.sun.midp.main.Main.main(Main.java:126)
Execution completed.
[HowTo]
可能导致的原因之一:
用户的Windows登录用户名是中文的,或者用户的程序路径中有中文。
原因之二:
Netbean中有相应的信任域的设置方式。可能用户没有设置。
建议用户在NetBean选中项目,然后右键à属性,找到运行, 然后配置一下里面的域,按照他说的选择untrusted。
[More Details]
“因为Netbean会在c:/document and settings/${username}/建一个.netbean的子目录,并将一些相关的属性与设定均建于该目录下,但由于Netbean使用简体中文,如果${username}是中文字,将因无法确认untrusted domain的路径而导致其认定错误。
修改方法:
在Netbean安装完且尚未执行前,先至 ” C:/Program Files/netbeans-5.0/etc” 下找netbeans.conf档,并于其中找到下列内容
# netbeans_default_userdir="${HOME}/.netbeans/5.0"
修改成netbeans_default_userdir="F:/prog/JAVA/.netbeans/5.0" 后,再启动netbean即可(上述目录可视需要改变,但建议最好为纯英文字)。
”
And
“
Understanding Protection Domains
A protection comprises two parts:
- Permissions which are allowed (granted to contained MIDlet suites), and permissions for which the user must be consulted
- Criteria for entry into the protection domain
When you click on the Run button in the J2ME Wireless Toolkit, the current MIDlet suite is run in a protection domain called Untrusted
. In this domain, the user is consulted for all permissions. That's why the emulator prompts you for permission when HTTPMIDlet
attempts its HTTP connection.
You can change the MIDlet suite's runtime protection domain by choosing Edit -> Preferences, then clicking on the Security tab:
Selecting a Protection Domain (Click for the full image.) |
The J2ME Wireless Toolkit includes four protection domains. MIDlets in the Minimum
domain are denied all permissions. The Untrusted
domain prompts the user for every permission. The Trusted
domain is a kind of MIDlet security nirvana where all permissions are granted; it's equivalent to Maximum
.
”
[Tips]
鉴于从C++开发,到Java开发,许许多多的人都遇到过类似的问题。所以我们强烈建议:
1:你的Windows用户名千万避免有中文字符;
2:你的程序运行路径或者工程路径或者组件注册路径,避免有中文字符;
3:作为一个专职开发者,请养成起英文文件夹名的好习惯;
分享到:
相关推荐
郭克华J2EE&J2ME笔记&安卓系统源码样例 郭克华J2EE&J2ME笔记&安卓系统源码样例 郭克华J2EE&J2ME笔记&安卓系统源码样例
Core J2ME Technology & MIDP
J2ME&MIDP核心技术
本书涉及在无线设备上使用j2me的设计程序,主要是游戏开发。本书作为对手机游戏开发有兴趣的读者来说是个快速的参考
j2me教程,比较基础,容易掌握,很容易上手,对初学者很有帮助。。
J2ME & Gaming
J2ME开发 J2ME开发 J2ME开发 J2ME开发
相当经典实在经典 看了就知道了
java做的j2me与j2ee进行交互 用手机客户端进行登录服务器,然后返回消息进行交互.
J2ME API J2ME API J2ME API J2ME API J2ME API
J2ME相关资源,介绍J2ME的相关基础知识,图片加载、网络连接问题、进度条相关问题
j2me入门教程j2me入门教程j2me入门教程j2me入门教程j2me入门教程
J2ME培训教程,以前学JJ2ME培训教程J2ME培训教程J2ME培训教程J2ME培训教程J2ME培训教程J2ME培训教程J2ME培训教程J2ME培训教程J2ME培训教程J2ME培训教程J2ME培训教程2ME发的一个PPT,内容还可以,需要的朋友不要客气J2ME...
J2ME游戏开发 J2ME游戏开发 J2ME游戏开发
j2me手机浏览器 j2me手机浏览器 j2me手机浏览器
j2me版A星寻路算法,适合RPG游戏中自动寻路...
J2ME小游戏J2ME小游戏J2ME小游戏J2ME小游戏J2ME小游戏J2ME小游戏
本书是J2ME移动游戏制作(主要是手机)的入门读物,只要你具备Java编程的基础知识,并了解一些J2ME得背景知识,通过本书的学习你就能制作出自己的游戏,I have a dream!It's "Play Games EveryWhere..." .
moto手机授权文件,用于在安装anyview,moto-txt等软件时进行授权,以使其能在l7 l71等型号手机上正常使用。
j2ME初学Demo j2ME demo j2me demo j2ME实例