This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have downloaded the Java 2 SDK and the IDE combo package from Sun.com and have installed it. But strangely there was no info as to what class paths I need to set under Linux and how to do it? Can anyone plz help? Thanks.
You don't need to set the classpath; the default setting (none) is fine, at least at first. You will need to set your path so that your shell can find Java. Have a look at /usr/java/j2sdk1.4.2/ , or thereabouts. This should be your JDK install directory. Put ${JDK_HOME}/bin on your path; something like this in ~/.bashrc should be fine:
[ September 24, 2003: Message edited by: Ernest Friedman-Hill ]
Hey...sorry....but I couldn' find that .bashrc file? Where exactly is it located...since you said I have to add the PATH thing to this code rt?
Ravi Kanth D
Greenhorn
Joined: Sep 14, 2003
Posts: 18
posted
0
I would also aappreciate if you can give a little explanation on the code you have mentioned. I was wondering since in the first line we mentioned the location of Java in "JAVA_HOME"...do we also need to mention the same in the second line like this: PATH="${JAVA_HOME}/bin:${PATH}" ??
.bashrc is a hidden file.You will find in your home directory. Since it is hidden file, you need to use command like this. vi .bashrc Essentially to view all hidden files in linux you have to prefix (.) along with file name
If you want to become a rich, do not work for others but make others to work for you.
It could be that .bashrc was not created. Then simply create such a file. JAVA_HOME is the install directory for your SDK. The path must point to the bin of the JAVA_HOME dir. Explanation: JAVA_HOME is read by some applications e.g. Apache, Ant to detect the home folder, to be able to find the JRE etc. PATH: is processed by the shell to find the java commands (java, javaw, javac etc.) This is why you have to set both. In Linux (also in Windows) your PATH variable is the search path for commands which aren't in the local directory. So when you are in a shell and type "cp" then the shell searches in all you path folders (in this case it would be /bin/) [ September 24, 2003: Message edited by: Oliver Refle ]
Ravi Kanth D
Greenhorn
Joined: Sep 14, 2003
Posts: 18
posted
0
Thanks for the info...and my question is: so in the second line of the code above...it should not be JDK_HOME....but it should be JAVA_HOME which was mentioned in the first line right?
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
JAVA_HOME is the standard variable. There are also some tools which require JDK_HOME (think netbeans IDE, but i am not sure). Normaly when you start such a tool it will tell you it couldn't find the desired variable.
Ernest Friedman-Hill
author and iconoclast
Marshal
so in the second line of the code above...it should not be JDK_HOME....but it should be JAVA_HOME which was mentioned in the first line right?
Sorry, just being sloppy. I fixed my original post.
Ravi Kanth D
Greenhorn
Joined: Sep 14, 2003
Posts: 18
posted
0
I saw the .bashrc file and it doesn' have anything about PATH in it. On the other hand, there is a file bash_profile (I think) in my Home directory which has PATH mentioned in it. So do I add the above code to that bash_profile file then? Sorry...but being a starter in Linux everything seems so confusing rt now.
Ernest Friedman-Hill
author and iconoclast
Marshal
There are several different startup files that bash can use -- both of those, plus several system-wide files in /etc. The best thing to do is to say "info bash" at the prompt, then type "gBash Startup Files" and press Enter; then read this section of the Bash manual which explains it all.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.