Compiling java card with Eclipse

Hi,
I compiled and converted Java card code both from the command prompt and Eclipse in Windows XP and it worked just fine.
However, while doing the same in Eclipse set up on a Linux(Ubuntu) machine, I am getting the following error:
error: export file framework.exp of package javacard.framework not found.
I have been searching around for answers to why this might be happening. However, I haven't found any. If anyone knows why, please help me out with this.
Thanks a lot in advance.
Best,

Are you converting with an Eclipse plugin? If so what are you using?
That error is because the converter can't find the EXP files from the JCDK. You may need to update a setting in the plugin to point to the JCDK.
Cheers,
Shane

Similar Messages

  • Verify user pin on a smart card & load a cap file on a card (with eclipse)

    I have been able install JCWDE (Java card development Kit) successfully on eclipse.Basically all I need to do is verify user pin on a smart card.As in first set a pin and then verify it.
    To begin with I have referred many tutorials (here: http://www.javaworld.com/jw-07-1999/jw-07-javacard.html?page=1) and implemented the wallet code in eclipse.I have the cap file generated and the scripts generated.I am not sure how to load it on the smart card with eclipse.
    I tried to deploy the cap file but it keeps saying connected.Also when we initiate the applet I get the same result.
    output:
    Java Card 2.2.2 APDU Tool, Version 1.3
    Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    Opening connection to localhost on port 9032.
    Connected.
    I have also tried : http://www.cs.ru.nl/E.Poll/hw/practical.html ........ but no luck.
    I have the wallet.cap ,wallet.exp ,wallet.jca ,wallet.opt create.script, select,cap-download.scripts files already generated in eclipse.
    How does a successfully implemented applet code on a smart card work?How does this wallet code work if it is successfully implemented ? Does it have like some GUI which prompts the user to enter the pin?
    Wallet code for reference :
    package com.sun.javacard.samples.wallet;
    import javacard.framework.*;
    public class Wallet extends Applet {
    /* constants declaration */
    // code of CLA byte in the command APDU header
    final static byte Wallet_CLA =(byte)0x80;
    // codes of INS byte in the command APDU header
    final static byte VERIFY = (byte) 0x20;
    final static byte CREDIT = (byte) 0x30;
    final static byte DEBIT = (byte) 0x40;
    final static byte GET_BALANCE = (byte) 0x50;
    // maximum balance
    final static short MAX_BALANCE = 0x7FFF;
    // maximum transaction amount
    final static byte MAX_TRANSACTION_AMOUNT = 127;
    // maximum number of incorrect tries before the
    // PIN is blockedd
    final static byte PIN_TRY_LIMIT =(byte)0x03;
    // maximum size PIN
    final static byte MAX_PIN_SIZE =(byte)0x08;
    // signal that the PIN verification failed
    final static short SW_VERIFICATION_FAILED =
    0x6300;
    // signal the the PIN validation is required
    // for a credit or a debit transaction
    final static short SW_PIN_VERIFICATION_REQUIRED =
    0x6301;
    // signal invalid transaction amount
    // amount > MAX_TRANSACTION_AMOUNT or amount < 0
    final static short SW_INVALID_TRANSACTION_AMOUNT = 0x6A83;
    // signal that the balance exceed the maximum
    final static short SW_EXCEED_MAXIMUM_BALANCE = 0x6A84;
    // signal the the balance becomes negative
    final static short SW_NEGATIVE_BALANCE = 0x6A85;
    /* instance variables declaration */
    OwnerPIN pin;
    short balance;
    private Wallet (byte[] bArray,short bOffset,byte bLength) {
    // It is good programming practice to allocate
    // all the memory that an applet needs during
    // its lifetime inside the constructor
    pin = new OwnerPIN(PIN_TRY_LIMIT, MAX_PIN_SIZE);
    byte iLen = bArray[bOffset]; // aid length
    bOffset = (short) (bOffset+iLen+1);
    byte cLen = bArray[bOffset]; // info length
    bOffset = (short) (bOffset+cLen+1);
    byte aLen = bArray[bOffset]; // applet data length
    // The installation parameters contain the PIN
    // initialization value
    pin.update(bArray, (short)(bOffset+1), aLen);
    register();
    } // end of the constructor
    public static void install(byte[] bArray, short bOffset, byte bLength) {
    // create a Wallet applet instance
    new Wallet(bArray, bOffset, bLength);
    } // end of install method
    public boolean select() {
    // The applet declines to be selected
    // if the pin is blocked.
    if ( pin.getTriesRemaining() == 0 )
    return false;
    return true;
    }// end of select method
    public void deselect() {
    // reset the pin value
    pin.reset();
    public void process(APDU apdu) {
    // APDU object carries a byte array (buffer) to
    // transfer incoming and outgoing APDU header
    // and data bytes between card and CAD
    // At this point, only the first header bytes
    // [CLA, INS, P1, P2, P3] are available in
    // the APDU buffer.
    // The interface javacard.framework.ISO7816
    // declares constants to denote the offset of
    // these bytes in the APDU buffer
    byte[] buffer = apdu.getBuffer();
    // check SELECT APDU command
    if (apdu.isISOInterindustryCLA()) {
    if (buffer[ISO7816.OFFSET_INS] == (byte)(0xA4)) {
    return;
    } else {
    ISOException.throwIt (ISO7816.SW_CLA_NOT_SUPPORTED);
    // verify the reset of commands have the
    // correct CLA byte, which specifies the
    // command structure
    if (buffer[ISO7816.OFFSET_CLA] != Wallet_CLA)
    ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
    switch (buffer[ISO7816.OFFSET_INS]) {
    case GET_BALANCE:
    getBalance(apdu);
    return;
    case DEBIT:
    debit(apdu);
    return;
    case CREDIT:
    credit(apdu);
    return;
    case VERIFY:
    verify(apdu);
    return;
    default:
    ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
    } // end of process method
    private void credit(APDU apdu) {
    // access authentication
    if ( ! pin.isValidated() )
    ISOException.throwIt(SW_PIN_VERIFICATION_REQUIRED);
    byte[] buffer = apdu.getBuffer();
    // Lc byte denotes the number of bytes in the
    // data field of the command APDU
    byte numBytes = buffer[ISO7816.OFFSET_LC];
    // indicate that this APDU has incoming data
    // and receive data starting from the offset
    // ISO7816.OFFSET_CDATA following the 5 header
    // bytes.
    byte byteRead =
    (byte)(apdu.setIncomingAndReceive());
    // it is an error if the number of data bytes
    // read does not match the number in Lc byte
    if ( ( numBytes != 1 ) || (byteRead != 1) )
    ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
    // get the credit amount
    byte creditAmount = buffer[ISO7816.OFFSET_CDATA];
    // check the credit amount
    if ( ( creditAmount > MAX_TRANSACTION_AMOUNT)
    || ( creditAmount < 0 ) )
    ISOException.throwIt(SW_INVALID_TRANSACTION_AMOUNT);
    // check the new balance
    if ( (short)( balance + creditAmount) > MAX_BALANCE )
    ISOException.throwIt(SW_EXCEED_MAXIMUM_BALANCE);
    // credit the amount
    balance = (short)(balance + creditAmount);
    } // end of deposit method
    private void debit(APDU apdu) {
    // access authentication
    if ( ! pin.isValidated() )
    ISOException.throwIt(SW_PIN_VERIFICATION_REQUIRED);
    byte[] buffer = apdu.getBuffer();
    byte numBytes =
    (byte)(buffer[ISO7816.OFFSET_LC]);
    byte byteRead =
    (byte)(apdu.setIncomingAndReceive());
    if ( ( numBytes != 1 ) || (byteRead != 1) )
    ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
    // get debit amount
    byte debitAmount = buffer[ISO7816.OFFSET_CDATA];
    // check debit amount
    if ( ( debitAmount > MAX_TRANSACTION_AMOUNT)
    || ( debitAmount < 0 ) )
    ISOException.throwIt(SW_INVALID_TRANSACTION_AMOUNT);
    // check the new balance
    if ( (short)( balance - debitAmount ) < (short)0 )
    ISOException.throwIt(SW_NEGATIVE_BALANCE);
    balance = (short) (balance - debitAmount);
    } // end of debit method
    private void getBalance(APDU apdu) {
    byte[] buffer = apdu.getBuffer();
    // inform system that the applet has finished
    // processing the command and the system should
    // now prepare to construct a response APDU
    // which contains data field
    short le = apdu.setOutgoing();
    if ( le < 2 )
    ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
    //informs the CAD the actual number of bytes
    //returned
    apdu.setOutgoingLength((byte)2);
    // move the balance data into the APDU buffer
    // starting at the offset 0
    buffer[0] = (byte)(balance >> 8);
    buffer[1] = (byte)(balance & 0xFF);
    // send the 2-byte balance at the offset
    // 0 in the apdu buffer
    apdu.sendBytes((short)0, (short)2);
    } // end of getBalance method
    private void verify(APDU apdu) {
    byte[] buffer = apdu.getBuffer();
    // retrieve the PIN data for validation.
    byte byteRead = (byte)(apdu.setIncomingAndReceive());
    // check pin
    // the PIN data is read into the APDU buffer
    // at the offset ISO7816.OFFSET_CDATA
    // the PIN data length = byteRead
    if ( pin.check(buffer, ISO7816.OFFSET_CDATA,
    byteRead) == false )
    ISOException.throwIt(SW_VERIFICATION_FAILED);
    } // end of validate method
    } // end of class Wallet
    Any help on this would highly appreciated !! :)

    Hi,
    Thanks a lot for reply.But I am not sure as to how can I delete the simulator.
    All I want to do is write a pin on the smart card and verify it.But I am not being able to deploy the cap file or initiate the applet.
    Also for passing the pin correct me if I am wrong........ according to what you said and what I have understood
    If the code is like this :
    public static void install(byte[] bArray, short bOffset, byte bLength) {
    // create a Wallet applet instance
    new Wallet(bArray, bOffset, bLength);
    } // end of install method
    byte aLen = bArray[bOffset]; // applet data length
    // The installation parameters contain the PIN
    // initialization value
    pin.update(bArray, (short)(bOffset+1), aLen);
    Lets say my pin is : 1234
    then I would pass it here.....
    new Wallet(bArray, 1234, bLength);

  • Need help for equipments for java card with RFID technology .

    I 'm doin a project using java card with RFID technology.Can ne one give me exact equipments for java card reader & writer for RFID technology?
    I need to buy these things from UK.Can ne one provide me some product list & as well as the exact pricelist?
    plz reply me asap.

    I 'm doin a project using java card with RFID
    technology.Can ne one give me exact equipments for
    r java card reader & writer for RFID technology?I guess with "RFID" you are referring to "contact-less javacards"?
    If yes, one keyword for you is "Mifare", a industry standard for smartcards with dual interface (contact-based and contactless).
    Jan

  • Compilation's problems with eclipse

    hello
    in working for my thesis with eclipse I have see that the modify to source code have not effect in runt-time
    In effect I have an file .class, I modify the source file .java, I compile and i go this in run with the Eclipse command <<run>> but the behavior not change.
    I don't lie because i appnd a
    system.out
    to main of a class and in run-time the print is'nt.
    What's appened?
    I not remober about modify about Eclipse's configuration ????
    What do you think??
    thank for every feed-back
    Alessandro Puzielli

    Ehm...
    I use Eclipse over Linux.. I have runned Eclipse as
    "root" a few of day ago and Eclipse's behaviort was
    ok. After I have lanched Eclipse as normal user and
    in effect I try to overwriter the *class of root and
    it's impossible!it's normal 'cause you don't have the permissions on the project files
    I have take a few of day for the understand the
    problem with a
    $ stat name_of_file_.classThanks for the responses!so if your project is a small project, start Eclipse as normal user and rewrite your project ! otherwise, log u as root and give you all the permission on the project and it may work (chmod 777 -R project_path)
    peace
    fred

  • Generate DES key with java card with JCRE 2.1.2

    Hi everyone,
    I want to generate DES key in my applet . my card supports GP 2.0.1 and JCRE 2.1.2 .
    I have tested my applet with JCRE 2.2.1 and used this JCSystem class functions to generate DES key and it compiles and works correctlly .
    but when I want to compile my applet with JCRE 2.1.2 I recieve an error which says that API 2.1.2 doesn't support JCSystem class .
    so I'll really appreciate it if anyone could tell me how can I generate DES key with JCRE 2.1.2
    and also I use JCSystem class functions to get my card's persistent and transistent memory , so with this class not working on JCRE 2.1.2 I have problem to read my free memories too .
    So I'll appreciate your help on this matter too.
    Best Regards,
    Vivian

    Hi Vivian,
    I don't seem to have any problem with the code you posted. What is the error you are getting? Is it with the compiler or with the CAP file converter? If it is a compiler error, you will need to ensure that the Java Card API jar is in your build path.
    Here is a simple class that works with JC 2.1.1 (which will work with JC 2.1.2 as well). I have confirmed that this applet compiles and will return encrypted data to the caller.
    package test;
    import javacard.framework.APDU;
    import javacard.framework.Applet;
    import javacard.framework.ISO7816;
    import javacard.framework.ISOException;
    import javacard.framework.JCSystem;
    import javacard.security.DESKey;
    import javacard.security.KeyBuilder;
    import javacard.security.RandomData;
    import javacardx.crypto.Cipher;
    * Test JC2.1.1 applet for random DES key.
    * @author safarmer - 1.0
    * @created 24/11/2009
    * @version 1.0 %PRT%
    public class TestApplet extends Applet {
        private DESKey key;
        private Cipher cipher;
         * Default constructor that sets up key and cipher.
        public TestApplet() {
            RandomData rand = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);
            short lenBytes = (short) (KeyBuilder.LENGTH_DES / 8);
            byte[] buffer = JCSystem.makeTransientByteArray(lenBytes, JCSystem.CLEAR_ON_DESELECT);
            key = (DESKey) KeyBuilder.buildKey(KeyBuilder.TYPE_DES, KeyBuilder.LENGTH_DES, false);
            rand.generateData(buffer, (short) 0, lenBytes);
            key.setKey(buffer, (short) 0);
            cipher = Cipher.getInstance(Cipher.ALG_DES_CBC_ISO9797_M1, false);
        public static void install(byte[] bArray, short bOffset, byte bLength) {
            // GP-compliant JavaCard applet registration
            new TestApplet().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
        public void process(APDU apdu) {
            // Good practice: Return 9000 on SELECT
            if (selectingApplet()) {
                return;
            byte[] buf = apdu.getBuffer();
            switch (buf[ISO7816.OFFSET_INS]) {
                case (byte) 0x00:
                    cipher.init(key, Cipher.MODE_ENCRYPT);
                    short len = cipher.doFinal(buf, ISO7816.OFFSET_CDATA, buf[ISO7816.OFFSET_LC], buf, (short) 0);
                    apdu.setOutgoingAndSend((short) 0, len);
                    break;
                default:
                    // good practice: If you don't know the INStruction, say so:
                    ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
    }Cheers,
    Shane

  • I dont install the wallet sample to java card with gpshell . help please .?

    Hi
    I use Gemalto pc twin Reader.
    I try jdks(1.3.5 , 1.5 , 1.6 versions) for compile
    I use java card kit (2.1.1 , 2..1.2 , 2.2.1 ,2.2.2 versions) for create cap files
    For loadin used gpshell (1.4.2 , 1.4.1 , 1.3.1 versions)
    script
    enable_trace
    establish_context
    card_connect
    select -AID a0000000030000
    open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f // Open secure channel
    install_for_load -pkgAID a00000006203010C06 -nvCodeLimit 500 -sdAID A000000003000000
    load -file wallet.cap
    install_for_install -priv 02 -AID a00000006203010C0601 -pkgAID a00000006203010C06 -instAID a00000006203010C0601 -nvDataLimit 500
    get_status -element 20                                   
    card_disconnect
    release_context
    I didnt load wallet applet to card. Some time I take install_for_load error , some time install_for_install_and_make_selectable()
    Please help me.
    With jdk 1.3_5 , java card dev kit 2.1.2 and gpshell , I load applet to card but dont install and I take install_for_install_and_make_selectable returns 0x80206A80 (6A80 : Wrong data / incorrect values in command data) error.
    I dont understand why dont loaded the applet to card. Actually I load and install HelloWorld.cap file as this way.
    Additionally , In the wallet applet , the register method used as resigter(bArray , ..... .

    Anybody help me please. It very important. :(

  • Compiling Java code with Japanese characters

    I have a Java code with some Japanese characters. My compiler doesn't recognise these characters and gives me error messages.
    Please help me.

    Obviously it's not the copmiler's fault. You need to fix your code.
    Here is a link to the Java Language Specification.
    The link is to section 3.8 - Identifiers.
    It describes the acceptable naming:
    http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#40625
    Perhaps your editor is not saving the text file in an appropriate format.
    What editor are you using?
    Try vim http://www.vim.org
    or SciTE http://www.scintilla.org/SciTE.html

  • Compiling Java Servlet with Depricated Methods

    I have a problem of compiling Java servlets that contain depricated methods. If you compile against modern version of servlet.jar I see depricated methods error messages and if I use a very old servlet.jar it cannot find newer methods. What is is the best solution in this case?
    Thank you,
    Boris.

    The best thing to do would be compile your code with the -depreciated option to find which methods have been depreciated and the refactor your code to remove them.
    The next best thing is to ignore the messages (they are warnings not errors) and your code should still work

  • 3000 usd reward for the one can provide me any JAVA card with AES

    Hello,
    i am quite desperate, i am trying to find 1000-2000 java cards (schlumberger or jcop) with AES enabled. Seems this cards are really hard to find, i got allready offers and samples but all of them without AES enabled.
    I am willing offer 3000 USD reward to the person can give me the right contact where i can get those cards (at least 1000 pices) till 25-th of September. I got allready one offer from sagem orga for jcop, but their delivery time is 4-6 weeks, so it must be some one have such qtty of cards fizicaly on hand ready to ship.
    Please contact me by PM or phone (+852-6723-9999) or post here your contact details and i am calling you back.
    Thanks and best regards,
    Razvan

    @clemson
    i also have offer from sagem orga, delivery time 4-6 weeks, the point is that my customer does not understand that it is just a question of luck to find some one with cards on stock, he wants his goods fast. I have told him from begining not to stick on one specific card, but he preferred using jcop. I got some jcop from an analphabet, 10K pcs, jcop41 and this analphabet promised us to deliver us version 2.3.1, but the cards he delivered to us were 2.2.1 and those do not have AES !!!
    This is the reason why i am offering this reward. Maybe some one knows some one who have stock of 1000-2000 pcs. Now my customer does not mind to use ANY JAVA CARD which have AES. He don't mind if those cards are from Oberthur, Nxp, Gemalto, Giesecke & Devrient, or other manufacturer. His requirements are: a) must be java card b)must have AES other features are not important.
    Reagards,
    Razvan

  • Java Card with USB interface

    Hi,
    I'm trying to use a Java Card for a project I'm doing at the university. But one of our requirements is to use a one with a USB interface +(ie: without the need for a separate smart card reader).+
    Have anyone come across such a device that is with a USB interface. If so please provide me with links.
    Thanks in advance.
    Regards,
    NiMaL

    ID-1 Format:
    NXP (Philips) JCOP 41 V2.2.1/72K USB
    http://tinyurl.com/6oz9qq
    OMNIKEY CardMan 1109 USB Connector
    http://tinyurl.com/5zvg34
    ID-0 Format:
    NXP JCOP 41 V2.2.1/72K USB SIM format
    http://tinyurl.com/5abxxj
    Gemalto Reflex 531 USB SIM Token Connector
    http://tinyurl.com/5j9e5p
    SIM card retainer/Surface mount type
    http://tinyurl.com/63buqy

  • Java card with javacardx.framework.math.BigNumber

    Could somebody point me to a vendor for java cards that support javacardx.framework.math.BigNumber?
    I searched this forum for 2.2.2 vendors, but could only find Athena IDProtect (http://www.athena-scs.com/product.asp?pid=32). The friendly support at Athena told me that this card does support the above package.
    Are there any other vendors of 2.2.2 cards that I could contact?

    Hi
    I am student working on a smart card project
    i am totally new to this field i have a lot of doughs to be cleared ..can you help me in this section
    my email id [email protected]
    i have return my doughs under the title : What is Client-Side API for RMI on the Java Card Platform
    : java card virtual machine

  • Running a java program with eclipse

    Hi,
    I'm trying to run this java program(below) in eclipse..when i go to the 'run' icon inorder to choose the option 'run as' then 'java application' , i have 'none applicable' as the only option available. is it possibly because the program uses threads?
    could someone using eclipse please try to execute this program and let me know if you succeed and how exactly you do it.
    package reseaux;
    import java.io.*;
    import java.net.*;
    import java.util.*;
         public class LeServeur extends Thread{
         Socket socket;
         BufferedReader in;
         PrintWriter out;
         Vector FlowList=new Vector(10);
         public LeServeur(Socket socket)throws IOException{
              this.socket=socket;
              in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
              out= new PrintWriter(new OutputStreamWriter(socket.getOutputStream()));
         public void run(){
              String s;
              synchronized(FlowList){
                   FlowList.addElement(this);
              try{
                   while(!(s = in.readLine()).equalsIgnoreCase("/quit")){
                        for(int i=0;i<FlowList.size();i++){
                             synchronized(FlowList){
                                  LeServeur monServeur=(LeServeur)FlowList.elementAt(i);
                                  monServeur.out.println(s + "\r");
                                  monServeur.out.flush();
              catch(IOException e){
                   e.printStackTrace();
         finally {
         try {
              in.close();
              out.close();
              socket.close();
         } catch(IOException ioe) {
         } finally {
              synchronized(FlowList) {
              FlowList.removeElement(this);
    thanks

    thanks...
    Infact, i wanted to run the main program called 'Serveur' but it uses 'LeServeur'( the code i sent before') and apparently it gives me an error msg that it doesnot recognise the 'LeServeur'...that's why i was thinking that i should probably first compile the 'LeServeur' so that it can be recognised in the 'Serveur' program.
    here is the 'Serveur' code that uses an instantiation of the LeServeur...
    package reseaux;
    import java.net.*;
    import java.io.*;
    public class Serveur {
              public int port;
              public ServerSocket skt;
              public Socket socket;
         public static void main(String[] args) {
              int port=8975;
              ServerSocket skt=null;
              Socket socket=null;
              try{
                   if(args.length>0)
                        port=Integer.parseInt(args[0]);
              catch(NumberFormatException n){
                   System.out.println("This port is used uniquely for listening");
                   System.exit(0);
              try{
                   skt= new ServerSocket(port);
              while (true){
                   socket =skt.accept();
                   LeServeur flow=new LeServeur();
                   flow.start();
         catch(IOException e){
              e.printStackTrace();
         finally{
              try{
                   skt.close();
              catch(IOException e){
                   e.printStackTrace();
    do you know have any idea why it doesnt recognise the 'LeServeur'?
    ps:they're in the same package
    thanks

  • Utility for compiling java files with options.

    i want to create a utility application in java which can compile a java source file with options like -d , -classpath,-help etc.
    there is a java.lang.Compiler class which can be used to compile a source file but how can i supply compile time options?
    help.

    Welcome to the forum!
    >
    i want to create a utility application in java which can compile a java source file with options like -d , -classpath,-help etc.
    there is a java.lang.Compiler class which can be used to compile a source file but how can i supply compile time options?
    >
    Is this an interview question? An intellectual exercise to see if you can do it?
    Why do you want to do this when there is already a freely available utility, javac, that can already do all of that?
    Please provide more information and a sample user session that shows what you are really trying to accomplish.
    And the class you mentioned is not really for the purpose you say you want
    >
    The Compiler class is provided to support Java-to-native-code compilers and related services. By design, the Compiler class does nothing; it serves as a placeholder for a JIT compiler implementation.

  • Compiling server-client with eclipse

    hi. i'm new to java programming and i'm using eclipse. i have 2 simple programmes, one for a server and another for a client and would like to use them to communicate with each other. i have an error message with both programs.. i think that there is a prblem with my server program...is there anything i need to add to get it running or is there anything in particular needed when using eclipse to run server/client programs? here is the code:
    import java.io.*;
    import java.net.*;
    public class Serveur {
         public static void main(String[] args) {
              try{
              ServerSocket ss= new ServerSocket(1500);
              Socket sc= ss.accept();
              System.out.println("connection etablie");
              PrintWriter flux_sortant = new PrintWriter(sc.getOutputStream());
              flux_sortant.println("coucou j'ecris");
              //ss.close();
              //sc.close();
              catch (IOException e){
                   System.out.println("Connection non etablie");
    and for the client:
    import java.io.*;
    import java.net.*;
    public class Client {
         public static void main(String[] args) {
              try{
                   Socket s= new Socket("local host",1500);
                   BufferedReader flux_entrant= new BufferedReader(new InputStreamReader(s.getInputStream()));
                   System.out.println("J'ai lu:" + flux_entrant.readLine());
              catch (IOException e){
                   System.out.println("probleme de connection");
    thanks

    Hello,
    if you want your server programm to listen for incoming connections all the time, then you shouldn't close your ServerSocket because it is accepting the connections.
    I would try something like this:
    public class Serveur implements Runnable{
           private boolean running = true;
           private ServerSocket ss;
           public Serveur(){
                   ss = new ServerSocket(1500);
          public static void main(String[] args){
                  new Thread(new Serveur()).start();
        public void run(){
                while(running){
                        Socket sc = ss.accept();
                        System.out.println("Connection established");
                       PrintWriter writer = new PrintWriter(sc.getOutputStream());    
                       writer.println("Blah");
                       sc.close();           
    }This server would accept a connection send back "Blah" and close the connection to the client.
    hope that helps...
    greetz
    Message was edited by:
    n3bul4

  • XSLT Problem in Java 6 with Eclipse 3.3.1.1

    I have written XSL files in a project and it run fine with Java 5. But with java 6, I have observe error message, which is given below:
    Exception in thread "main" java.lang.NoSuchFieldError: varSpace10
         at BOPWrapper550.extra()
         at BOPWrapper550.BOP550Others()
         at BOPWrapper550.template$dot$61()
         at BOPWrapper550.applyTemplates()
         at BOPWrapper550.transform()
         at com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet.transform(Unknown Source)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
         at com.utica.clm.transformers.GenericTransformerImpl.transform(GenericTransformerImpl.java:41)
         at com.utica.clm.transformers.CLMTransformer.processLob(CLMTransformer.java:127)
         at com.utica.clm.transformers.CLMTransformer.main(CLMTransformer.java:577)
    Please help.

    I simply suggest read the update page between Java 1.5 and 1.6. Generally you will understand your trouble. Without more explanation its difficult to help you.

Maybe you are looking for

  • "Ipod Cannot be Synced" -Please Help!!!

    I must have spend hours reading forums and discussion boards trying to fix this.. No matter what I do to my Ipod or computer I get a "(My) Ipod could not be synced. Required disk could not be found." Please help me out!!

  • How can I get my ipod classic to connect to my computer?

    So I downloaded Sharepod to get the songs on my iPod to my computer. And now when I connect it, it'll charge. But when it goes to sync anything new it does it for a minute then starts ejecting then a pop up shows up saying that disk (D:) is not conne

  • Problem with Print Preview  Urgent!

    Hello BW Experts, 1.I am trying to use the Print functionality for web printing.In the print preveiew i see all the text in black and white.It is completely different from the page that is displayed in the browser. --I tried using the same print styl

  • Change namespace for development objects

    hi at all, i have to transport a lot of customer development objects (reports, tables, programs, WebDynpro-components...) from one system to another development system. in the source system all customer-objects are named like Y* or Z* (e.g. Z_CM_COUR

  • Can we write leave program syntax in RFC function module.

    hello friends,    can we write leave program syntax in RFC function module. Iam developing RFC Function module . useful answers will be awarded.. Regards Kanth Edited by: Kanth on Mar 30, 2008 11:38 PM