Saturday, September 22, 2018

Compile and Run Java Program From Sublime Text 3


Dear All,

Today, I am going to write about how you can compile and run your Java program from Sublime Text.

First, you need to set a Build System. To achieve it, follow below steps:
1) Goto Tools -> Build System  -> New Build System
2) A editor tab will open. Remove all predefined code and paste below code

{
    "shell_cmd": "javac $file_name && java $file_base_name",
    "working_dir": "${project_path:${folder}}",
    "selector": "source.java"
}

After pasting above code, save file with Java.sublime-build under sublime-text-3/Packages/User/.

Now, Goto Tools -> Build System and select Java (you will see new build after following above steps).

Now press Ctrl+B and enjoy the result. Please note that Ctrl+B is used to Build your program.

Enjoy coding with this lightweight software. Do comment if above post helps you.

Thanks.

Sunday, July 15, 2018

Difference Between Apache Common Logging and Log4J

Dear Folks,

Log4j is a logging framework, i.e. it provides the code to log messages while Commons-logging is an abstraction layer for logging frameworks, it doesn't log anything itself. For example if I write code using commons logging and deploy it on JBoss, the logging is done by log4j, but if I deploy it on WebSphere logging is done by WebSphere's own logging implementation. If I run the same code as a stand alone application it Java's own logging that is used.

Hope this help you in understanding the difference between two. 

Docker Tutorial

 I have listed all the necessary commands of Docker below. In case if any is missing or if any improvement required, please share in comment...