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.
Related
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.
I've been googling for the better part of 4 hours and nothing I've tried has had any effect. This is your typical JAVA_HOME while configuring android studio on a machine for the first time problem it would appear. I've added literally everything to environment variables and path that I can think of. I've tried reinstalling JRE/JDK/Android Studio many many times. I've tried deleting .android and ..\Local\Temp items. I've tried running android.bat as admin. Nothing helps.
I can run find_java64.exe directly and it actually gives me the correct path, but in the batch file it says it can't find that file. The only thing I noticed is that it says "...Local\Android\sdk\tools\lib\\find_java64.exe" -s with two slashes instead of one after lib. That seems strange but not like it should cause it to not find it... and if I copy-paste the entire path with executable from the error line into command prompt (including the two slashes) it DOES show the JDK location correctly.
Why does the script not work if the line works in isolation? I can't do anything if this batch file isn't going to work.
Edit: I've been trying some more today. The core issue seems to be that when batch files are attempting to run other scripts/executables, windows always throws a is not recognized as an internal or external command, operable program or batch file." error. I've been tracing this through script after script from android.bat to find_java.bat. If I manually execute the command the batch file is trying to execute in command prompt, it works fine, but the batch file says it's wrong. Another suspicious thing seems to be that I cannot double click on ANY batch files in the computer. I can only open them as admin or from command prompt. Starting to think this is a very computer-specific problem.
If anybody else is seeing this, there's a real problem on your system when you can't launch a BAT file by double clicking it.
Something you could test on your machine is drop into a cmd shell then using the ftype and assoc builtins to check these are the defaults:
➜ ~\scoop\apps\android-sdk\current\tools\lib $ cmd
Microsoft Windows [Version 10.0.19041.572]
(c) 2020 Microsoft Corporation. All rights reserved.
C:\Users\cwalsh\scoop\apps\android-sdk\current\tools\lib>assoc .bat
.bat=batfile
C:\Users\cwalsh\scoop\apps\android-sdk\current\tools\lib>ftype batfile
batfile="%1" %*
If it's still broken you might need to dive into the registry and figure out why the .BAT file extension has a different program associated with it.
I am trying to change my java version because of compiler errors when running mvn install via the windows command prompt.
I changed the JAVA_HOME variable and made sure that it is referenced in the PATH variable (##EDIT##: had been done like this %JAVA_HOME%\bin;%PATH%;).
When I open the command prompt in the folder where my pom.exe is located (using the Windows 7 'Open command window here' shortcut) and type java -version the unchanged java version is displayed.
I made sure to close all instances of command prompts before starting a new one.
Strangely I discovered that when starting the command prompt via the Run dialog in the start menu (by typing cmd) the result of java -version is the desired version.
You need to modify path variable as well as below:
PATH=%JAVA_HOME%/bin;%PATH%
Post that make sure you open a new command prompt and rerun maven command.
When using the 'Open command window here' shortcut make sure to close and open the respective explorer window. When starting the command prompt in this way Windows uses cached environment variables and does therefore not retrieve the current version of java.
Took me a while to figure out because it was too surprising to expect this behavior. Before I was searching on google and stackoverflow.com without any results. Hope this saves someone the trouble.
In my case worked the following: after editing the environment variables, and checking by command line java -version and javac -version, javac was updated but not java, so you have to do it by command line also
set path=C:\Program Files\Java\jdk1.8.0_181\bin
Remove the existing JRE setups..
Install the one that you need to install.
Hope you have added it in the environment variable and path via settings... Test it, it should work!.
The same thing happened to me long ago, It was pointing to the older JRE, got stuck, so removed the existing JDKs and installed a fresh copy. It worked.
I too faced this problem where I want to change the java version in command prompt but failed. But finally I succeeded doing the below steps. First I'll show the failed attempt, followed by the actual success step so you will know the difference.
Failed Step:
1. Win + R
2. Type cmd and hit enter
3. Type java -version (Just to check if the version is the old one which we need to change)
4. Now try changing the path/classpath using set path=/classpath=
5. Now again type java -version(This will still show the old java version but not the new version which we set)
Success Step:
1. Win + R
2. Type open command window here and hit enter
3. Type java -version (Just to check if the version is the old one which we need to change)
4. Now try changing the path/classpath using set path=/classpath=
5. Now again type java -version and voila I see the changed java version here
Thanks!
I had the same problem too. After setting the JAVA_HOME, i couldn't see the new value in command prompt even though I started a new command prompt.
Strangely, it only occured when opening the command prompt from the Windows Explorer.
I faced this issue too. I changed the JAVA_HOME in the environment variable and then when I opened cmd and typed java -version, I've seen older version. Then, I deleted javapath file in C:/Program Files/Common Files/Oracle/Java. My issue has been fixed in this way.
I added a value at:
HKLM\Software\Microsoft\Windows\CurrentVersion\Run
That looks like this:
Value Name: LDE
Value Data: "java -jar C:\LDE\lde.jar"
Really with the quotes (Because all the others where also with quotes). After adding this, I restarted my computer, but it didn't start automatically.
Will wrapping my jar in an exe help?
I'm running Windows 7.
Any help?
Thanks in advance.
Update:
When I remove the quotes, it works. But now there is appears also a terminal, which I don't need...
A couple of things to note here, concerning the two different issues in the problem:
Format of Windows Run keys
From the Microsoft Windows XP knowledge base:
Run keys cause programs to
automatically run each time that a
user logs on. The Windows XP registry
includes the following four Run keys:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
Each of these keys has a series of
values. The values allow multiple
entries to exist without overwriting
one another. The data value for a
value is a command line.
Note the emphasis on the last line. The moment quotes are used, the command is bound to fail execution in the same manner it fails as if executed from a command prompt.
Also, note that the above approach is for Windows XP and does hold good for Windows 7. More details can be found in this Microsoft Technet article on the options available in Windows 7.
The javaw vs java application launcher
Once the java process can be initialized at Windows startup, one will get a console window that continues to stay around until the process is terminated. This occurs if the java executable is utilized to initialize the application.
From the technotes of the java application launcher:
The javaw command is identical to
java, except that with javaw there is
no associated console window. Use
javaw when you don't want a command
prompt window to appear. The javaw
launcher will, however, display a
dialog box with error information if a
launch fails for some reason.
Therefore, if you wish to avoid opening a console window for the Java process, you ought to use the javaw executable.
This is very simple. You will find the startup folder in the C:/Documents and Settings/AllUsers/YourUserName/StartUp. It will be on similar kind of path just check it. Then just paste your jar file in that folder and it will work nice. Remember that you put the jar file in the startup folder of your user name folder. You may find that this folders might be hidden so just check it out. If you find this answer useful vote it. Enjoy.....
You launch a java program from a console (maybe using a .bat script).
I don't want the console to remain visible, I want to hide it.
Is there a simple way to do this ? Without JNI ?
Use javaw.
http://java.sun.com/javase/6/docs/tooldocs/windows/java.html
The javaw command is identical to java, except that with javaw there is no associated console window. Use javaw when you don't want a command prompt window to appear. The javaw launcher will, however, display a dialog box with error information if a launch fails for some reason.
You can start a java application with start javaw. It will hide the black console window.
This .bat trick works for general programs so I think it should also work for launching java program:
Call start program instead of just program in your .bat script
You can hide the console by using javaw.exe (java without) instead of using java.exe.
One of the most useful associations to set up is to make *.jar files executable with java.exe. Then you can just type the name of the jar on the command line to start it executing.
If you use javaw.exe rather than java.exe you won’t see the console output. Watch out, Java installers often associate *.jar files with javaw.exe instead of java.exe, overriding your setting.
download jsmooth and create your own custom exe in a minute or two. Then just use that exe to launch your java app. You can even get slick and bundle a JRE with your app.
http://jsmooth.sourceforge.net
In case fo running from but file your script should look like
start javaw start javaw -jar ***.jar
Note, that you may need running javaw.exe by providing full path to the file, that may need adding quotes " in case there are spaces in the path. The quotes will trigger recognition of them as "title"-argument for the "start" command.
So, use following correct format:
start "MyTitle" "c:\Program Files (x86)\Java\jdk1.8.0_202\bin\javaw.exe" -jar myApp.jar
where title can be empty if needed