21

I just created a .jsp file in my google app engine project. How to resolve the below error.

Description Resource Path Location Type Your project must be configured to use a JDK in order to use JSPs

proj1.jsp

/Proj1/war Unknown Google App Engine Problem

Kindly let me know.

Santosh V M
  • 1,541
  • 7
  • 25
  • 41

6 Answers6

16

it is the error. In order to compile jsp you need a jdk installed in your system. If you are running on a JRE you will get this error. Also make sure that your project has been configured with a jdk in it's path.

Abdul Kader
  • 5,781
  • 4
  • 22
  • 40
  • 1
    I already have JDK in my computer. But still the error. You mean jdk for Java enterprise edition? – Santosh V M Jun 04 '11 at 00:19
  • 9
    I have rectified this error by doing this :Make sure you have a JDK installed. You can get one here: http://java.sun.com/javase/downloads/index.jsp. By default this installed to (In Windows) C:\Program Files\Java\jdk1.6.0_14 - In Eclipse, go to: Window->Preferences->Java->Installed JREs and check to see if you have an entry for the path from the previous step. If not, then Click add->Standard VM, then for the JRE Path enter the path from the previous step. You should see all of the JARs added to the library section. - If you had a JRE checked previously(as I did) then you can uncheck it. – Santosh V M Jun 09 '11 at 06:48
  • I think that's what i meant , make sure your project has been configured with a jdk in it's path – Abdul Kader Jun 09 '11 at 07:18
  • @ Abdul Well Thanks for your inputs. – Santosh V M Jun 10 '11 at 06:14
  • For some reason, a Google Eclipse plugin deleted my JDK! – Chloe Oct 03 '13 at 16:31
13

For sake of improving answers

stack over flow reference

.jsp file not working for Google App Engine guestbook tutorial

the accepted answer was a year ago

updated answer from reference

In the end I seem to have wasted my bounty as I found the solution (with a little help) myself.

The problem arose because I was unfamiliar with Eclipse. When I found the more verbose error message Your project must be configured to use a JDK in order to use JSPs guestbook.jsp. It was located in a tab called 'Markers' in pane found at the bottom of the Eclipse window. enter image description here It seems that Eclipse wasn't aware that I had installed the JDK.

In Eclipse I went to menu Window->Preferences->Java->Installed JREs . Eclipse had only one entry there named jre6 I clicked the Add... button Chose Standard VM and browsed to the base directory of the jdk (in my case C:\Program Files\Java\jdk1.6.0_20)

I rebuilt my project but the same error was there. I had forgotten to check the box that tells Eclipse to use the jdk instead of the jre. enter image description here

As soon as I did that Eclipse rebuilt my project and the error was gone.

Community
  • 1
  • 1
shareef
  • 9,255
  • 13
  • 58
  • 89
  • 1
    Thanks for the details! I had already created my project but under "Properties > Java Build Path > Libraries" I still had to "Add Library" the JDK and **remove** the existing JRE library. Now it works for me. – Brian White Nov 09 '13 at 00:35
8

To solve this problem, first please confirm that JDK is already install on your computer. If it not available, go to Oracle JDK hompage to download and install it.

Then follow some steps to config JDK.

When JDK is configured, return eclipse and build project if you still get current error, I decide you are using JRE instead JDK. Choose Prefrences - Java - Install JRE - Un-check JRE and check JDK

Rebuild project

Hope this help!

Khai Nguyen
  • 3,065
  • 1
  • 31
  • 24
2

Set JDK as your Installed JREs in Eclipse. In Eclipse Window->Preference->Java->Installed JREs Click on Add Button | Select VM ->Add JRE Select Folder of jdk as "JRE Home" Directory. Click OK. Build your GAE Project

Master Mind
  • 2,386
  • 3
  • 31
  • 48
0

JFTR:

For those who use Ubuntu and OpenJDK, and may come here looking for help on the same issue: EVEN when it is called Open*JDK* (i.e. java-6-openjdk) actually you may have installed only the JRE part since they are on different packages, so you need to install also the JDK. For version 6 this is done via:

$ sudo apt-get install openjdk-6-jdk

Note that you may have yet an openjdk-6-jre in your system.

Fran Marzoa
  • 4,293
  • 1
  • 37
  • 53
0

If your problem persist, you must sure that in your project use JDK library. Go to your project->click right->Build Path->Configure Build Path->Add library->JRE System Library->Select "Workspace default JRE (jdk1...)"->Finish, and in "Order and Export" UP your JDK Library above JRE Library. When you save your proyect it´s ok.

Davidnoza
  • 11
  • 1