package does not exist

Posted on 2007-10-14
Last Modified: 2013-11-23
i am trying to compile this:

import java.util.Hashtable;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueReceiver;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;


public class QueueReceiveSynchronous
      public static void main(String[] args)
                  // create a JNDI context
                  Hashtable properties = new Hashtable();
                  Context context = new InitialContext(properties);
                  // retrieve queue connection factory
                  QueueConnectionFactory queueConnectionFactory =
                  // create a queue connection
                  QueueConnection queueConnection = queueConnectionFactory.createQueueConnection();
                  // start delivery of incoming messages
                  // create a queue session
                  // set transactions to false and set auto acknowledgement of receipt of messages
                  QueueSession queueSession = queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
                  // retrieve queue
                  Queue queue = (Queue)context.lookup("queue1");
                  // create a queue receiver and associate to the retrieved queue
                  QueueReceiver queueReceiver = queueSession.createReceiver(queue);
                  // receive message using the synchronous receive method
                  Message message = queueReceiver.receive();
                  String messageText = null;
                  if (message instanceof TextMessage)
                        messageText = ((TextMessage)message).getText();
                  // clean up
            catch (NamingException e)
            catch (JMSException e)

C:\Projects\Leader\prototype\jms\openjms2>javac *.java package does not exist

does anyone know where to get this package?
Question by:mmingfeilam
    LVL 5

    Expert Comment

    Are you using IBM's JVM to compile this code?


    Author Comment

    no, maybe that's why it's doesn't have that package?
    LVL 5

    Accepted Solution

    If you are developing a client running against IBM server you may have to use their JVM. It comes with their development tools such as RAD. You can try to obtain it separately from

    Before doing this, though, try to understand why you need this package. Your code looks like standard JMS code for receiving messages. Why does it need an IBM-specific class?


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    count7 challenge 12 52
    countHi challenge 25 61
    countAbc challenge 9 35
    where is session ID cache stored 1 26
    If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now