Tag: java

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 […]

Read More

How to create a JAR file by using command line

This is only a single post about how to create a JAR file using command line easily. Previously, you need to compile your Java files, if you want to read more about it, please see this post: How to compile Java programs by using ┬ácommand line. If we need to create a JAR file, we […]

Read More

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 […]

Read More