Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiling Problem

Status
Not open for further replies.

javoine

Programmer
May 22, 2003
25
US
ok,

I use CE to create and compile my java class files and jsp pages.

when I'm done, I copy my pages and classes over to a Unix box where tomcat and apache are running.

The JSP pages that don't use the classes work fine after I copy them, but the ones that use the class files dont.

The pages are not finding the compiled classes. how do I fix this? I'd like to compile them on the unix box, but javac doesnt work well...gives a bunch of errors of things my pages are referencing and cant find.

anyone know what I should troubleshoot or what to do?

Thanx
 
Sounds like you have a CLASSPATH issue. Where are do you put the class files under Tomcat, and how are you referencing them within the JSP. What version of Tomcat are you running, and what are the errors you are receiving ?

As for javac not working on your UNIX system, this will again be a CLASSPATH issue.
 
Sedj,

ok. I copy them over to the same folders that presently exist. the jsp files are sitting in a directory named after the Application. in that same directory is web-inf. in web-inf is a classes folder and thats where i have 2 packages containing 1 class each.

we're running tomcat 4 on both machines, my developers machine and the unix box.

i will say this also, the first time we coppied the files over the class files wouldnt work right, but then someone working on the unix box re-compiled the class files and then everything worked, problem is i had to make some changes to one of the classes and after doing that and copying it back over...well...

so now that person that performed whatever miracle the first time is not here and i dont know what was done to recompile it/make it work/whatever.

thats why i asked about javac. the oddest thing is, when i compile them on my machine they work fine, when i go to use javoc, it runs, but gives a ton of compilation errors.

if you can't help with this one, i want you to know that i appreciate it anyway...you have been a true champion in just trying.

thanx
J
 
So your dir structure looks like the below ?


JSP files in :
/ApplicationContext

Classes in :
/ApplicationContext/WEB-INF/classes/packageName

Have you checked the JSP files correctly reference the package names ?

Try to create a jar file of your package, and stuff it into WEB-INF/lib and remove the class files in WEB-INF/classes.

Are the JDK versions the same on both machines ?

If all else fails, then try to get the CLASSPATH variable set up properly in the unix machine, and compile there ...
 
Sedj,

you were right...classpath was not set on the unix box. it was set where i compile my class files,but not where i copy them too.

i thought about your remarks for a bit and checked to be sure, saw that it was not set and smacked my forehead. thank you again!

everything works like a charm

j
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top