2

we have downloaded jar files for lambdaj and its dependencies which are again jar files. we do not know how to go about it. we have copied these files in the

C:\Program Files\Java\jre6\lib\ext

have set the class path in environment variales as:
variable: classpath
path: C:\Program Files\Java\jre6\lib\ext

but we do not know how to go further. we want to run some lambdaj programs. can anyone suggest how to run lambdaj programs?

Mario Fusco
  • 13,548
  • 3
  • 28
  • 37
intern
  • 141
  • 1
  • 6
  • 1
    You should not be putting those JARs (or any others) in the lib/ext directory. That's for language extensions. It's not intended to be a lazy person's way of setting CLASSPATH. – duffymo Jun 22 '10 at 12:27
  • if you put jars in lib/ext they are automatically included in your classpath – Redlab Jun 22 '10 at 12:29
  • even lambdaj is an extension to java.so i guess we need to put these jar files in lib/ext directory. this what we found on net. – intern Jun 23 '10 at 04:50

2 Answers2

1

You would run a Java program that requires lambdaj in exactly the same way you'd run any other java program with an external dependency, i.e. by invoking the java executable passing in the fully-qualified name of the Main class, or the JAR with an appropriate manifest, or by deploying it in a servlet container, etc. Additionally you should be putting the LambdaJ JAR on the classpath for this invocation, not in the lib folder for your entire JVM.

What have you tried so far and why/how is it not working? Your question at the moment is a bit analogous to "I want to use Microsoft Word to view some Word documents, how do I do this?".

Update for comment 1: You said "it's not working". That doesn't help anyone address your problem as it gives no clue what you expected to happen and what you observed, only that they were different. As for where JAR files can be stored - you can put them in any directory, so long as that directory is on the classpath (or you add it to the classpath) of the Java application that runs. The canonical place to put external dependencies is in a folder called lib below the root of your project, but the important thing is that you choose somewhere consistent and sensible.

It sounds like you don't quite grok Java and classpaths yet. If you have followed some tutorials and are still stuck, ask for help to let you understand. Adding more detail to your question, including the layout of your files, the commands you issued, and the response that came back would be useful too.

Andrzej Doyle
  • 102,507
  • 33
  • 189
  • 228
  • actually we had just started using lambdaj and are not aware of how to go about jar files. we followed few steps mentioned over the net i.e. classpath setting. but still it is not working.when we import lambdaj package then i could not find that package. can u clearly tel us where are we supposed to store these jar files in order to run a simple program which has imported lambdaj package? – intern Jun 23 '10 at 08:15
1

If you are using Netbeans create a project and right click on the Libraries folder within the desired project. Click Add JAR/Folder...

Slaggy
  • 11
  • 1