File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jar files not detecting

 
Mohan Mehra
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20205
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Workspace? What's a workspace?
 
Mohan Mehra
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Workspace? What's a workspace?


Eclipse IDE workspace(place where the project is stored)
 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mohan Mehra
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1557
5
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17646
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mohan Mehra
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1557
5
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic