0

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

  • In cmd (if run as admin) both java and javac -version commands work fine. javahome is my jdk folder. path jdk\bin. I ran asadmin as admin and got NullPointer. if i execute java.exe in cmd, it gives a lot of information –  Mar 18 '20 at 17:03
  • JAVA_HOME (sorry for ambiguity) is C:\Program Files\Java\jdk-10.0.2 and path is C:\Program Files\Java\jdk-10.0.2\bin (actually %JAVA_HOME%\bin) –  Mar 18 '20 at 17:07
  • I have only jdk-10.0.2 folder, no jre of any sort. When i checked folders inside my jdk with oracle's website list, it matched. But my eclipse says that I am using jre, so I'm confused (maybe jre was renamed to jdk, but commands javac and java work fine) –  Mar 18 '20 at 17:11

1 Answers1

0

Think "asadmin" is litteray saying "as administartor". Maybe you are trying to start a domain ?

  1. Open the windows search menu by pressnig the windows button.
  2. Type CMD in the search field. Results appear.
  3. Right lick the CMD and select run as administrator.
  4. Navigate to your run file location using the CD command."asadmin" file in your case.
  5. Try running asadmin command from that window.The window shouldn't dissapear.
Georgi D.
  • 52
  • 6
  • @Felipe Bonadykov You should really provide more information on what exactly are you trying to do with that command.What exactly is your case.In this case yout not trying to run Java you are trying to run a specific server GLassFish in your case. What are you trying run this server for? Nullpointer exceptions in Java usualy have a fat stack behind them post the exception stack too so we know what are we working with. – Georgi D. Mar 18 '20 at 17:02
  • I'm learning Java EE course, and part of the task is to run glassfish server. but it seems that glassfish 5 is not compatible with jdk 10, though in description it says jdk 8 +. Is there a way to get around this problem? Or any technology very similar? –  Mar 18 '20 at 17:47
  • @Felipe Bonadykov If official glassfish documentation says there is no compatibility with jdk 10, better downgrade to jdk 8. Uninstall java and install jdk 8 you can find the different versions on the oracle web page. – Georgi D. Mar 18 '20 at 17:57