Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

User id and Group id of unix through the Java Program  RSS feed

 
Manimekala Velautham
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyway to get the uid and group id's of unix from a java program without using Runtime.getRuntime().exec() ?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's nothing in the standard APIs to do this. Java programs can call specially prepared 'C' language code directly using the Java Native Interface, JNI. You could write some C functions and invoke them from Java. Does that work for you?
 
Manimekala Velautham
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh ok.Thanks for your comments.Ya thru JNI it is working fine. I have checked. But for my codebase, it is better to use the Runtime.exec instead of JNI.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!