File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes jar files not detecting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "jar files not detecting" Watch "jar files not detecting" New topic
Author

jar files not detecting

Mohan Mehra
Ranch Hand

Joined: Jul 28, 2011
Posts: 72
There is this problem happening to me most of the times. I have a workspace with .java files. and i have included all the jar files necessary to run those .java files.It works perfect. but, so now when i try and create one more workspace with the same .java files and include the jar files, even though the jar files are present , they are not being detected. why so. i also made the copy of jars and using them separately for both workspace. i even tried using same jars for both workspace, but not working.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18989
    
    8

Workspace? What's a workspace?
Mohan Mehra
Ranch Hand

Joined: Jul 28, 2011
Posts: 72
Paul Clapham wrote:Workspace? What's a workspace?


Eclipse IDE workspace(place where the project is stored)
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1512
    
    5

Mohan Mehra wrote:even though the jar files are present , they are not being detected

Please make sure that you have correctly added those jars in classpath for new project (project -> properties -> java build path -> libraries -> add external jars).

Next to this, make sure your project compiles.

It should work.


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Mohan Mehra
Ranch Hand

Joined: Jul 28, 2011
Posts: 72
Anayonkar Shivalkar wrote:
Mohan Mehra wrote:even though the jar files are present , they are not being detected

Please make sure that you have correctly added those jars in classpath for new project (project -> properties -> java build path -> libraries -> add external jars).

Next to this, make sure your project compiles.

It should work.


i have done that already. still it doesn't work
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1512
    
    5

Ok. I'm not very much expert in workspaces, but below are the few precautions I take:
1) Never, ever use same directory for workspace and code. Always keep you code out of workspace. That way, workspace related settings are not stored in code dir.
2) Try to avoid using multiple workspaces for same set of source code. If you need to use some projects for one application and some other projects for other application, it can be done within a same workspace - by opening and closing respective projects. However, if you keep workspace dir separate from code dir, then you can create as many workspace as you wish for same set of source code files.

I guess(its just a guess) you are using same dir for workspace and source code. Further, you are creating another workspace using same (or child) dir, which is messing up the settings.

However, whatever is the case, it must find those jars if you've provided them correctly. What is the error you are getting?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

An Eclipse workspace is not some sort of common pool of mutually-shared resources. It is a container for Eclipse Projects. It also holds session information for the workspace user, but that's generally not of interest.

Each project in an Eclipse workspace is independent of every other project unless it is specifically configured to refer to one or more of those other projects. So just plopping down jars in a workspace is not sufficient for all the projects in the workspace.

One thing I used to do was keep a "library" project in my workspace where commonly-used jars would be kept for reference purposes. These days I don't do that since Maven is usually managing my jars, though.


Customer surveys are for companies who didn't pay proper attention to begin with.
Mohan Mehra
Ranch Hand

Joined: Jul 28, 2011
Posts: 72
if the .java file is in default package it works fine, but if it's in some user defined package, it is not able to detect the jars. and the jar files are not in workspace. they are in other drives like D
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1512
    
    5

Mohan Mehra wrote:if the .java file is in default package it works fine, but if it's in some user defined package, it is not able to detect the jars. and the jar files are not in workspace. they are in other drives like D

I still think that you've not added those jars to classpath and/or there's some issue in package creation (did you performed the steps like create package, giving name of package etc. or just created a new file in default package and started it with something like package com.test.myClass; etc.?)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jar files not detecting