Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

sharing my jar utility with selected buddies only ?



I have made some general utilities(jars) for my project, which i have to display with my team in class for a competetion. I am sharing my stuff with my team-mates, but afraid they don't re-distribute it to other team's members due to their personal relations before the competetion.

Is their something in java as described in the following code for my jar's class files.

public class UtilityClass{

static{

long secretCode = 7534759 ;
//a hardcoded long value (hardcoded by me for my friend)
//related to friend's Computer System which either
// don't changes untill he reformats his computer
// or is something like motherboard serial number or etc..etc...
 
long buddiesSystemSecretCode = getSecretCode() ;

if( !(buddiesSystemSecretCode == secretCode) ){
System.exit(1) ;
}
}

private static long getSecretCode(){
long secretCode = 0 ;

//any java code to get friend's System hardware specific code

return secretCode ;
}
}