黑莓:使用库项目作为外部JAR时Verificattion错误 [英] Blackberry: Verificattion error when using Library project as External Jar

查看:130
本文介绍了黑莓:使用库项目作为外部JAR时Verificattion错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在黑莓Java插件为Eclipse,即<​​STRONG> MyProjectApp (设置为应用程序的项目),并创建了两个项目的黑莓手机的 MyProjectLib (设置为库项目)。我现在已经创建了一个简单MainScreen类象下面这样:

I have created two Blackberry project in Blackberry Java Plug-in for Eclipse, i.e. MyProjectApp(set as application project) and MyProjectLib(set as Library project). Now I have created a simple MainScreen class like below:

public class SampleScreen  extends MainScreen {

    public SampleScreen (){
        RichTextField topbar = new RichTextField("hello world");
        add(topbar);
    }

}

现在我出口MyProjectLib为Jar文件和MyProjectApp添加相同的外部罐。现在,我想用这个来触发SampleScreen:

Now I export MyProjectLib as Jar file and add the same in MyProjectApp as external Jar. Now I want to fire the SampleScreen using this:

public class MyProjectMain extends UiApplication{

     public static void main(String[] args) {

         MyProjectMain theApp = new MyProjectMain();       
        theApp.enterEventDispatcher();
    }

    public LangHostMain(){        
        // Push a screen onto the UI stack for rendering.
         pushScreen(new SampleScreen());
    }

}

这是给以下错误:

It is giving following error:

模块'MyProjectApp'有验证错误。
开始MyProjectApp错误:模块'MyProjectApp'有验证错误

但是,如果我移动SampleScreen类MyProjectApp,它工作正常。什么是出口的Jar并使用它的问题?需要什么类型的核实呢?

But if I moved the SampleScreen class to MyProjectApp, it is working fine. What is problem in exporting the Jar and use it? What type of Verification is needed?

推荐答案

有一个工具preverify.exe;它确保字节code是与黑莓平台兼容。

There's a tool preverify.exe; it makes sure that bytecode is compatible with the BlackBerry platform.

黑莓RAPC编译器使用Java 1.3的字节code画幅时,编译应用程序到鳕鱼的文件。

BlackBerry rapc compiler uses java 1.3 bytecode format when it compiles the application to a cod file.

如果您通过用javac 7.0版编译创造了不同的字节code格式的jar文件,例如,那么这个jar文件将无法通过验证。

If you have created your jar file in different bytecode format, for instance via compiling with javac version 7.0, then this jar file won't pass the verification.

尝试编译您的jar文件与关键,使其与VM 1.3字节code,

Try to compile your jar file with key to make it compatible with VM 1.3 bytecode,

使用 -target 1.3 键 - 值组合Java编译器来构建你的jar文件。

Use -target 1.3 key-value combination for the java compiler to build your jar file.

这篇关于黑莓:使用库项目作为外部JAR时Verificattion错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆