I have a problem when running asadmin. When I double click on asadmin.bat file, the command prompt starts, than it opens a java black window (also a prompt), but both windows close instantly. If I run "asadmin" command from PowerShell (I use Windows 10), it opens a prompt and closes it instantly. PS just goes to the next line. Windows cmd behaves in the same way (just skips to the next command without writing anything).
I have tried to define path system variable. Before I did this the cmd just didn't recognize asadmin command. Yesterday I defined path for java home to be bale to run jar files (if this is relevant). If I run any of my jar files, they work fine, but there is black cmd running as well (perhaps it's because i defined system variable to java.exe and not javaw.exe (the later option just didn't work)). Though, if I double click on java.exe the window pops and disappears
What can I do? Any piece of advice will be appreciated.
P.S. GlassFish 5, jdk 10.0.2
It seems to be version incompatibility
Think "asadmin" is litteray saying "as administartor". Maybe you are trying to start a domain ?
Open the windows search menu by pressnig the windows button.
Type CMD in the search field. Results appear.
Right lick the CMD and select run as administrator.
Navigate to your run file location using the CD command."asadmin" file in your case.
Try running asadmin command from that window.The window shouldn't dissapear.
Related
I am trying to install Java in Windows 10 Home (64 bit). Like many tutorials point out, I downloaded the Java jdk setup file, executed it and once installed changed the Path in the Environment Variables. But for some reason, when I execute the command 'javac' it returns the not internal/external command error in Command Prompt but runs absolutely fine in Powershell. I tried to rectify this by uninstalling Java and reinstalling it very carefully, following all the steps but still this keeps on happening.
Also, during installation of Java, I lost the original value to my Path variable. Could this be causing the problem?
Edit : I was able to get the java command running in the command prompt but javac still won't work. I've already tried the methods suggested on other forums and this one but no luck so far.
See there is no problem with Java installation if you can find JDK(Java development kit) and JRE(Server Java runtime environment) in programme files in windows in a JAVA folder.
The main problem is with the environment variable declaration.
Go to environment variables and make a new path for that.
JAVA_HOME = "YOUR JDK & JRE INSTALLATION PATH"
And another one is
JAVA = "YOUR JDK & JRE INSTALLATION PATH"
Hope that help to you. After doing that if still there problem persisist just restart your PC and check again.
Just add your variable location up to /bin/
Refer to this :
https://www.windows-commandline.com/javac-not-recognized-internal-external-command/
Open file explorer
Right click computer then click properties
click advanced system settings
click environmental variables
click path (for me there was one in user variables for admin and another in system variables)
find the directory for javac (for me it was here C:\Program Files (x86)\Java\jdk1.8.0_191\bin)
so go back to file explorer and open program files x86
then open the java folder
then open the jdk folder
then open the bin folder
highlight the path in the search bar and copy it
click edit on path and paste into the path in the environmental variable for both(if you have more than one path)
If no path exists then create one in user variables
If there is any existing text place a semicolon ; between the text you pasted in there and the preexisting text.
close command prompt and reopen it.
type javac -version
the version info should be listed
This problem comes up with the directory of your command prompt.
check your PowerShell and command prompt default directory.
We can run command prompt as WinKey+R then type cmd, Hit the enter button then check our java version cmd javac -version.
I know that you can install processing-java using the tools menu in processing 3 app but it only works in macOS. In windows there is no option to install processing-java from the tools menu.
Furthermore, I tried installing using the 'processing-java.exe' in the installed folder ;
but it will just open a cmd window and it will get closed as soon as it pops up.
Additionally, I tried typing the command processing-java in cmd prompt and it says it isn't a command. Finally, can some tell me how to install processing-java.
You don't have to install anything, and processing-java.exe doesn't actually display anything. You need to run it via the command line, and you need to give it arguments to work.
Open a command line to the directory that contains processing-java.exe and then type processing-java.exe and hit enter. You should see an output of the arguments you can feed the tool.
Also note that 99% of Processing users never have to touch this tool, so make sure you actually need it before you try using it.
Without installing processing-java from the tool menu in the Processing app, you can still execute it in the console from anywhere using its full path, e.g. C:\Users\yourname\Documents\processing-3.4\processing-java.exe.
A command to run a processing sketch can be C:\Users\yourname\Documents\processing-3.4\processing-java.exe --sketch="C:\Users\yourname\Documents\sketchFolder" --run.
Not sure if this is right place to ask, but I recently had to reinstall Windows 10 on my laptop along with all my other programs that I had previously. One them was Mars editor for MIPS. I could not get to run by double clicking it. A message box would pop up with this error.
But when I go into command prompt and cd in to the folder where this is store and type the command java -jar Mars.jar the editor opens just fine. I tried deleting and uninstalling both Mars and Java and then reinstalling them, but that didn't change anything. This is the page where the download page for Java is attached and download for the Mars editor, so I know I'm downloading the right things.
Anyone else have this same issue?
This wasn't really the answer I was hoping for, but this works none the less.
Create a batch file with the following
#echo OFF
cd "C:\Users\<username>\<folder destination of .jar file>
start javaw -jar <filename.jar>
when doubled clicked this will open up the editor.
While this does work, I'd still like to know why this error occurs.
I have been doing research on why Java keeps closing immediately upon opening it. I am on Windows 10 and running on a 64 bit. I did install the correct Java download for Windows 64 bit. I have uninstalled it and installed it about four times but nothing seemed to help. I also double checked to see if it was up to date and it was at the latest version. I am unsure why this problem is occurring.
Any advice?
You should not directly run java.exe from the jdk bin path. You must do it in command prompt. The main thing is if you are not using any IDE and trying to write your code in any editor then manually run it. then you have to set java path as environment variable.
Watch this video to do that https://www.youtube.com/watch?v=l1VxWWubxFo .
Then write a simple java program , save it with .java extension.
Then open cmd there where you have written the program by holding shift key and right click on the file explorer, you will see a option like open command window here.
Then write javac <your java file name with .java extension>.
Then write java <your class name in the program>. Ignore these < > angle quotes
I am trying to use this GUI mod for a Minecraft Server. I wrote a batch file so the server can start with more RAM. When I run just the .jar file, no command window opens and it runs just fine (of course with about 256mb ram) I was reading online that javaw starts a jar file without a command-line-console. But when I use javaw, the command console opens, but when I close it the program remains open. this is my batch file:
#echo off
"%ProgramFiles(x86)%\Java\jre6\bin\javaw.exe" -jar -Xms1024m -Xmx1024m crafty.jar
#echo on
I don't understand java as well as most, so please try to be as clear as possible. Thanks
If you want to start a java program without console popup under windows, this should be helpful:
In command prompt type the following:
start javaw -jar -Xms1024m -Xmx1024m crafty.jar
If you want you can also write this as a batch file.
You should Create Shortcut of "%ProgramFiles(x86)%\Java\jre6\bin\javaw.exe", let's name it as Minecraft, then
edit the Properties of Minecraft shortcut. In the Target textbox, append -jar -Xms1024m -Xmx1024m crafty.jar in the end of javaw.exe
change the Start in as the folder which contains the crafty.jar
Double-click the Minecraft icon to star the server.
That's all.
Create a .bat file with
start javaw -jar yourjar.jar arg0 arg1
start javaw -jar yourjar.jar arg0 arg1
will open the console, but close immediately. it is different from running window .exe.
You will always get the command window opening and closing because you are starting it inside a command window or batch script (which launches an implicit command window to run itself).
In order not to get a command window you must open the file from "not a command window" i.e. an executable launcher.
Take a look at Launch4j which can run a java program from an exe. It can also hide-away the jar file inside the exe if you like.
http://launch4j.sourceforge.net/
There's a little YouTube clip showing them creating an exe from a jar.
A batch file is a way of starting the command prompt with the code pre-written, using javaw is a way of open then closing the prompt. Like I said a batch is a commands prompt you can't stop it from opening.
It's few years, but for windows today as for linux you have the supervisor (pytho based)
supervisor windows based on python