• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Classpath and folders

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
author & internet detective
Posts: 39525
771
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David Edds
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Humans and their filthy friendship brings nothing but trouble. My only solace is this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!