在 BlueJ 中添加库

Adding library in BlueJ

我想知道是否有办法在 blueJ 中添加引用库。在eclipse中,可以通过点击Build Path>> add external jar添加引用的库。你怎么能在 blueJ 中做到这一点?这是因为我想在 BlueJ 中使用其他库,例如 javax.mail、hibernate 和 log4j。

我没发现你的问题很清楚,但如果你问的是将库添加到 Java,我们应该使用关键字 import。例如,如果我想导入我使用的所有对象的库和 类:

import java.io.*;

希望你得到答案。

如果您只想在一个 class 中使用这些库 - 那么您可以将 .jar 文件移动到与项目文件相同的目录中,然后只需使用以下命令导入它们:

import simpleIO.*;

但是,如果您希望在多个项目中导入这些库,最好参考库位置而不是在每个 BlueJ 项目中复制。

Open "Preferences">"Libraries" - Then add the location where your classes are as a library path. Restart BlueJ - Now the selected libraries will now be available in all projects that you open.

http://www.bluej.org/faq.html#faq_How_do_I_use_custom_class_libraries__JARs__

转到工具 -> 首选项 -> 库 -> 添加文件 按确定并重新启动 BlueJ,您现在可以看到库已加载。

"One of my favourite IDEs out there is BlueJ"
— James Gosling,Java.

的创造者

https://www.bluej.org/

注意:我好像在Mac中找不到'Preferences'。在这种情况下,按 command+, 切换首选项 window。