File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes struts-core.jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts-core.jar" Watch "struts-core.jar" New topic


krishna prasad gunasekaran
Ranch Hand

Joined: Jul 25, 2006
Posts: 158
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.

have a great day,
krishna prasad
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.

Consultant, Sima Solutions
I agree. Here's the link:
subject: struts-core.jar
It's not a secret anymore!