Error when running add-user.bat for Wildfly server - java

I'm trying to access the Administration console for Wildfly, but first it says I must
run the 'add-user.bat' file in [server installation directory]/bin/
Which I do but then get an error saying, well, look:
When I simply try and run the file by double clicking it I get:
I'm running Windows 8.1 64bit (Urgh) and Java 8

This might help. try using cmd /c add-user.bat or just run add-user.bat without any command before it and Check Java home path.

Related

Tomcat localhost:8080 "sent an invalid not opening/tomcat doesn't start

I was having issues installing and running tomcat today and had to do a lot of research to get it running. I'm putting my solution here in case anyone runs into the same problem.
When I opened the url localhost:8080 in my browser, I would get a "refused to connect" error. I checked if the port 8080 was being used by another service, and it was not.
I then noticed that tomcat wasn't starting. I tried opening it through services but that didn't work either. Later services showed tomcat stuck in the "starting" status. I then tried to run tomcat through the command prompt with these commands.
cd: c:/filepathToTomcat/bin
bin>startup`
That gave me this error
jre_home variable undefined and java_home variable undefined
Using the solution to
https://stackoverflow.com/questions/18468681/tomcat-6-java-home
I created a setenv.bat file in the tomcat bin and set the java_home variable.
My setenv.bat file contained
#ECHO OFF
set "JAVA_HOME=C:\Program Files\Java\jdk-19"
set "JRE_HOME="
Tomcat still wouldn't run. A solution on
https://stackoverflow.com/questions/5398654/tomcat-not-starting
suggested using "catalina.bat run" on the command prompt instead of startup.
This showed that tomcat wouldn't start because it couldn't get the java virtual machine to run. I then uninstalled and reinstalled java and tomcat started working for me.
I used Java version 19 and tomcat 10.1.5 on a windows 11.

Command 'cmd' not found, but there are 16 similar ones

I'm trying to run a java program on windows in VSCODE. When I click the run button at the top it opens the Java Process Console and runs the following command:
$ cmd /C "c:\Users\user\.vscode\extensions\vscjava.vscode-java-debug-0.31.0\scripts\launcher.bat "C:\Program Files\AdoptOpenJDK\jdk-11.0.10.9-hotspot\bin\java.exe" -Dfile.encoding=UTF-8 #C:\Users\jbree\AppData\Local\Temp\cp_7gau2431e54dxprosf092viw9.argfile com.example.restservice.RestServiceApplication "
It then prints out: Command 'cmd' not found, but there are 16 similar ones., and I'm not too sure what to do afterwards.
I just ran into this exact issue! After some debugging, I found out it's because my terminal (in VS Code) was running off of WSL.
Make sure to check which terminal you're using! If you're trying to run Java locally, then you can configure a default shell ie. bash.
Let me know if this helps.
Edit: I also found this, not sure if it will help, but here you go!
https://stackoverflow.com/a/58058378/11060097
your java debugger is using wsl. and most likely your java is installed on windows. not linux on windows. to fix this for me, i changed the settings for java debugging to use the external console. settings->java debugger->externalTerminal . this will then use the "external windows" setting for vscode. which should use cmd.exe (the windows shell, no linux).
This error happens because you probably have wsl has your standard terminal but it's probably configured to launch cmd using a windows path.
WSL won't understand what that windows path is, so you need to change it using a path structure it can understand
So
hit Ctrl+, to hit the Settings screen
type in terminal to see all the terminal settings
You will see an option called Terminal> External:Windows Exec
Change C:\Windows\System32\cmd.exe to /mnt/c/Windows/System32/cmd.exe
I had this error too and came here initially but I managed to figure out it was an incompatible path issue that was the cause.

Start Eclipse on MacOS from Java Command line

I'm working with an older version of Eclipse, Helios SR1.
I need to be able to start eclipse from the terminal.
In review of http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F
I execute the following command in Terminal to start eclipse.
/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -jar plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
and I get
Root exception: java.lang.NoClassDefFoundError:
org/eclipse/swt/SWTError
So this appears to be more complex than what was found in the above link. If I double-click the Eclipse.app it starts right up.
I'm wondering what else needs to be done to allow the Command Line Eclipse Launcher to work properly
You should just be able to use the open command:
open /path/to/eclipse.app
or
open -n /path/to/eclipse.app
will open a new instance of Eclipse even if one is already running.
If you must use the Java command you need to specify -XstartOnFirstThread before the -jar option:
java -XstartOnFirstThread -jar ...
Use the eclipse launcher binary:
<Your-Install-Path>/Eclipse.app/Contents/MacOS/eclipse
Default start-up options are set in eclipse.ini:
<Your-Install-Path>/Eclipse.app/Contents/Eclipse/eclipse.ini
Kepler start-up options are documented here: https://help.eclipse.org/kepler/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html (Helios link redirects to Kepler, the oldest one they have kept available)
The launching process is explained in detail here: https://help.eclipse.org/2019-03/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/launcher.html

Executing windows batch script on Jenkins

I am building a project using Maven and using Jenkins for continuos integration. After the maven build i am getting an executable jar in my target folder which i am trying to run using a windows batch command as build step. But when i put the command in the box under execute windows batch command i get the following error
"cmd /c call /tmp/hudson2033384960131825453.bat FATAL: command
execution failed java.io.IOException: Cannot run program "cmd" (in
directory "/hosting/workspace/myProject"): error=2, No such file or
directory""
I am using mac OSX 10.9.3. The jenkins is deployed in a remote server which i don't have access to.
I want to execute this jar file as a build process. How can i do it?
You should not be expecting a windows batch command to be able to run on a mac. Jenkins is pretty cool, I agree, but it isn't magical.
Also, yes, it is a little confusing that the option is available to you even though you are on a Mac, but its there incase you have a linux / mac master with windows slave: https://issues.jenkins-ci.org/browse/JENKINS-17010?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab
You cannot execute a windows batch command on mac or linux, end of story.
You are trying to launch windows command through jenkins on another operating system which is not going to work

visualvm cannot see a java process launched from cygwin

If I start a java process in a cygwin console, and then launch visualVm, the later cannot see the former.
If I start the same process in a Dos console visualvm sees it fine. I am in jdk1.6.0_25. This happens both in win7 32b, and in win7 64b with a 64b jvm.
Anyone can think of an explanation/workaround?
I fixed the problem by running VisualVM from within Cygwin. If you prefer not to profile using a remote JMX connection, you can run both VisualVM and your Java program using Cygwin:
Open the Cygwin Console window, navigate to visual_vm.exe and run that file from within the Cygwin environment.
I had the same problem. The vm was not shown automatically but I was able to connect via "Add JMX Connection", using hostname and jmx.remote.port...
On VisualVM go to File -> Add JMX Connection
localhost:3333
Add vm parameter at startup e.g.:
-Dcom.sun.management.jmxremote.port=3333
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
VisualVM can automatically detect local applications running under the same user. So one explanation can be that cygwin process is running under the different user. Make sure that both VisualVM and monitored application is running under JDK 6 update 25. JDK 6 update 25 has a fix for the following JDK bug #6938627, which can affect your case.
The opposite approach to #seanhodges answer is to launch the application to debug with a modified environment, pointing it back to your Windows User Temp directory
For example if you normally do:
./gradlew run
And say your TEMP directory on Windows (according to your User environment variables) is:
T:\Temp
You can do one of these instead:
TMP=T:\\Temp ./gradlew run
TMP=/cygdrive/t/Temp ./gradlew run
(they both seem to work)

Categories

Resources