在NetBeans中编译问题 [英] Compiling issue in NetBeans

查看:456
本文介绍了在NetBeans中编译问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在NetBeans中创建了一个项目,通过下载Bouncy城​​堡的一些第三方jar来提供一些java密码API。我还下载了souce代码,并将它们放在src文件夹下的包名称。然而,我在我的项目中有几个java文件显示为红色的错误。这里有一个如 -

I have created a project in NetBeans by downloading some third party jars of Bouncy castle, which provides some java cryptography API's. I have also downloaded the souce code and put them under the src folder as per package name. However a few java files which I have in my project are showing in red with errors. here is one such as --

getparams() in org.bouncycastle.jce.provider.JCEECPrivateKey cannot implement 
               getParams() in rg.bouncycastle.jce.interfaces.ECKey
found : java.security.spec.ECParameterSpec
required: rg.bouncycastle.jce.ECParameterSpec

但奇怪的部分是,当我实际从NetBeans编译代码时,编译成功,并创建最终的jar文件。但是,编译说明如下:

But the strange part is that when I actually compile the code from NetBeans , compilation is successful and the final jar file got created. However, the compilation says the following :

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

我的问题是:为什么编译通过,即使一些文件似乎有错误?

My questions are : Why is the compilation going through even though some files seem to have errors? Can I ignore these as benign?

如何在NetBeans中使用-Xlint编译,因为我通过点击项目和Clean and Build选项进行编译。

How to compile with -Xlint in NetBeans because I am compiling by clicking in the project and Clean and Build option.

推荐答案

看起来你有一个命名冲突。您可能有

It looks like you have a naming conflict. You probably have

import java.security.spec.*;
import rg.bouncycastle.jce.*;

但是这两个包都定义 ECParameterSpec
如果这是你的问题,你可以使用 rg.bountycaslte.jce.ECParameterSpec myvar = ... 显式定义你的变量类型,或者你可以添加一个import语句 import rg.bouncycastle.jce.ECParameterSpec; 以指定您真正想要的。

but both packages define ECParameterSpec. If that is your problem, you can either define your variable type explicitly with rg.bountycaslte.jce.ECParameterSpec myvar = ... or you can add an import statement import rg.bouncycastle.jce.ECParameterSpec; to specify which one you really want.

这篇关于在NetBeans中编译问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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