Add pre-builded functionalities in Eclipse for Java

This is a key process in Java IMHO that I didn't manage to find entirely on the Internet until I realised how to do it. You may jump to the number you are struggled with. Import Java classes from Apache, etc

1.- Identify our programming needs to solve. E.G.: replace accents on the go.


2.- Search what we need to do with Java on a browser. This gives us keywords for "3.-". E.G. search replace string accents library java apache

  

If it's not in the default java libraries that we may be importing automatically in our .java code:
3.- Import that solution (download a .jar containing it), because you always must have its library.

     

4.- Add it to your project reference libraries:
- Select something in the Eclipse package explorer. E.G. for Windows: Ctrl+A (select all), F5 (refresh).
- Right click the new jar file, and select Build Path -> Add to Build Path.


5.- Import the library as usual. E.G.: add import org.apache.commons.lang3.StringUtils; to your .java.


6.- Adapt your new functionalit(y/ies).


Hope it helps not only me :)

No hay comentarios: