aspose file tools*
The moose likes Websphere and the fly likes Classpath and folders Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Classpath and folders" Watch "Classpath and folders" New topic
Author

Classpath and folders

David Edds
Greenhorn

Joined: Dec 06, 2004
Posts: 20
Hi,

I would like it so that when I go to run a Java application (or unit test) from within WebSphere, the directory MyProject/lib is already (by default) on the classpath. This lib directory contains properties files (for log4j) that the applications require to run succesfully.

Now I can achieve this by going into the Run... dialog, selecting the Classpath tag, unchecking "Use default class path" and adding the lib folder. But since this is required for a medium sized development team involving, it would be much more convenient if the lib directory was there by default. Also by unticking the "Use default class path" check-box, any further changes that are made to the project are not picked up when the Run configuration is re-invoked.

The classpath that is specified by default, is I assume, derived from the build-path of the project. However I see no way to add a non Java source folder to the build path (indeed, why would a java compiler require this!). Does anyone know how websphere derives the default class-path and if a non java source folder can be added?

There is also a tag on the Run... dialog which specifies the "bootstrap classes". Does anyone know how this can be modified so I could add the folder?

Thanks in advance,
David
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29287
    
140

David,
We work around this by putting our property files in a separate java project that is just for resources and not code. In WSAD 4, you were able to refer to a non-java project. Hopefully, they will put this functionality back in RAD 6.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
David Edds
Greenhorn

Joined: Dec 06, 2004
Posts: 20
Jeanne,

Yes that has worked for me. I created a Java WSAD project (a simple project seemed not to work) called "Resources" and put my .proeprties file in there. Putting a dependency on the other projects so they referred to the "Resources" project puts the project on the classpath by default and the .properties file is picked up by default.

I also put all of the dependant .jar files in "Resources" too, so it's starting to become a little large, but at least everything is located in one central location.

Thanks for the advice. It's worked in exactly the way I wanted.
David
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Classpath and folders
 
Similar Threads
Webspere 345 exam questions
157 Question Help and Resourses
ibm websphere test 157 for websphere studio application developer 4.0.3 for windows
Class.getResourceAsStream() returns null in Eclipse
IBM Exam 157 - Questions and Answers (Sample Exam)