Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts-core.jar

 
krishna prasad gunasekaran
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to compile a java file using builtin struts classes. so I used the
javac -classpath option. is there any other do-it-once and use javac without -classpath option. is there a way to tell the compiler to find those classes in struts-core.jar jar file without using -classpath, like say, add the jar file to where bootstrap or extension class files reside. by doing so we can avoid -classpath option.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't specify a -classpath parameter, javac uses the system environment variable classpath. If you set this environment variable with the path you want to use for compiling, you can omit the -classpath parameter with javac.

It is important to understand, though, that this affects the compile-time classpath only. The run-time classpath is determined by your application server, and in most cases they completely ignore the classpath environment variable and set up their own classpaths according to the rules the J2EE spec and their own rules.

If you're really serious about developing Java web applications, I'd consider doing your compiles with ant scripts or using an IDE. I don't know a single professional Java developer that uses javac for compiles any more.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic