RedRocket
RedRocket

Reputation: 1733

Adding library in BlueJ

I am wondering if there a way to add Referenced library in blueJ. In eclipse, you can add the referenced library by clicking Build Path>> add external jar. How can you do it in blueJ? It is because I would like to use other library such as javax.mail, hibernate, and also log4j in BlueJ.

Upvotes: 2

Views: 13893

Answers (4)

code2828
code2828

Reputation: 35

Note: it seems that I can't find 'Preferences' in Mac. In case of that, press command+, to toggle the preferences window.

Upvotes: 1

Tejas Badani
Tejas Badani

Reputation: 68

I didn't find your question clear, but if you are asking about adding a library into Java we should use the keyword import. For example if i want to import the libraries and classes of all objects I use:

import java.io.*;

Hope you got your answer.

Upvotes: 2

Viraj Singh
Viraj Singh

Reputation: 2358

Go to Tools -> Preferences -> Libraries -> Add file Press OK and restart BlueJ you can now see that library is loaded.

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

https://www.bluej.org/

Screenshot

Upvotes: 4

Tyler Dickson
Tyler Dickson

Reputation: 503

If you're looking for using those libraries in just one class - then you can move the .jar files into the same directory as the project file and then simply import them using:

import simpleIO.*;

However, if you are looking to import these libraries in multiple projects, it's better to reference the library locations rather than making copies in each BlueJ project.

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__

Upvotes: 0

Related Questions