Jump to content
Sign in to follow this  
pessantiago

correr um jar no cmd

Recommended Posts

pessantiago

boas estou a tentar a correr um jar na consola que me devolve para um ficheiro de texto dados do cartão do cidadão....estou a usar uma biblioteca ,jar

este é o nome da biblioteca pteidlibj,jar

java -cp test.jar main .; C:\pteidlibj.jar*

da me esse erro http://i.stack.imgur.com/aipEL.png

alguem que possa ajudar

import java.io.*;
import pteidlib.*;
public class main {
public String nome;
public String data;
public String pais;
public String sexo;
static {
 try {
	 System.loadLibrary("pteidlibj");
 } catch (UnsatisfiedLinkError e) {
	 System.err.println("Native code library failed to load.\n" + e);
	 System.exit(1);
 }
}
public void PrintIDData(PTEID_ID idData) throws FileNotFoundException, UnsupportedEncodingException {
 nome = idData.firstname + " " + idData.name;
 data = idData.birthDate;
 pais = idData.country;
 sexo = idData.sex;
 PrintWriter writer = new PrintWriter("the-file-name.txt", "UTF-8");
 writer.println(nome);
 writer.println(data);
 writer.close();
 System.out.print(nome);
}
//public void test(){
//System.out.println("test");
//}
public static void main(String[] args) throws UnsupportedEncodingException, FileNotFoundException, PteidException {
 main test = new main();
// test.test();
 pteid.Init("");
 pteid.SetSODChecking(false);
 int cardtype = pteid.GetCardType();
 switch (cardtype) {
	 case pteid.CARD_TYPE_IAS07:
		 System.out.println("IAS 0.7 card\n");
		 break;
	 case pteid.CARD_TYPE_IAS101:
		 System.out.println("IAS 1.0.1 card\n");
		 break;
	 case pteid.CARD_TYPE_ERR:
		 System.out.println("Unable to get the card type\n");
		 break;
	 default:
		 System.out.println("Unknown card type\n");
 }
 // Read ID Data
 PTEID_ID idData = pteid.GetID();
 if (null != idData) {
	 test.PrintIDData(idData);
 }
}
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.