Java, how do I find the correct jar file and import statement

I am not a java programmer, but am trying to compile a program in java

I perform the following:

C:\amq>"C:\Program Files (x86)\Java\jdk1.6.0_06\bin\"javac -Xlint:deprecation  -
classpath activemq-kahadb-store-5.8.0.jar;activemq-broker-5.8.0.jar;activemq-cli
ent-5.8.0.jar;activemq-console-5.8.0.jar;activemq-jaas-5.8.0.jar;activemq-kahadb
-store-5.8.0.jar;activemq-openwire-legacy-5.8.0.jar;activemq-protobuf-1.1.jar;ac
tivemq-spring-5.8.0.jar;activemq-web-5.8.0.jar;geronimo-j2ee-management_1.1_spec
-1.0.1.jar;geronimo-jms_1.1_spec-1.1.1.jar;geronimo-jta_1.0.1B_spec-1.0.1.jar;ha
wtbuf-1.9.jar;jcl-over-slf4j-1.6.6.jar;slf4j-api-1.6.6.jar ProducerTool.java
ProducerTool.java:59: cannot find symbol
symbol  : variable CommandLineSupport
location: class ProducerTool
        String[] unknown = CommandLineSupport.setOptions(producerTool, args);
                           ^
ProducerTool.java:67: cannot find symbol

Open in new window


This is a supplied sample that comes with amq, so it should be good to go

So I look up CommandLineSupport, and see it in the following link:

http://activemq.apache.org/maven/5.8.0/activemq-kahadb-store/apidocs/org/apache/activemq/store/kahadb/disk/util/CommandLineSupport.html

My questions are:

1> what is the import command I should use inside the java program to make sure this class is properly referenced

2>  What is the name of th ejar file I am looking for:

3>  any other tips ?

Thanks
Los Angeles1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Los Angeles1Author Commented:
BTW, is this a problem with the import statement or putting th ecorrect jar in the classpath ?

How can you tell
0
gudii9Commented:
>>ProducerTool.java:67: cannot find symbol

I do nor think it is issue with jars.


jar files end with .jar.

I see you have below jars in classpath

ctivemq-kahadb-store-5.8.0.jar;activemq-broker-5.8.0.jar;activemq-cli
ent-5.8.0.jar;activemq-console-5.8.0.jar;activemq-jaas-5.8.0.jar;activemq-kahadb
-store-5.8.0.jar;activemq-openwire-legacy-5.8.0.jar;activemq-protobuf-1.1.jar;ac
tivemq-spring-5.8.0.jar;activemq-web-5.8.0.jar;geronimo-j2ee-management_1.1_spec
-1.0.1.jar;geronimo-jms_1.1_spec-1.1.1.jar;geronimo-jta_1.0.1B_spec-1.0.1.jar;ha
wtbuf-1.9.jar;jcl-over-slf4j-1.6.6.jar;slf4j-api-1.6.6.jar


make sure all the quotes and lines properly ended.

Here is interesting link

<Link to competing site removed - mccarl - 29 Sept 2013>
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
@Greensburo,

C:\amq>"C:\Program Files (x86)\Java\jdk1.6.0_06\bin\"javac -Xlint:deprecation  -
classpath activemq-kahadb-store-5.8.0.jar;activemq-broker-5.8.0.jar;activemq-cli
ent-5.8.0.jar;activemq-console-5.8.0.jar;activemq-jaas-5.8.0.jar;activemq-kahadb
-store-5.8.0.jar;activemq-openwire-legacy-5.8.0.jar;activemq-protobuf-1.1.jar;ac
tivemq-spring-5.8.0.jar;activemq-web-5.8.0.jar;geronimo-j2ee-management_1.1_spec
-1.0.1.jar;geronimo-jms_1.1_spec-1.1.1.jar;geronimo-jta_1.0.1B_spec-1.0.1.jar;ha
wtbuf-1.9.jar;jcl-over-slf4j-1.6.6.jar;slf4j-api-1.6.6.jar ProducerTool.java
From the above command line, your current directory is "C:\amq" and the file ProducerTool.java is in that current directory. However, that is not the normal layout of an ActiveMQ download, normally ProducerTool.java is in an "examples" directory that is located in the base directory of the download. Have you moved files around to be trying to compile with that command line?

This is the reason for the error message that you are getting. "CommandLineSupport" in the error message is not referring to the one that you linked to above, it is referring to the CommandLineSupport.java that is also in the "examples" directory. So if you have moved ProducerTool.java somewhere else and not moved CommandLineSupport.java with it, that is why you get the error.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.