Saturday, June 18, 2016

Error Oracle Database 12c installation for IAM Oracle


Hello my friends,


If you run into the error "error invoking target irman ioracle of makefile" while trying to install Oracle Database, and the log shows a missing ljavavm12 library, you might need to copy the java library like so:



cp /opt/oracle/product/12.1.0/dbhome_2/javavm/jdk/jdk6/lib/libjavavm12.a /opt/oracle/product/12.1.0/dbhome_2/lib/


I hope it helps,
Thiago Guimaraes

Saturday, June 4, 2016

How to get details from current machine in java using JNA(Java Native Access)

hello Folks,

[Java - Coding time]


  • How to get details from current machine in java.

More about JNA:

Java Native Access (JNA)

To use Windows and the domain controller for authentication, we can use native Windows APIs. To call those APIs in Java, we can use the Java Native Access (JNA) library, which you can find on GitHub at https://github.com/twall/jna and on Maven central:

[Libs]


[Source Code]


/**
 *
 */
package thiago.leoncio;

import java.net.UnknownHostException;
import com.sun.jna.platform.win32.Advapi32Util;
import com.sun.jna.platform.win32.Advapi32Util.Account;

/**
 * @author THiago
 * @Date 06/04/2016
 * @Description: How to get details from current machine.
 * @libs for JNA(jna.jar;jna-min.jar;jna-platform.jar)
 */
public class MachineDetails {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub

System.getProperty("user.name"); //platform independent
java.net.InetAddress localMachine = null;
try {
localMachine = java.net.InetAddress.getLocalHost();
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("Hostname of local machine: " + localMachine.getHostName());
System.out.println("UserName logged on your machine:" +System.getProperty("user.name"));
System.out.println("=========== Java Native Access (JNA) details ===========");
for(Account account: Advapi32Util.getCurrentUserGroups()){
       System.out.println(account.fqn);
    }

}

}




[Output]:
Hostname of local machine: TLEONCIO_LAPTOP
UserName logged on your machine: tleo73638
=========== Java Native Access (JNA) details ===========
WST\domain users
Everyone
BUILTIN\Administrators
BUILTIN\Users
NT AUTHORITY\INTERACTIVE
CONSOLE LOGON
NT AUTHORITY\Authenticated Users
NT AUTHORITY\This Organization
..

Please, see this JNA and Waffle article also:  http://phonecoding.com/2016/10/how-to-use-waffle-library-for-jna-java.html



happy coding,
--Thiago