XAMPP Tomcat/Error starting Tomcat - java

Can someone help me solve this:
"Tomcat Started/Stopped with errors, return code: 1 Make sure you have Java JDK or JRE installed and the required ports are free. Check the "/xampp/tomcat/logs" folder for more information."
I have installed Java JDK. Thanks

Go to https://youtu.be/JmmaeS7UZRk youtube link for better understanding:
we need to create an Environment Variable "JAVA_HOME".
and give the vale as JDK installation directory path.
Ex: "C:\Program Files\Java\jdk1.8.0_66"
we need to create an Environment Variable "JRE_HOME". and give the vale as JRE installation directory path. Ex: "C:\Program Files\Java\jre1.8.0_66"
Go to your "tomcat" installation directory and then "conf" folder. Ex: "C:\xampp\tomcat\conf".
Edit these given files with these values:
i) open server.xml file which is located inside conf folder. Go to line number "70" and change the "port" number "8080" as something else for example "9999" and save it.
ii) open context.xml file which is located inside "conf" folder and go to line number "19" and change <Context> tag as <Context reloadable="true"> and save it.
close the "XAMPP" App and restart it.
Now go to the "Config" Option inside "XAMPP" application i.e top right corner of the XAMPP app. then go to the "Service and Port Settings" then go to the "Tomcat" tab and put "9999" as the "HTTP Port" value and save it. Not restart XAMPP.
Now try to start "Tomcat" Server.
Open your browser and type localhost:9999 in the browser url and hit enter.

Run XAMPP with "Administrator Privileges" to start Tomcat.
It is as simple as that.

WINDOWS-KEY + PAUSE (shortcut to System Properties), in system properties choose
Advanced system settings --> Environment variables --> add a new System variable:
Fill in:
Variable name: JAVA_HOME
Variable value: C:\Program Files\Java\jdk1.8.0 (or whatever your location/version is)
klik ok and done(maybe you should restart tomcat after this)

Try to change your port. Maybe you have another app running in the port 8080.
If you run in the 8081 for example it will run correctly

Is your java registered in the enviorement variables.
If you open console Win+R -> CMD and write java --version (For JDK) and java -version (for JRE) do you get any output ?

Related

Java run command not opening

I had installed Java to work with Android Studio. Java works fine on Android Studio but when I try to use Java run command on my computer, it opens and closes immediately. How do I run Java on my computer?
Open command window (cmd on Windows)
Type java -version
You should see the installed java version output.
u need to add this path C:\Program Files\Java\jdk1.8.0_05\bin wheres javac.exe locate copy the path
1. go to System properties then click on advanced system setting .
2. click on Environment variables as picture describe
3. choose the path from system variables and edit it
4. go to end of the line and important to separate between variable values before paste javac.exe path make sure to put semi-colon and paste the path
There is a possibility that you have the following Registry setting configured:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System!DisableCMD
If you see the value 'DisableCMD' in the above location then simply delete it.
If you are not comfortable with editing the Registry then you will find this setting by going to:
Start > RUN
Type gpedit.msc and press OK
Navigate to: User Configuration > Administrative Templates > System
Look for the option 'Prevent access to the command prompt'
Double click it and choose 'Not Configured'

SQLdeveloper doesn't start

When I try to run SQLdeveloper, appears window with text "Please specify the path to the Java JDK home (e.g. C:\Program Files\Java\jdk):". I enter my path, window appear again. I enter my path again, and that's all. Nothing happens. What I should do for SQLDeveloper start?
JAVA_HOME set to H:\programs\Java\jdk1.8.0_11 .
File sqldeveloper.conf has text "SetJavaHome..."
C:\Users\username\AppData\Roaming\sqldeveloper\1.0.0.0.0\product.conf has text "SetJavaHome..." too.
First you need to set java classpath in order to run sqldeveloper.
Steps To Set java ClassPath
1.Right click on mycoputer.
2.Select Properties.
3.Left side of the my computer properties select Advanced System Settings.
4.Select Environment Variables.
5.Select path in System variables.
6.Click edit, at the end of the text add ; then past your java/bin path.
in my system it is--> "C:\Program Files\Java\jdk1.7.0_51\bin"
7.Now open your sqldeveloper, it will open for sure.
Delete the java.exe and javaw.exe in the following path
"C:\Windows\System32"
Set Environmental Settings for your account or for the entire system if you are a admin
Setting for Entire System
Mycomputericon >Right click>select properties>select Advanced System Properties>click Advanced Tab>click Environmental Variables>create a
System variable names "JAVA_HOME"(any thing can be given but
specific to name is better) in Vairable Name and for Value give the
JDK path up to "bin"
-Put JAVA_HOME in the Path vairable's value.
For User Variable same process but in UserVariable section
Hope this helps!
.
I think supported library files of sqldeveloper in your system are deleted,affected by virus or corrupted. So download fresh copy of sqldeveloper and try again.

Java command not found

I'm trying to get the java command to work on my computer. Whenever I try to use it, I get the error "'java' is not recognized as an internal or..."
What I've done
So far I've traced the issue through my system environment variables, which has a variable PATH that links to "C:\ProgramData\Oracle\Java\javapath" or javapath for short.
There are 3 files in the javapath folder, and if you click on them a popup says:
But when I examine the properties of the shortcut and click "open folder location" it sends me to the right place (?? what is this).
Just in case, I tried to recreate the shortcut; I called it java2 and it now works (opens a command box for a split second and closes) when I click on it. However, testing it in command prompt with the line "java2 -version" returns "'java2' is not recognized as an internal or external..."
Details
I just installed java 8, and I've verified that it was installed correctly
I'm running a 64 bit windows 7 OS
Have you checked your environment variables for Windows? When you installed the JDK/JRE the directory should have been added to the PATH variable. The directory added needs to contain the java.exe executable. It should be located in C:\Program Files\Java or something like that if you installed it using the default settings. Once you find that directory find the bin directory inside it.
In order to check that:
Right click My Computer and hit Properties
On the left side hit Advanced System Settings
Hit the Advanced tab and then Environment Variables down at the bottom
Find the PATH variable and then hit edit. Confirm that the location of the JDK /bin directory is there, if it is not then add it.
Also, if the JAVA_HOME variable isn't already set, this may be a good idea.

My Tomcat is not running it just open and close when I click on tomcat7.exe [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
I am installing Tomcat 7 in my PC it works in Eclipse but when I try to open in bin/ tomcat7.exe it just open and closes, (I am stopping the server in Eclipse). Also, in Eclipse I'am trying to open admin console like URL:(localhost:1234/admin) it shows 404 error. Can anyone who knows this problem explain a solution?
If you are using Windows, you can follow the following to run tomcat7.exe :
Open your Command prompt (cmd)
Set your JAVA_HOME or JRE_HOME. Eg. set JRE_HOME=C:\Program Files\Java\jre7
Go to the directory of your tomcat. Eg. cd C:\Program Files\apache-tomcat-7.0.35\bin
Run startup.bat file. Eg. startup.
This should start your tomcat server without using Eclipse.
First Set JAVA_HOME and CLASSPath path
For Windows Java Path Settings
Right click on Computer and open Properties.
In Windows Vista or Windows 7, go to Advanced System Settings.
Else go to next step. Go to Advanced Tab and click on Environment
Variables button.
Select CLASSPath under the list of System Variables, and press Edit and add If CLASSPath not available there click New button add
C:\Program Files\java\jre 1.x.x_xx\bin
after a semicolon.
Now click on New' button under system variables and enter
JAVA_HOME as variable name and path to jdk home directory (ex.
C:\Program Files\Java\jdk1.x.x_xx
After Completing Java Path Settings
Go to the directory of your Tomcat. Eg. cd C:\Program
Files\apache-tomcat-7.0.35\bin
Run startup.bat file
To start your application server in Windows :
Open command prompt .(Run as Administrator).
Go to the path (..\apache-tomcat-8.0.27\bin) and run startup.bat
A new command prompt opens up and should stay unclosed to tell your server is in running state.
If command prompt opens and closes automatically, then the reason can be as below.
tomcat is already in started state in Eclipse.
Check the connector port configured in server.xml file and check if that port is free in your local machine. [netstat command]
Change the connector port to some unused port, preferably in 80XX series.
Let me know if you are able to invoke localhost:(the http connector port) you have configured in server.xml through you web browser.
You don't start Tomcat by double clicking the exe, use the batch files instead.
startup.bat starts the server, shutdown.bat stops it again.
And ignore the advise to get the service installer. You don't need those unless you want the server to start on system boot and run in the background. Which you don't want unless you're going to configure a production server, which you aren't here.
The batch files are in the same directory on your computer as the exe.
you have to set JAVA_HOME and JRE_HOME in System environment.while setting the JAVA_HOME and JRE_HOME, you should assure that JRE path that you are setting is corresponding to the JDK whose path you have set in JAVA_HOME. some time what happens that there may be more than one JDK in the system so conflict occurs. better to have only one JDK and corresponding JRE.
This is probably due to a bad setup of an environment variable.
For example, if you setup incorrect JAVA_OPTS, tomcat startup will fail.
You can check your configuration by calling : catalina configtest
Here an example of the output for bad setup of JAVA_OPTS :
Error occurred during initialization of VM Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
It works for me after updating the jdk path in JAVA_HOME compatible to your tomcat version in user Variables.
the JAVA_HOME and JRE_HOME environment variables set should not have semicolon or ; at the end...I was facing similar problem...removed semi-colon or ; from the end and tomcat server started from cmd screen after running startup command(of tomcat..bin folder).
I checked environment variables and compiler version everything was fine, deleting junk files from work folder worked for me.
Just download the tomcat 32-bit/64-bit Windows Service Installer (pgp, md5) as in this set up is given which will install tomcat on your PC and you can also start and stop tomcat using the tomcat service.
In my experience tomcat7 might not like it if JAVA_PATH or JDK_PATH contain bracket symbols like in "Program Files (x86)". Make sure you format path in your environmental variables correctly or move your JDK to another folder.
In my case, I had some reference to a jar file in catilana.bat, but the jar I had removed from my system. Tomcat started successfully once I removed that reference from catilana.bat
Check your JRE_HOME location in environment variables. if it didn't work then try
1). Open CMD in administration mode.
2). locate to your tomcat directory.
3). run startup.bat --->> It will show your problem.
Had the same problem with Apache Tomcat 9 version.
Solution is very simple.
Apache Tomcat 9 is supported by Java 8 and later versions. So, I had JRE_HOME with JRE7 path, I binded it to new JRE8 and everything works fine.
Different versions of Apache Tomcat are available for different versions of the Servlet and JSP specifications. The mapping between the specifications and the respective Apache Tomcat versions is:

How to start JBoss AS 7.1.1 on Windows?

I am new to JBOSS.I downloaded jboss-as-7.1.1.Final.zipand unzip this zip file.
Then I go to bin folder and double click on standalone.bat but new cmd window open and close within 2 -3 sec.
I tried to start server throught cmd.I open cmd in 2 ways
1.normally mode
Run as Admin (Admin Mode).
In 2 ways I get:
Calling "P:\Software\JBOSS\jboss-as-7.1.1.Final\bin\standalone.conf.bat"
'findstr' is not recognized as an internal or external command,
operable program or batch file.
then it stops.
So the JBoss server does not start.
I added Environment Variables like.
JBOSS_HOME : P:\Software\JBOSS\jboss-as-7.1.1.Final
JAVA_HOME : C:\Program Files\Java\jdk1.7.0_21
How can I run JBoss server and deploy projects in it on Window 7?
Add the following value to Right Click My Compuer -> Advanced -> Environment Variables -> System Variables -> Select Path variable -> append the below value.
C:\WINDOWS\system32
It should work with that change.
#All, Finally I got it,why I am getting this problem 'findstr' is not recognized as an internal or external command, operable program or batch file.
Because the following path C:\Windows\System32 was not set in Environment variables. I found through google.I fix it and run my server it's working great.
Thank you guys for your valuable suggestions.
You have to go to your bin folder P:\Software\JBOSS\jboss-as-7.1.1.Final\bin\ and then execute run.bat or standalone.bat
If you still get errors, you should delete your entire JBoss folder and then install it again and try to run it with the default settings. Once you've confirmed that works, change the settings 1 by 1 so that you know which setting caused your server to not start up.
You could better add it in to any IDE(eclipse) and then deploy your application. That should be easy to manage your applications

Categories