I am new to this forum and I found it while searching google for some answers.
So I thought I would try my questions here.
I have a Windows 8.1 64bit pc and I have Java on my system (just starting to learn about java).
It seems I have several versions thou the latest is jre-9 and jdk-9 and a few others.
When I go to Windows start menu and type system and then open windows environment variables there are 2 sections which are user variables and system variables.
I know I have to add path to Java now for system do i enter the jre-9 as system jave and then add the jdk-9 for user variable?
I know I have to set the user one to jdk-9 but for the system one do i match it or just set as the jre-9?
Next question is also hard for me to find a good answer on google.
When I start learning Java and I write a program (not test program but full application) if I create it while using latest jdk-9, how do i make it backward compatible to work on old java systems?
Or is there some way to make it work by adding code pointing to different java jre's?
Thats it for my questions, I have just started to learn Java and it is my first language I am trying to learn.
I have some good books after spending a month to narrow down what language to start with and then to find what is considered the best books.
I have IDE's already so once i know for sure about the path questions i will be starting to learn more from the books.
Thanks in advance
Frauka
-
1
-
-
-
-

You don't start Java® from the start menu. What you do is open the command line. Have a look in our FAQ.
Uninstall the versions of JRE you have; you don't need them. The complete JRE is included in the JDK.
Don't mix user environment variables and system environment variables. Set the PATH to the Java9 JDK as a system environment variable; it should start with c: and end with \bin.
Until you use the Streams API, chances are everything you write will be backwards compatible with Java7-8, but will need to be recompiled with compatibility instructions. If you are just beginning, backward compatibility will not be an important issue, but the compatibility flags will produce error messages if you try compiling a new feature not available in the old version. Search for the documentation for the javac and java tools (you might find the old Java7 versions here) and look for the option tags called -source and -target.
Campbell Ritchie wrote:Welcome to the Ranch
![]()
You don't start Java® from the start menu. What you do is open the command line. Have a look in our FAQ.
Uninstall the versions of JRE you have; you don't need them. The complete JRE is included in the JDK.
Don't mix user environment variables and system environment variables. Set the PATH to the Java9 JDK as a system environment variable; it should start with c: and end with \bin.
Until you use the Streams API, chances are everything you write will be backwards compatible with Java7-8, but will need to be recompiled with compatibility instructions. If you are just beginning, backward compatibility will not be an important issue, but the compatibility flags will produce error messages if you try compiling a new feature not available in the old version. Search for the documentation for the javac and java tools (you might find the old Java7 versions here) and look for the option tags called -source and -target.
Hello Campbell Ritchie,
Thanks for the fast reply to my post and the Welcome.
Ok i will change the Path system variable as I have it set for Jre-9 and then have user path set to Jdk-9, so I will make them both the Jdk-9.
As for just starting out that is true i know next to nothing but I can learn.
As for javac i found them in multiple Java folders as I have many 1.8.0_144, 9 and a couple older ones.
When I go to elevated cmd prompt and i type "java -version" it shows as version 9 installed.
Thanks for you help.
Fred AKA Drauka
Campbell Ritchie wrote:If you are using NetBeans you will have to use the technique of setting JAVA_HOME as well as the PATH component. You should probably put the desired PATH component to Java® first in the PATH.
I have Netbeans but I like the Eclipse Oxygen IDE right now thou I read online that Jetbrains Java IDE is the best.
I may download and try it to see if it is best suited for me.
So what is your opinion on IDE's for a noob like me?
Thanks in advance
Fred
-
1
-
-
-
-

You don't need the user environment variable at the present if you have set it for the system. Maybe you would want a user variable if you are the only person to use Java®. Getting 9 from java -version sounds good.
I would suggest you get yourself a decent text editor (Notepad++ being my favourite on Windows®) and set up the options for automatic indentation, automatic conversion of tab→4 spaces, syntax colouring which you like and bracket matching. Those will make it easier to find your way around the code. Once you are confident about setting the CLASSPATH (which you won't need for some time, but you will probably do differently for each app needing it), then I suggest you move onto an IDE. Any of IntelliJ Eclipse and NetBeans will work nicely.
Campbell Ritchie wrote:That's a pleasure
![]()
You don't need the user environment variable at the present if you have set it for the system. Maybe you would want a user variable if you are the only person to use Java®. Getting 9 from java -version sounds good.
I would suggest you get yourself a decent text editor (Notepad++ being my favourite on Windows®) and set up the options for automatic indentation, automatic conversion of tab→4 spaces, syntax colouring which you like and bracket matching. Those will make it easier to find your way around the code. Once you are confident about setting the CLASSPATH (which you won't need for some time, but you will probably do differently for each app needing it), then I suggest you move onto an IDE. Any of IntelliJ Eclipse and NetBeans will work nicely.
Hello Campbell Ritchie,
Thanks for the information and help, I truly appreciate it.
I have numerous text editors that include notepad++.
Also as I mentioned I have Eclipse Oxygen and Netbeans i found that the Oxygen version of Eclipse was the only eclipse version to see Java 9.
I am in the process of contacting Jetbrains to see if I can qualify for free license and will be getting a trial version of it.
I have made a couple tutorial java programs from books using elevated cmd prompt and compiled and ran fine.
Thanks again for all the help.
Fred
No need to contact them, just download and install.
-
1
-
-
-
-
Fred Wilhelm wrote:...
Also as I mentioned I have Eclipse Oxygen and Netbeans i found that the Oxygen version of Eclipse was the only eclipse version to see Java 9.
I am in the process of contacting Jetbrains to see if I can qualify for free license and will be getting a trial version of it...
Hi Fred, if you are beginner, an IDE (Eclipse, Netbeans, IntelliJ, etc...) which understands Java and autocompletes stuff for you will actually slow down your learning process. What you need is a Text editor that handles indentations well. This is why Campbell suggested using Notepad++
I agree. Here's the better link: Salvin.in
salvin francis wrote:
Fred Wilhelm wrote:...
Also as I mentioned I have Eclipse Oxygen and Netbeans i found that the Oxygen version of Eclipse was the only eclipse version to see Java 9.
I am in the process of contacting Jetbrains to see if I can qualify for free license and will be getting a trial version of it...
Hi Fred, if you are beginner, an IDE (Eclipse, Netbeans, IntelliJ, etc...) which understands Java and autocompletes stuff for you will actually slow down your learning process. What you need is a Text editor that handles indentations well. This is why Campbell suggested using Notepad++
Hello Salvin Francis,
Thanks for letting me know, i now understand.
I will stick with notepad++ or one of my other text programs as I have many.
And I will wait before i start using any IDE.
Thanks again for the help.
Have a great day.
Fred

Onion rings are vegetable donuts. Taste this tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
|