This discussion is archived
2 Replies Latest reply: Apr 1, 2013 10:07 AM by baftos RSS

Java compilation problem.. Please Help Me!

1000254 Newbie
Currently Being Moderated

I have downloaded logica smpp siimulator source code. In the source code, it contains directory /com/logica/smscsim/*.java. I try to modify the code in in smscsim folder. So I modify the code and compile with command

javac -cp "lib/*:."

A class Simulator.class was successfully build. But when I try to run the code with the command

java -cp "lib/*:." Simulator

I got error java.lang.NoClassDefFoundError: Simulator (wrong name: com/logica/smscsim/Simulator)

Maybe it has something to do with the package. I successfully compile with old package with command java -cp "lib/*:." com.logica.smscsim.Simulator, but the problem is I need to modify the I dont want to use the old com.logica.smscsim.Simulator. How do I use the newly created class for Here's some code of that I successfully compiled, but fail to run:

package com.logica.smscsim;

import java.util.*;

import com.logica.smpp.debug.*;
import com.logica.smpp.SmppObject;
import com.logica.smpp.pdu.DeliverSM;
import com.logica.smpp.pdu.WrongLengthOfStringException;
import com.logica.smscsim.SimulatorPDUProcessor;
import com.logica.smscsim.SimulatorPDUProcessorFactory;
import com.logica.smscsim.util.BasicTableParser;
import com.logica.smscsim.util.Table;

public class Simulator
static final String copyright =
"Copyright (c) 1996-2001 Logica Mobile Networks Limited\n"+
"This product includes software developed by Logica by whom copyright\n"+
"and know-how are retained, all rights reserved.\n";

static {

* Name of file with user (client) authentication information.
static String usersFileName = "users.txt";

* Directory for creating of debug and event files.
static final String dbgDir = "./";

* The debug object.
static Debug debug = new FileDebug(dbgDir,"sim.dbg");

* The event object.
static Event event = new FileEvent(dbgDir,"sim.evt");

public static final int DSIM = 16;
public static final int DSIMD = 17;
public static final int DSIMD2 = 18;

static BufferedReader keyboard =
new BufferedReader(new InputStreamReader(;

boolean keepRunning = true;
private SMSCListener smscListener = null;
private SimulatorPDUProcessorFactory factory = null;
private PDUProcessorGroup processors = null;
private ShortMessageStore messageStore = null;
private DeliveryInfoSender deliveryInfoSender = null;
private Table users = null;
private boolean displayInfo = true;

private Simulator()

* The main function of the application displays menu with available
* options.
public static void main(String args[]) throws IOException
Simulator menu = new Simulator();;


Appreciate help from anyone...



  • Correct Answers - 10 points
  • Helpful Answers - 5 points