java enum in different versions and updations - java

I am using jre 6 now. Earlier, I was using javasdk1.4 but as I searched in Internet, found that enum is supported in 1.5 or higher version. So, I first updated jre to latest version and then now how to update j2sdk1.4 .
When I am using echo %PATH%
path showed is "C:\Program Files\Java\jre7\bin"
But I can't set path to this location as 'javac' here is not recognizable..
My enum code i am not posting but is verified that it is correct.. Here, I am facing problem of setting path and updating j2sdk 1.4 even after jre updated to latest Version.
Note: I want to set path using command-prompt and Path command not using environment Variable.
I am using windows Xp

javac is not included in the JRE, it's just a runtime environment (Java Runtime Environment) used to run Java applications, nothing more.
Download a JDK (Java Development Kit) instead.

Related

How can I set environment variable for java jdk bin so that it shows same version in command prompt

I have set the Path variable in Environment Variables to C:\Java\jdk-15\bin which is the latest jdk I've recently downloaded from official Oracle site.
But, when I try to check the Java version from any other directory, it shows the version as below:
I have tried running the same command from C:\ too. It shows the same. Is this how it is supposed to look or am I doing something wrong here? I have got couple of jdk versions already installed on the system. Could this be cause of the older versions lying around in the system? Should I have uninstalled older versions before installing jdk-15?

Why does the Java JDK not set its own path after installation on Windows?

Problem:
After installing Java SE version 14.0.1 I tried to run the command java in CMD because I wanted to check if everything works as it should, but an error occurred because CMD could not find what I wanted.
I checked the system environment variable to see if the path for the Java JDK was set, but no, it was not set.
Question:
Why was the path not set by the Java JDK after installing Java SE 14.0.1?
It depens on the installator provider by the combianation of vendor and version. As far as I know the AdoptOpenJDK add the PATH variable

Set custom Java version for CMake

I am trying to install a Tool (SciDB); its installing procedure makes use of CMake. At a certain point it requires Java 1.8, which is not installed on the system.
-- Could NOT find Java (missing: Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE)
CMake Error at src/jdbc/CMakeLists.txt:5 (message):
Java 1.8 is currently the only supported version for building JDBC!
I installed it somewhere in my home folder; how to tell CMake to use my version?
I tried to set the $JAVA_HOME and $PATH variable as suggested in this previous answer, but got no results.
SciDB uses its own version of FindJava.cmake (located in cmake/Modules/FindJava.cmake). SciDB expects a particular environment and that the user has installed OpenJDK version 1.8.
One way to use your JAVA_HOME is to modify cmake/Modules/FindJava.cmake in your source code and add your ${JAVA_HOME}/bin:
set(_JAVA_PATHS
$ENV{JAVA_HOME}/bin
/usr/lib/jvm/java-1.8.0-openjdk/bin
/usr/lib/jvm/java-1.8.0-openjdk-amd64/bin
/usr/lib/jvm/java-1.8.0-openjdk.x86_64/bin
)
NOTE: The version of Java in that $JAVA_HOME will NOT be checked.

Java classpath still the same after changing .bashrc

Is there a clear instruction available on how to set the classpath properly for updating the java jdk and the java vm?
On my system is Java 1.7 installed but I need the features of Java 8!
So I did the following steps as mentioned in the official Oracle classpath guide and other tutorials but it just doesn't work for me:
1.) moved the jdk to /usr/lib
2.) added the following lines to the ~/.bashrc:
PATH=/usr/lib/jdk1.8.0_60/bin:$PATH
export PATH
I type which java
Output is /usr/bin/java which is still the old 1.7 jdk
The runtime (VM) is not the official form Oracle but the openJDK so I also need to update this one to version 8...

Multiple java versions installed and java was started but returned exit code=13

I am not able to start eclipse on Windows 7. It was working fine yesterday. Here is the screenshot of error when I start eclipse:
Java versions from CMD
Why it gives different versions for java and javac?
My java home is set to Jdk 7 as below:
JAVA_HOME = C:\Program Files\Java\jdk1.7.0_60
Note: I have jdk 8 installed on my machine but I have not set jdk 8 path.
This question has been asked couple of times but I am not able to resolve it on my machine so please do not mark it as duplicate.
In the environment variables check your path whether it is starts with C:\ProgramData\Oracle\Java\javapath
if yes then please remove it and try again
More than likely you've installed JDK 1.70_60 prior to installing JRE 1.8.0_51.
This would mean that your compiler javac is found within the JDK distribution (Java Development Kit) and your java runtime is found within the more recently downloaded JRE (Java Runtime Environment). JRE does not contain the javac (Java compiler).
I was recently facing the same issue, Java 8 installer prepends to the Windows PATH variable C:\ProgramData\Oracle\Java\javapath that is why you are seeing different versions for java and javac
Your eclipse might not be pointing to the right JDK.
Open your eclipse.ini configuration file for editing. This can be found in the same folder with eclipse.exe file.
replace:
-vm C:\ProgramData\Oracle\Java\javapath\javaw.exe
with:
-vm
C:/Program Files/Java/jdk1.7.0_60/bin/javaw.exe
Then, restart eclipse.
I have recently installed jdk 8. Java 8 installer prepends to the Windows PATH variable C:\ProgramData\Oracle\Java\javapath and this is the reason I was seeing different versions for java and javac
For those who runs on the same issues, I have found nice explanation here

Categories