How to get the current working directory in Java?

Code : This will print the absolute path of the current directory from where your application was initialized. Explanation: From the documentation: java.io package resolve relative pathnames using current user directory. The current directory is represented as system property, that is, user.dir and is the directory from where the JVM was invoked.

javax.naming.NameNotFoundException

I am getting the error (…) javax.naming.NameNotFoundException: greetJndi not bound This means that nothing is bound to the jndi name greetJndi, very likely because of a deployment problem given the incredibly low quality of this tutorial (check the server logs). I’ll come back on this. Is there any specific directory structure to deploy in JBoss? The internal structure … Read more

How can I check whether an array is null / empty?

There’s a key difference between a null array and an empty array. This is a test for null. “Empty” here has no official meaning. I’m choosing to define empty as having 0 elements: An alternative definition of “empty” is if all the elements are null: or

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)