How to compile Java programs by using command line

So, do you need to compile your Java code using the command line? Don’t worry, just follow type command and it will be very easy! // If we are in the root of the application javac -d ./bin -classpath /Applications/eclipse/servers/apache-tomcat-7.0.50/lib/servlet-api.jar src/com/base22/servlets/*.java -d: destination directory. In our example, the packages with bytecode will be generated into…

How to print Attributes enumeration in Java (javax naming directory Attributes)

This is only a little piece of code to print all the IDs and values of a javax.naming.directory.Attributes. If you want to know more about this interface, please see official documentation (http://docs.oracle.com/javase/7/docs/api/javax/naming/directory/Attributes.html), but here, you have a little explanation about it: This interface represents a collection of attributes. In a directory, named objects can have…