not able to get tomcat server running - startup.bat does nothing - java

when i click on startup.bat , nothng happens.
Here is what I tried - I made sure that i installed the correct version of tomcat, for windows xp 32 bit. yet nothing happens.
I also created the JAVA_HOME and gave it the correct location of my sdk
here is the error i am getting
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program

For Tomcat8 a minimum JRE7 is required, please add JRE_HOME in envrionment/system variable

put your tomcat/bin path in your class path and try to start server.

Related

Do I need JRE_HOME? Tomcat java environment version difference

Recently I had come across an error while running a basic webapp in tomcat.
The error was "class has been compiled by a more recent version of the Java Environment". I am using jdk-11.0.2 and jre1.8.0_201. Then I came across this page about setting tomcat server which says :
If both JRE_HOME and JAVA_HOME are specified, JRE_HOME is used
So I tried deleting the JRE_HOME variable and that solved the error.
Is this the right method to solve the issue? Is it possible to make JRE_HOME invisible for tomcat alone? Am I going to need JRE_HOME anywhere else?
So I tried deleting the JRE_HOME variable and that solved the error.
Is this the right method to solve the issue?
Yes. Based on your information , your web app requires Java version >8 to run. And what you do here is to ensure that Tomcat is using Java 11 to run which is the right direction to solve the problem.
Also , it is very normal that you only set JAVA_HOME but not set JRE_HOME because behind the scenes if you do not set JRE_HOME , Tomcat startup script (setclasspath.bat) will automatically set JRE_HOME for you based on the JAVA_HOME value.
You can also customize / override JRE_HOME or JAVA_HOME by creating a setenv.sh inside bin folder. All settings inside setenv.sh is only applied for the Tomcat :
export JAVA_HOME=/path/to/jdk-11.0.2

The system cannot find the path specified wildfly

I´m starting to learn Java EE.
I installed wildfly in Windows.
I already have JDK 8 installed and I have it set up in my Environment Variables as
JAVA_HOME C:\Program Files\Java\jdk1.8.0_05
As you can see JDK is installed in the default folder in program files.
Wildfly is installed in a specific folder(is the lastest version since I just downloaded. EAP 7.0.0):
C:\develop\wildfly\
I set up the Environment Variables of wildfly too. as
JBOSS_HOME C:\Develop\wildFly
I started the server in net beans and when I tried to enter in the Administration Console the server display a message that I needed to add a user and I should run add-user.bat
The problem is when I try to run this .bat file.
I get the error "The system cannot find the path specified"
Even though I found some questions concerning this issue I couldn´t find a correct answer since I don´t have any of the problems that the answers state that could make this error. (no JDK installed, not set up environment variables)
please tell me if you need further information.
For Windows OS open {WILDFLY_HOME}/bin/standalone.conf.bat
And Find JAVA_HOME
The Default value may like rem set "JAVA_HOME=C:\opt\jdk1.6.0_23"
Change it to
set "JAVA_HOME=PATH_TO_JAVA"
e.g. set "JAVA_HOME=D:\Java\Java8\"
For Linux do same in standalone.sh

Error when starting Liferay 7 (liferay-portal-7.0-ce-ga1): PWC6345: There is an error in invoking javac.A full JDK (not just JRE) is required

I am getting the following error when starting Liferay (liferay-portal-7.0-ce-ga1):
org.apache.jasper.JasperException: PWC6345: There is an error in
invoking javac. A full JDK (not just JRE) is required
I have set my system environment variables correctly:
JAVA_HOME: C:\Program Files\Java\jdk1.7.0_80
JRE_HOME: C:\Program Files\Java\jre7
I have added my JAVA_HOME path to my system Path variable:
....;C:\Program Files\Java\jdk1.7.0_80\bin;
When I run the windows where javac command, I get the following:
C:\Program Files\Java\jdk1.7.0_80\bin\javac.exe
What am I missing?? I have also tried using JDK 1.8 and JDK 1.7.0_79. Same results.
Thanks for your help!
After a lot of trial and error, and a lot of searching and several Windows Environment Setting Changes, I resolved this issue. I will point to the last 2 locations that led me to get over the finish-line because I had done some many things.
1) I made sure my JAVA_HOME pointed to my Java JDK (1.8.0_xx) and my JRE_HOME pointed to my Java JRE (1.8.0_xx)
2) I removed the C:\ProgramData\Oracle\Java\javapath; from my PATH variables (there were 2 PATH variables, removed from both)
3) Made sure my PATH variables (both) at the JDK Bin folder path: C:\Program Files\Java\jdk1.8.0_65\bin;
Then I checked my CMD 'where java' and received the correct response:
C:\Program Files\Java\jdk1.8.0_65\bin\java.exe
4) In Eclipse, under the top menu: Windows > Preferences > Java > Installed JREs
Here, I originally had the jre1.8.0_65, but I added the jdk1.8.0_65 and selected it.
5) Finally, what seemed to make the biggest difference:
Right-Click on your server, and at the bottom, select Properties.
A window will open up, and the 3rd option, there's clickable text "Runtime Environment". Click it and a popup will open, there will be a bottom drop-down under "Select runtime JRE" Here, I selected jdk1.8.0_65
That finally corrected the issue for me. Here are 2 links in reverse order.
http://www.huqiwen.com/2016/05/11/liferay-7-there-is-an-error-in-invoking-javac/
https://web.liferay.com/community/forums/-/message_boards/message/74821940?_19_threadView=tree
In your environment both JRE_HOME and JAVA_HOME are set. In this case Tomcat will prefer the JRE_HOME over the JAVA_HOME. JRE_HOME should point to a JRE while JAVA_HOME should point to a JDK.
You could just delete the JRE_HOME environment variable and Tomcat would automatically switch to JAVA_HOME so the isseue would be solved. If you want to keep the JRE_HOME in Windows you can change the setenv.bat by adding the following line as a first line.
set "JRE_HOME=%JAVA_HOME%"
This change will tell Tomcat that the JRE_HOME should be considered equal to JAVA_HOME and will not change your environmental variables.

Running sqldeveloper is throwing error "cannot find javaw.exe"

I installed sqldeveloper zip file in my system (windows 7)/. As soon as I clicked on sqldeveloper.exe, its throwing error "Windows cannot find C:/Program Files(x86)/Java/ jre1.8.0_31/bin/javaw.exe"
I dont understand why its giving error which has this path. In my system, I had installed JDK-1.7 64 bits. Previously I had installed JDK-1.8 32 bits. After removing JDK-1.8, I installed JDK-1.7 and changed the path variable also. Everything is working fine with java in my system. But SQLDeveloper is not being run. Please help.
You need to set your JAVA_HOME correctly.
In Windows:
Go to,
System --> Advance system settings --> Advanced --> Environment
Variables
If you don't have JAVA_HOME, then add the variable and set the value
For example,
C:\Program Files\Java\jdk1.7.0_71
In *NIX:
export JAVA_HOME=/<your_location>

Not able to start Jboss Server on run.bat

I'm getting a ClassNotFoundException when I run the JBoss Server using run.bat.
Updated:
The issue seems to be that your JAVA_HOME environment variable is not set to a JDK. Your screen shot shows a JRE for the JAVA_HOME. Switch that to a JDK and re-try starting JBoss.
Also the JAVA_HOME should be in your PATH environment variable.
Alternatively you can manually set the JAVA_HOME in the run.conf.bat file
your java path is not set to jdk and you have to configure java path in as java_home in standalone.conf.bat
and start with run.bat

Categories