2

I recently started a java course that deals with web applications.

We're using netbeans 8.0.2 and Apache Tomcat.
I installed the plugin that allowed me to use Tomcat with netbeans but when I create a project and run it to see if it's working, I'm greeted with an error saying Tomcat couldn't be started and to check my server logs.

So I tried to start Tomcat and it opens up and closes almost instantly. I had to screen shot it to read the message:

"neither the java_home nor the jre_home environment variable is defined."

I looked for tutorials on what that means and how to fix it but nothing has helped me.
Anyone have any ideas? I'd greatly appreciate it!

Thanks

moskito-x
  • 11,832
  • 5
  • 47
  • 60
DrMoney
  • 73
  • 8
  • 1
    Try this: [How to set java_home on Windows 7?](http://stackoverflow.com/questions/2619584/how-to-set-java-home-on-windows-7) – CubeJockey Aug 31 '15 at 18:47
  • 2
    Also, by chance, when it told you to check your server logs... did you? – CubeJockey Aug 31 '15 at 18:47
  • 2
    Try creating a JAVA_HOME environment variable that points to your Tomcat root. Open a command shell and execute the startup command in the /bin folder manually. – duffymo Aug 31 '15 at 18:50
  • @Trobbins great link, thank you! If you want to put that as the answer you're welcome to and i'll mark it as right – DrMoney Aug 31 '15 at 19:29
  • @duffymo thanks for your help, trobbins link was what I was looking for though. Thank you! – DrMoney Aug 31 '15 at 19:30
  • @DrMoney I'd rather not, since I'm just linking to someone else's answer. How about I use that link to mark your post as a duplicate, and you can accept it that way? :) – CubeJockey Aug 31 '15 at 19:30

2 Answers2

0

I also faced the same problem. normally Netbeans do not allow to set the path to the tomcat which is installed by .exe file .. we should go for the installing the tomcat with the help of tomcat bin directory then Netbeans allow to start the server .

Raju
  • 143
  • 5
0

When you go to your server list, right click and select add server. In your selection pick Tomcat. Next it is looking for the 'Catalina' folder. Where you have unzipped the Tomcat folder, go through the folders inside and find the path to the 'Catalina' folder. Go back to your IDE and do the same thing; after you are in the 'Catalina' folder -> say ok and complete the rest of the steps. If you go through with this that means Tomcat has been successfully setup (you'll also need to put in a username and password ofcourse). Just deploy your project to Tomcat and test.

Ashish Patel
  • 163
  • 6