Normally javac is stored in the bin directory of your JDK. You can use the search
facility on Windows or the 'which' or 'find' command on Unix to find your javac
executable file. Set the directory where javac is stored in your PATH variable
for convenience.
Normally javac is stored in the bin directory of your JDK. You can use the search
facility on Windows or the 'which' or 'find' command on Unix to find your javac
executable file. Set the directory where javac is stored in your PATH variable
for convenience.
kind regards,
Jos
I just wanted to know that ..... is there any environment variable to get that path.
I wanna make it platform independent.
Before you help on it ... i make my code work by setting the path variable.
But if my code runs in UNIX platform then how do i do that in one shot... so that it becomes platform independent.... ..:-)
I just wanted to know that ..... is there any environment variable to get that path.
I wanna make it platform independent.
Before you help on it ... i make my code work by setting the path variable.
But if my code runs in UNIX platform then how do i do that in one shot... so that it becomes platform independent.... ..:-)
Debasis Jana.
Well, that should be part of your installation procedure; it's that program that
installs the javac compiler so it's that program's responsibility to put that directory
in the path variable. There is no free lunch where automagically an environment
such as JAVA_HOME will be created for you. Neither on a Windows Box nor
on a Unix box. The day that computers will be psychic will be in the far future.
Well, that should be part of your installation procedure; it's that program that
installs the javac compiler so it's that program's responsibility to put that directory
in the path variable. There is no free lunch where automagically an environment
such as JAVA_HOME will be created for you. Neither on a Windows Box nor
on a Unix box. The day that computers will be psychic will be in the far future.
kind regards,
Jos
So that should be part of my installation code ...
i understand .......
one more thing JOS ......
How could i know that my machine in having java or not????
So that should be part of my installation code ...
i understand .......
one more thing JOS ......
How could i know that my machine in having java or not????
Debasis Jana.
Obviously you can't test that using a Java program so you need something else;
e.g. a shell script that tries to run "java -version". If it fails you don't have Java
installed or present in the path variable.
I just wanted to know that ..... is there any environment variable to get that path.
I wanna make it platform independent.
Before you help on it ... i make my code work by setting the path variable.
But if my code runs in UNIX platform then how do i do that in one shot... so that it becomes platform independent.... ..:-)
Debasis Jana.
What if you try to figure out the platform first in your code?
Then you can try to find it in the default installation folders.
If it cannot be found there, then you have to ask the user where it is.
Or at least prefill the textboxes during installation.
This will take some headache away from most users, because the users with less experience will nearly always install it in the default folder and they don't remember where it was afterwards, whereas the experts would choose some special folders, but then the experts will remember where it was.
The path is usually stored in the environment variable JAVA_HOME.
You could also check the CLASSPATH variable.
On Windows XP, you can also check the registry to make sure he has it installed and which versions are installed. See keys under Software-->JavaSoft
What if you try to figure out the platform first in your code?
Then you can try to find it in the default installation folders.
If it cannot be found there, then you have to ask the user where it is.
Or at least prefill the textboxes during installation.
This will take some headache away from most users, because the users with less experience will nearly always install it in the default folder and they don't remember where it was afterwards, whereas the experts would choose some special folders, but then the experts will remember where it was.
The path is usually stored in the environment variable JAVA_HOME.
You could also check the CLASSPATH variable.
On Windows XP, you can also check the registry to make sure he has it installed and which versions are installed. See keys under Software-->JavaSoft
Could I get that JAVA_HOME environment variable in UNIX platform?
Could I get that JAVA_HOME environment variable in UNIX platform?
Debasis Jana.
you can execute "env" command to see all environment variables.
In our Solaris (Sun-machine) the environment variable "JAVA_HOME" is set, also the "CLASSPATH" , for all users. Usually the CLASSPATH is always set, because it is recognized by every "javac" or "java"
Hi .....Alll....
What I looked for that I solved ... :-)
Just a common think I could not do it ...
anyway ....I managed 2 do that I simply set tha path and accessing the javac and jar
Hi .....Alll....
What I looked for that I solved ... :-)
Just a common think I could not do it ...
anyway ....I managed 2 do that I simply set tha path and accessing the javac and jar
Debasis Jana.
But what about your question then if there was no JDK installed? Your questions
are just wondering around with no specified goal.
But what about your question then if there was no JDK installed? Your questions
are just wondering around with no specified goal.
kind regards,
Jos
lolz!
no no JOS ..my target was the first one ..
I just contextually asked it ....
Actually i was in hectic ...today I finished ....that .....
Anyway I ll try to find out whether .... JDK installed or not ....
I promise i won't start it in new THREAD ..... :-)
Tomorrow is my job delivery ...
Comment