• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Compiling classes in struts

 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys

I am new at working with frameworks in java. I have downloaded struts2 and was working on a class. I did the usual and opened up the terminal on my xp64 rig and did the javac MyClass.java but it came out with errors regarding the framework naming. So how do I compile classes in struts?
 
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
I'm not sure what you mean by "errors regarding the framework naming". You have to have any S2 dependencies available when you're compiling, just like any other Java program.

It's not terribly efficient to code Java, particularly Java with a lot of dependencies, outside of an IDE, Ant, Maven, or equivalent, but it's doable--you just have to follow normal Java compilation procedures.
 
shaf maff
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.

Well on compile it tells me the ActionSupport symbol cannot be found. Code below:

import com.opensymphony.xwork2.ActionSupport;
public class ConfirmFault extends ActionSupport {
}

I don't know how to handle th dependiences since I am fresh to this. The apache tuts were talking of maven, I will check that out inabit. But would I paste the jar files into the java lib dir or something ?
 
David Newton
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
You'll get better basic Java support in one of the Java-specific forums; they can talk you through compiling projects with external dependencies.

Maven certainly works, and it's how we build Struts itself, but w/o a decent grip on how Java works in the first place if anything goes wrong you'll be high and dry--it's good to understand the basics of how and why it works, which compiling "by hand" will give you.

When compiling it doesn't matter so much *where* the libraries are located, as long as they're available somehow, either by being on the classpath or via some other mechanism.

When running the webapp they have to be available to the application; in general you won't want them in the JRE/JDK lib dir *or* the app server's lib dir, but in the web-app-specific dir. More information about web app stuff is better asked about in the servlet forum.
 
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic