This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Java in General and the fly likes The correct location of Jar files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "The correct location of Jar files" Watch "The correct location of Jar files" New topic

The correct location of Jar files

fedai gandjaliyev
Ranch Hand

Joined: Dec 05, 2005
Posts: 99
I'm using jSMSEngine.jar to send SMS messages from my java app.
Here is a primitive view of my code.

import import org.jsmsengine.*;

public class SMS extends JFrame implements ActionListener{

CService SMSServ = null;

SMS(Sting title){
SMSServ = new CService("COM7", 19200, "Nokia", "6230");


public static void main(String[] aid){
new SMS("SMS Sender");

I created a shortcut for this class file and in the properties of the shortcut navigated the Target to
C:\WINDOWS\system32\javaw.exe SMS .
When I comment creating a CService instance in the constructor of the frame the app launches when I uncomment it does not.
I guess that means that it cannt find the jar file.
I put the jar file into the same directory where all my classes reside and into the jre\lib\ext.
But it doesnt help!
Where shall I put the jar file?
Waiting for reply.............
Thank you very much!
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2398
You should list the actual jar file name including absolute path in the CLASSPATH. It isn't enough to place the directory where the jar file is.
[ April 05, 2006: Message edited by: Keith Lynn ]
fedai gandjaliyev
Ranch Hand

Joined: Dec 05, 2005
Posts: 99
I'm using IntelliJ IDE 4.5.
When I want to use a jar file in my project I just add it to it.
My project will consist of 5-7 class files and I want to make an
executable jar file out of them. But this jar file should somehow
access those additional jars.
So where shall I put them?
Waiting for reply.......
Thank you!
I agree. Here's the link:
subject: The correct location of Jar files
It's not a secret anymore!