• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting up Java  RSS feed

 
Pat Young
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am in my 88th year and have been using computers since 1959. In my retirement I still use them and still write programs - mostly for personal use eg.to find the results of a formula. Until it was no longer available on 64 bit machines, I used Visual Basic 6. Needing something more up to date I thought about Java and downloaded the required programmes. However, I find that in order to use Java I have to modify "Path" . My long experience tells me that attempting to alter these things is fraught with danger. I now wonder why the designers of Java did not add to the setting up of the program's the necessary alterations to "Path" or add something that adds to Windows 8, for example, that puts one directly into the Java compile and run stages. I suspect that there may be a simple answer to this and I would like to know it.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!
88 years and still programming! I don't even know if I will survive that long. I must say with a name like 'Young' you certainly are living up to it. My felicitations!

I wonder why you find modifying the PATH variable unadvisable. One advantage I can immediately think of is the ability to run different versions of Java on the same machine. Whenever you run 'java' or any other related binary, your path entry would tell the OS which version of the binary to pick up and execute.
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pat Young wrote: I have to modify "Path" . My long experience tells me that attempting to alter these things is fraught with danger.

As with any kind of setting, there's always a chance that you can mess things up if you make a mistake when you change something. With the Path variable it's really not that bad though. And I believe it does get taken care of when you install Java. I don't recall having to change it recently and I've been keeping up with the latest versions pretty diligently. What operating system are you using?
 
Pat Young
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your posts. I am using Windows 8.1. I see that it can be useful to have two versions of Java running. I was just being cautious and not acting like a bull in a china shop. My main problem is that when locating the Path variable I can only see part of the variable. I now notice that when using the edit function it points to the end of the variable and I can see how to add the requires additions. Programming at an advanced age stops one from being brain dead. I think that my thread can now be terminated. Thank you again for your help.
 
Norm Radder
Rancher
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another solution is to use the full path to the JDK tool you want to use. On windows you can write a batch file with the path to the command. I have a folder with my batch files. That folder is on the PATH.
My DevTool(simpler than an IDE) allows me to set the path to the javac.exe file along with other options on the command line.
For example this is the commandline I use for compiling:
D:\Java\jdk1.7.0_45\bin\javac.exe -cp . -Xlint TestCode19.java

PS You've got 16 years on me.
 
Pat Young
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you again for all your help. You might like to know that I managed to write and create the example "Hello I rule The World" in the Head First Java book. I had a problem with creating a virtual java machine but eventually I managed to Google an answer. I now need to work through the remaining 680 odd pages in the book. Trying this is like going back to the old DOS days. Just as well could remember how it worked.
 
Campbell Ritchie
Marshal
Posts: 56578
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome again
Yes, you should modify your PATH. You should in fact modify it whenever you update Java (unfortunately) but it is quite a simple process. There are several ways to do it, one of which is to be found in our FAQ.
 
Campbell Ritchie
Marshal
Posts: 56578
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Norm Radder wrote: . . .
D:\Java\jdk1.7.0_45\bin\javac.exe -cp . -Xlint TestCode19.java
. . .
7.0_45?

You should be using 7u71/72 or 8u25. Details and downloading instructions here.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!