initial connection of c and java layer