• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

import statements saga

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I posted an issue a few days ago and received some very good responses - so thank you all.

My primary complaint was/is I had import statements referencing classes under WEB_INF without any source code.

The solution was to place .jar files containing the ready-compiled classes into my classpath. Subsequently - you can use normal import for the compiled classes. My question - when unzipping the application - would / should the jar files be reflected in the WEB-INF/lib path? Could they be placed elsewhere within the app?

Thank you for your comments...
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I take it you are referring to deploying the war file.
When the war is exploded, the jar still remains under WEB-INF/lib which is automatically on the class path. The jars placed there will be picked up by default.
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
'Unzipping the application' - Are you referring to unzipping WAR/EAR file. In that case, yes the jars will be placed inside the /WEB-INF directory of the extracted one.

The J2EE IDEs(eclipse, netbeans etc) however support, to have java libraries (.jars) to be linked with the code base by adding the .jar to the build path. But it is advisable to have it in WEB-INF if the jar is specific for your application, the reason being when you export the Source code to WAR, it will include only the jars inside your WEB-INF directory.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

bob reilly wrote:Could they be placed elsewhere within the app?


No. WEB-INF/lib is the location for application-specific libraries.
 
Can you smell this for me? I think this tiny ad smells like blueberry pie!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic