Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I've installed java(jre) on window 7. But I am not able to run java from command prompt .
I've set my JRE_HOME to "c:\Program Files (x86)\Java\jre6 " in Environment variables.But still it's not working.kindly help..
Make sure, that the bin folder of your JRE is added to the PATH variable. JAVA_HOME is irrelevant here.
JAVA_HOME is a convention - some tools use that environment variable to pick the location of the right java version. They use it to construct a path like this:
%JAVA_HOME%/bin/java -version
(that should work, by the way)
Add the location of the bin directory to the front of your PATH environment variable.
The simplest way to get a default Java is to go to http://java.com and let it install what it feels like. This will be available in your PATH.
Use this command at cmd (assuming java is installed at "C:\Program Files\Java" and version is 1.6.0):
set path=;"C:\Program Files\Java\jdk1.6.0\bin\";
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
In Ubuntu I have added the following to my ~/.bashrc
export JAVA_HOME=/home/user/tools/jdk-11.0.4
export PATH=${PATH}:${JAVA_HOME}/bin
export PATH=/home/user/tools/apache-maven-3.6.1/bin:$PATH
But when I run (after a reboot):
$ which java
/usr/bin/java
$ java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~19.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
Why is it still picking up java 8 from /usr/bin/java?
The locations in the PATH environment variable are searched in order, and the first match for an executable is returned. Since you added JAVA_HOME at the end of the PATH, the global version of java is found first (as /usr/bin comes before JAVA_HOME).
Try this order instead (in the second line of your code above):
export PATH=${JAVA_HOME}/bin:${PATH}
BTW, it is not necessary to reboot each time you change ~/.bashrc. You can just open a new shell terminal.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I installed the JDK 8 update 73 together with Netbeans to play around with it. The whole thing was pretty cumbersome so I decided to uninstall them both and went back to Brackets.
For Netbeans it was like a walk in the park with its already provided uninstaller packet ".sh" in the directory.
However, with JDK, there seems to be no freaking way for me to rid of this thing. I searched for anything "jdk" in Software Manager and removed everything I saw in there. I also digged into the usr/lib/jvm to manually delete any leftover folders. But, as soon as I ran the installer packet ".sh" it told me that JDK 8 update 73 was still already installed....
Can you guys please help me remove this completely??? Many thanks!!
PS: I'm using Linux Mint Cinnamon 64-bit.
Try this to find files:
sudo find /usr/ -name "*jdk*"
sudo find /opt/ -name "*jdk*"
sudo find /etc/ -name "*jdk*"
Now if that doesn't find files, try with another keyword like "java".
And if that doesn't work then the installer may be checking for defined variables like $JAVA_HOME, you can check if it's defined by doing:
echo $JAVA_HOME
if it prints a path, then it's set and you need to unset it. See the following page for a reference:
https://help.ubuntu.com/community/EnvironmentVariables
Go to synaptic manager or software center and remove jdk. If it worked pls reply.
I think JDK placed in /usr/lib/jvm/jdk1.8.xxx or something like there.
It's better to install separately JDK and Netbeans.
My favourite way to install JDK in Mint (I'm using Linux Mint 17.3) described here.
I wonder if you can remove it from:
Control Panel of Windows > Add/Remove Programs > Choose Java SDK
you want to remove
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I updated Java and now Eclipse won't start, it says Java was started but returned exit code = 13. Eclipse was working just fine until this update. Does anyone know what to do?
you may have downloaded the incorrect version for you computer? as in a 64 bit/ 32 bit conflict.
I found a similar problem to yours on another stackoverflow thread.
Can't start Eclipse - Java was started but returned exit code=13
You can fix it by changing the directory of line "vm" in eclipse.ini to the version you have just installed.
Ex: I just updated my java to java 8 update 131 to java8 update 144
C:/Program Files/Java/jre1.8.0_131/bin
Change it to:
C:/Program Files/Java/jre1.8.0_144/bin
Note: On Windows, you can check your java in C:/Program Files/Java or C:/Program Files(x86)/Java depending on 64 or 32 bit installation.
re-install java jdk to solve the problem
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm trying to install JRE on Ubuntu 13.10. I followed this guide. When I run "java -version" it says "command not found"...
This is the result of "sudo find / -name java"
/var/lib/dpkg/alternatives/java
/usr/lib/jvm/java-7-oracle/bin/java
/usr/lib/jvm/java-7-oracle/jre/bin/java
/usr/lib/ure/share/java
/usr/local/java
/usr/local/java/jre1.7.0_51/bin/java
/usr/bin/java
/usr/java
Basically command not found happens when you didn't set up the PATH of installed java.
This guide here covers more about how to install java on a ubuntu machine completely, but here I'm just going to present how to setup your java runnable:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jre1.7.0_51/bin/java" 1
sudo chmod a+x /usr/bin/java
and then
sudo update-alternatives --config java
Choose the one that has /usr/local/java/jre1.7.0_51/bin/java in the options.
You need to set your Java bin full path /jre1.7.0_51/bin to the PATH variable in your Shell window.
Like this
export PATH:$PATH:/jre1.7.0_51/bin
You can check the existing PATH by typing echo $PATH in your Shell window.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
installing Netbeans 6.0.1 on my windows computer, I find this error:
Even if I my enviroment variables seems to be ok, when executing:
I rebooted my system, but the error persists. Does anybody know why??
Thans in advance
This is only due to javahome path missing.
Use the command line below:--
For Windows OS- Open your command prompt
netbeans-6.5.1-windows.exe --javahome "C:\\Program Files\Java\jdk1.5.0"
For Linux OS- Open your Terminal
netbeans-6.5.1-windows.sh --javahome /usr/jdk/jdk1.6.0_04
The problem solved.
If you are certain that you have a JDK installed (and not a JRE), you can specify the location of the JDK on the commandline when starting the installer (as mentioned in the error message you get).
These FAQ entries might also help you:
http://wiki.netbeans.org/FaqInstallJavahome
http://wiki.netbeans.org/FaqSuitableJvmNotFound
Set JAVA_HOME in environment variable.
set JAVA_HOME to only JDK1.6.0_23 or whatever jdk folder you have. dont include bin folder in path.
Set the JAVA_HOME variable as noted above, but also set the JRE_HOME variable to the Java Runtime Environment folder (example: C:\Program Files (x86)\Java\jdk1.6.0_23\jre )
To set the windows environment variable, right click on My Computer and select "Properties" and choose the "Advanced" tab on older windows versions, or click the "Advanced system settings" link on new versions of windows. Click the "Environment Variables" button and, in the System Variables section, click the "New" button and add the above variable names and enter the appropriate filesystem paths as the values.
After you've installed Netbeans, check the following:
Open C:\Program Files (x86)\NetBeans 6.0.1\etc\netbeans.conf
Change this value to the location of your JDK folder if it isn't set correctly already:
netbeans_jdkhome="C:\Program Files (x86)\Java\jdk1.6.0_23"
We managed installation of netbeans 6.8 under windows 8 successfully the following way:
Don't execute but unzip netbeans-6.8-ml-windows.exe with 7zip (or other unzipper) in an emtpy folder
execute cmd.exe as administrator
cd to the folder in which you unzipped the installer
execute 'java org.netbeans.installer.Installer'
-> installation executes without any errors
I also had the same problem. So I tried by installing a lesser version say jdk1.5 and running the netbeans installation from command prompt as:
Linux: netbeans-5_5-linux.bin -is:javahome /usr/jdk/jdk1.5.0_06
Windows: netbeans-5_5-windows.exe -is:javahome "C:\Program Files\Java\jdk1.5.0_06"
Hope it helps