0

We have a App Engine standard Java8 project, where JSP files were used for views and each of those jsp file will be using a util class, so we've used the page directive provided by jsp to import the required util class. The code looks like below

<%@page import="util.AssetUtils"%>.

We don't have any error in any of those JSPs' and even the deployment was fine when done with Google Cloud Tools for Eclipse plugin.

But when we tried deployment with command line. We are getting the below error for some of the jsp files.

INFO: Built File: /includes/social-ad-template.jsp
Mar 02, 2022 2:59:38 PM org.apache.jasper.JspC execute
INFO: Generation completed with [0] errors in [926] milliseconds
warning: [options] bootstrap class path not set in conjunction with -source 8
/var/folders/nn/_v6wc4tn02x45jp9f_5ysrch0000gp/T/1646213377265-0/org/apache/jsp/includes/scripts_002dto_002dinject_002din_002dhead_jsp.java:15: error: package util does not exist
import util.AssetsUtil;
           ^
/var/folders/nn/_v6wc4tn02x45jp9f_5ysrch0000gp/T/1646213377265-0/org/apache/jsp/includes/scripts_002dto_002dinject_002din_002dbody_jsp.java:14: error: package util does not exist
import util.ModeUtil;

Gcloud version

Google Cloud SDK 375.0.0
app-engine-java 1.9.95
app-engine-python 1.9.99
bq 2.0.74
cloud-datastore-emulator 2.1.0
core 2022.02.25
gsutil 5.6

Can someone please help with this ?

Thanks!

Venkat
  • 139
  • 1
  • 8
  • 1
    I think there is no error while running this in Google Cloud Tools for Eclipse plugin because it downloads required dependencies for you. To run it in CLI using javac command, you need to specify CLASSPATH. It is important to be inside of /home/user directory. However, it requires more dependencies. I think [this stack answer](https://stackoverflow.com/a/60107392/15803365) might help you. – Priyashree Bhadra Mar 03 '22 at 11:09
  • Thanks you @PriyashreeBhadra. Will try out or possibly will add support of build tool. – Venkat Mar 03 '22 at 13:54
  • Please revert if you manage to solve it. If not, do share what errors you got further. – Priyashree Bhadra Mar 03 '22 at 15:39
  • Did you try it out? – Priyashree Bhadra Mar 11 '22 at 04:52
  • Hey Priya, It works, Thanks to you. I changed the output path location in the classpath to point a dir inside my WebContent folder so now the class files are available during the deployment and it was fine. – Venkat Mar 14 '22 at 13:53
  • That's great. I have posted the answer below taking into account what helped you. Could you please acknowledge it by upvoting/accepting the answer? – Priyashree Bhadra Mar 15 '22 at 06:33

1 Answers1

1

I think there is no error while running this in Google Cloud Tools for Eclipse plugin because it downloads required dependencies for you. To run it in CLI using the javac command, you need to specify CLASSPATH. It is important to be inside of the /home/user directory.

OP confirmed that he followed the above suggestion and changed the output path location in the classpath to point a dir inside his WebContent folder. So now the class files are available during the deployment and it is working fine.

Priyashree Bhadra
  • 3,182
  • 6
  • 23