简体   繁体   English

在同一文件夹中包含JAR以保持一致性

[英]Including the JAR in the same folder to maintain consistency

I have the JAR files in Netbeans as follows: 我在Netbeans中具有以下JAR文件:

在此处输入图片说明

However, when I check in the Properties section after right clicking on the Netbeans Project, my sqljdbc4.jar is some what different from the other JAR files, I mean it's path is different, since I added it afterwards as shown in the image below: 但是,当我右键单击Netbeans Project后检查“属性”部分时,我的sqljdbc4.jar与其他JAR文件有所不同,我的意思是它的路径不同,因为我后来添加了它,如下图所示:

在此处输入图片说明

1) I have got a feeling that, since the path is different, I am not able to connect to SQL Server. 1)我有一种感觉,由于路径不同,因此无法连接到SQL Server。

2) Also, when I would have to send the whole project to someone, this relative path won't work I believe. 2)而且,当我不得不将整个项目发送给某人时,我认为这种相对路径是行不通的。 Is there a way, I can insert sqljdbc4.jar inside the src/bundle_includes folder just like the other ones? 有没有办法像其他方法一样将sqljdbc4.jar插入src/bundle_includes文件夹中? Please advise. 请指教。 I am using Netbeans 7.4 我正在使用Netbeans 7.4

It seems that when you have added the sqljdbc4.jar it was on the desktop, so Netbeans linked it letting your source code compile, but this don't include the jar into your src/bundle_includes . 看来,当您将sqljdbc4.jar添加到桌面上后,Netbeans对其进行了链接,以使您的源代码得以编译,但这并未将jar包含在src/bundle_includes

You should: 你应该:

  1. manually copy sqljdbc4.jar into src/bundle_includes 手动将sqljdbc4.jar复制到src/bundle_includes
  2. removing the sqljdbc4.jar with bad path from the Compile panel 从“编译”面板中删除路径错误的sqljdbc4.jar
  3. click Add JAR/Folder and choose src/bundle_includes/sqljdbc4.jar 单击添加JAR /文件夹,然后选择src/bundle_includes/sqljdbc4.jar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM