First off, let me say I did all of this while watching this video: https://www.youtube.com/watch?v=Hl-zzrqQoSE
So, I tried downloads jdk-8u60 for windows 64bit, as seen right here: http://www.oracle.com/technetwork/java/javase/downloads/index.html (JDK), but when I first installed my antivirus Avira did a system scam, I don't remember if it was for java or not, but just pointing out.
I also got a strange error, saying that there is a missing file inside the bin folder (I can't get that error again, sorry folks). When I try to run "javac" on CMD it says "java is not recognized as an internal or external file" (my computer is not on english, sorry), so I went to check and the folder is like this:
As I can see, there is a lot of missing files compared to the guy's videos, and I wonder what could have gone wrong.
I tried:
Doing the rest of the video to see if it could at least works
Running the installer again (it runned completely fine, like if it was first time, but did no stuff). On the first try I got that same error, but lately I haven't got it again
Checked other folders
I can't see to find the solution. Any help?
You need to add the JDK bin to your path. You can do this by going to Control Panel > System and Security > System > Advanced System Settings > Environment Variables > System Variables > path > edit. Then, you need to add this to the path:
;C:\Program Files\Java\jdk1.8.0_60\bin
WARNING: this is highly dangerous! if you delete parts of the path, your computer might not function properly! Be extremely Careful!
Apparently I downloaded the wrong java, my system is 64 bits (which means x64) and I downloaded JDK x86 (which is 32 bits). Just deleting all the JDK and JEK files and reinstalling using the correct one completely fixes it. Remember to use the "path" fix too:
Blockquote
You need to add the JDK bin to your path. You can do this by going to
Control Panel > System and Security > System > Advanced System
Settings > Environment Variables > System Variables > path > edit.
Then, you need to add this to the path: ;C:\Program
Files\Java\jdk1.8.0_60\bin
WARNING: this is highly dangerous! if you delete parts of the path,
your computer might not function properly! Be extremely Careful!
-Ethan Ferguson
Related
I have written a program appletExample.java.
c:/users/set path = "C:\Program Files\Java\jdk-16\bin"
c:/users/desktop/jp>appletviewer appletexample.java
The error is"
'applet viewer' is not recognized as an internal or external command,
operable program or batch file.
I am getting this error. But set path is also correct way but why this error has occurred? Could anyone explain to me?
I think jdk 16 has eliminated applets so one who would like to run applets download jdk 8 version.
As jdk 15 also doesn't have applets if you want to check your version support appletviewer or not do this thing:
Go to windows> program files >java > jdk 1.5.05 > bin
So in that folder if you find appletviewer.exe then your version supports applets.
If you don't find that thing then you must go and download jdk 8 version or others which support applets.
As other people have said, applets are history really but try the following:
(cd to wherever appletexample.java is)
set PATH="C:\Program Files\Java\jdk-16\bin";%PATH%
appletviewer appletexample.java
Bear in mind that to run a java file as an argument to appletviewer, it needs to have a special format with commented-out applet tags in the Java source
I'm new to Stack Overflow (though a long time lurker).
I'm struggling to install elasticsearch on my laptop. It's windows 8, I've just updated java to Java 8 and I've set the new path using set JAVA_HOME.
However, whenever I try to run the elasticsearch.bat file on the command line, I get this error:
\elasticsearch-5.0.2\bin\..\config\jvm.options was unexpected at this time
Any help would be greatly appreciated on this matter
I've also tried to setup the ElasticSearch on my Windows 2016 R2 Datacenter (64-bit). Let me share some of my experiences on how to solve this.
Setting up JAVA_HOME
Ensure that you have JDK/JRE installed. You can download it here.
Set the JAVA_HOME environment variable. To do this, open the Start menu and type in "path".
Then click on Environment Variables. If you don't have JAVA_HOME variable set yet, click New.
The JAVA_HOME variable should only lead up to the JDK/JRE directory, not including /bin.
C:\Progra~1\Java\jdk1.8.0_112
Progra~1 corresponds to Program Files. If you use Program Files (x86), change Progra~1 to Progra~2
Restart your computer. Once your computer is restarted, open up CMD and type in echo %JAVA_HOME%. The output should be
C:\Progra~1\Java\jdk1.8.0_112
If you get the following output, your JAVA_HOME is setup correctly.
Running ElasticSearch
The first time I tried to run ElasticSearch, I get the following output.
The odd directory I pointed out here gave me a hint that the batch file might be reading from the wrong directory. So what I did was tinker around with the batch file a bit. Open elasticsearch.bat using any text editor.
Scroll all the way to the end, somewhere above the last lines you'll see something similar to the following.
Remove the highlighted line, save the file and try running the batch file again via command prompt.
It works in my case.
Once you have this, open up your browser and navigate to localhost:9200.
I think that's it?
Your problem is most likely caused by parentheses in the path to where you unzipped and are running Elasticsearch from. The related issue in the Elasticsearch repository is #24712 which will be fixed with Elasticsearch 5.4.1.
Be aware that by applying Nicholas Lie's "fix" you are telling Elasticsearch to effectively ignore all settings in config/jvm.options. While this may help you to start Elasticsearch in this specific case, it will only start with default JVM options which might lead to surprising behavior down the road.
I have a simple Java program that uses:
Runtime.getRuntime().exec("/usr/bin/javaws", [path for JNLP file])
to open a JNLP file using java web start.
However, I need to deal with the scenario of javaws not being installed. So I need to check to see if it is installed and, if it's not, install it. Any idea how to do either of those (or both)?
Firstly, you're assuming that the path to javaws is /usr/bin/javaws, which may not be the case.
If it were that simple, then you can check if the file exists:
File javawsFile = new File("/usr/bin/javaws");
if (! javawsFile.exists()) {
System.out.println("javaws not installed");
}
Having said that, java does not have to be installed to any particular location. Thus you can't assume it's in /usr/bin/. Many people will download the java binary zip and simply decompress it to their choice of location, and set the environment variable JAVA_HOME.
Now, you could go down the path of resolving the JAVA_HOME variable - but even then it'll only tell you if javaws is installed - or not.
If javaws is not installed, there is not really a way to install it - other than prompting the user to go off to the java website and download it.
The path you give is in *nix style. In this case it would require root access to install new applications - which isn't something you can simply manufacture.
Even if your user was already running your application as root, I would still be wary of this. It's not your responsibility to install software on your users' machines.
I had installed Java in my PC and it was working perfectly. Suddenly something went wrong and now I m not able to open swing applications and its showing the error 'Java not found'. But I can run the Eclipse IDE which also needed Java to run. So I decide to reinstall the Java, but when I tried to uninstall the Java it shows the Error 1723 - There is a problem with this Windows Installer Package. So I have installed a new JDK in another location and set the PATH. Still I am not able to run the Swing application.
Can anybody help me on this?
How are you running your swing application?
If it's from the command line like java mySwingApp and you're getting java not found then your PATH isn't set properly. Make sure that the java/bin directory is on your PATH not just the top level directory. You can test your PATH by just typing java in a console window - it should print the java help page.
If you're not running from a terminal like above, then you may need to set a JAVA_HOME environment variable which points to your java installation folder. Here's a tutorial on setting JAVA_HOME
Setting JAVA_HOME
Hope this helps,
Will
This is close to jakob's answer, about trying to get your Java install setup correctly again, just with a little more detail.
I had a similar problem on my Windows 7 box where I was trying to uninstall Java and do a clean install of a newer version. Something got messed up and I would get the 1723 error message during the uninstall and attempted reinstall. Here's information about how I was able to fix the problem, and maybe this will help you:
Look at the log files for the uninstall/reinstall. On Windows 7 they can be found at c:\users\username\AppData\Local\Temp\
The java_install.logdidn't show any extra information, but I had several MSI##### log files that contained error messages about the failed uninstall. The message was: Error 1723.There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action UninstallJRE, entry: MSIUninstallJRE, library: C:\Program Files\Java\jre6\bin\regutils.dll
There was indeed no regutils.dll file, and not even the bindirectory was there. So I copied over a regutils.dll file from another computer, ran the uninstaller, and it worked. Then the new clean install of Java also worked.
So take a look at your logfiles and hopefully that will give you more detailed information about the 1723 error.
This usally happens when you delete Java files manually.
If you try to uninstall Java and it fails, it generates a log file.
Should be in C:\Users[Username]\AppData\Local\Temp
Almost at the end the missing file(s) can be found.
Try to copy that file(s) from a working installation to your computer.
Then you should be able to uninstall your Java and install a new version.
I am getting the following error when I try to run jgr-x64.exe on Windows 7 64-bit.
Couldn't install JGR!
Please re-install R and/or connect to the internet
My Packages are getting installed at
\AppData\Local\Temp\Rtmp886Wzb\downloaded_packages
Is it something to do with setting environmental variables?
Any advise on how to solve this?
For non-standard R library locations, you need to tell jgr-x64.exe where to look for the JGR package. Some instructions on how to do this are at: http://www.deducer.org/pmwiki/pmwiki.php?n=Main.RunningJGRWithANon-standardRInstallation
The newest development version of JGR can automatically create a script to do this for you. You can test it out by doing the following:
install.packages("JGR",,"http://www.rforge.net",type="source")
library(JGR)
JGR()
At the R prompt, you must be in a directory where you have write access (run as admin if necessary, or else setwd() to your preferred directory) when you run JGR() for the first time. This will download jgr-1_62-x64.exe and create a jgrLaunch.bat file tailored to your system. It defines environment variables and command-line options to jgr-1_62-x64.exe.
You can move these files (e.g. to the desktop) after creation; just note that jgrLaunch.bat calls jgr-1_62-x64.exe, so the latter must either be in PATH or in the same directory as the .bat file.