Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
do u know any java compilators and virtual machines? can u give some links? i've tried kaffe but when i tried to install rpm i got sth about coliding files or sth. my distro is red hat 9
lotz ppl here like to use blackhawk.
i just download from sun .....
java compiler should be locate in /<where u install java>/bin/javac
set the eniv varible to global, then u can use it anywhere
environmental variable is a variable that allow you to use in the whole system. for example, ls, you can issue that command anywhere in ur system. for example, if you have a command call Makefile, locate in /thisfile
then you can only issue Makefile under /thisfile, if u are not in /thisfile, u gotta type the whole link such as: /thisfile/Makefile
java compiler --> javac, is locate in /<whereever u install>/bin/javac
if u wanna use it, u must type the whole thing in order to compile something.
but if u set /<whereever u install java>/bin as global envi variable, you can issue javac anywhere in ur system.
i'd suggest you get a couple good linux book. it will boost start ur linux jourery. one book i strongly recommand is "Running Linux" from "O'Reilly"
Just to add to what sirpelador explained. An environment variable is just a global (accesible to all programs) value that has a name. In other words, I can call it SAM and give it the value "10" or the value "/usr/local/samsvalue" and every program that needs to know the value of SAM will discover the value I gave it when the program looks for SAM.
If bash is your interpreter (try "echo $SHELL" to find out) then you can set an environment variable by using the following:
where environment_variable_value can be a string like a path, e.g., "/usr/local/" or a value like '1' or '0' which usually translate to true or false, 1 being true, 0 being false. In fact "SHELL" in the example above is an environment variable that is set for you by a login script. It is set to the path to the executable file corresponding to your command interpretor -- like command.com in windows. In linux you have your choice of different command interpreters as well as your choice between several different window managers (or GUI'S) within which you can execute commands.
You can assign an environment variable that never gets used or that only a program you designed uses. If you say export TRASH="pick it up" and put
echo TRASH
in an executable script called trash.bash. When you do ./trash.bash in the directory you put the script it will echo "pick it up." to the output of your shell.
I'm assuming some things here, but hoping to get the main point across. They are just global variables at the very top level of your os's environment, as far as I understand it.
Just to add to what sirpelador explained. An environment variable is just a global (accesible to all programs) value that has a name. In other words, I can call it SAM and give it the value "10" or the value "/usr/local/samsvalue" and every program that needs to know the value of SAM will discover the value I gave it when the program looks for SAM.
If bash is your interpreter (try "echo $SHELL" to find out) then you can set an environment variable by using the following:
where environment_variable_value can be a string like a path, e.g., "/usr/local/" or a value like '1' or '0' which usually translate to true or false, 1 being true, 0 being false. In fact "SHELL" in the example above is an environment variable that is set for you by a login script. It is set to the path to the executable file corresponding to your command interpretor -- like command.com in windows. In linux you have your choice of different command interpreters as well as your choice between several different window managers (or GUI'S) within which you can execute commands.
You can assign an environment variable that never gets used or that only a program you designed uses. If you say export TRASH="pick it up" and put
echo TRASH
in an executable script called trash.bash. When you do ./trash.bash in the directory you put the script it will echo "pick it up." to the output of your shell.
I'm assuming some things here, but hoping to get the main point across. They are just global variables at the very top level of your os's environment, as far as I understand it.
whwre can i find blackhawk? i've been searching for a while and found nothing
i've tried gcj but everytime i want to compile something i get:
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt.o(.text+0x18): In function '_start':
../sysdeps/i386/elt/start.s:77:undefined reference to 'main'
collect2:ld returned 1 exit status
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt.o(.text+0x18): In function '_start':
../sysdeps/i386/elt/start.s:77:undefined reference to 'main'
collect2:ld returned 1 exit status
.... sounds like a wrong compiler to me. just go to sun (www.sun.com) and download the latest jsdk.1.4 or something, it should get you rollin...
i downloaded latest jre but there is no compiler inside.. just interpreter.. is compiler included only in sdk? i'm new to java and untill now i've only been using java creator for windows.. so i dont have any experience in using gcj
Instead of doing all that with the environment variable, can you just do this:
cd /sbin
ln -s /usr/java/j2sdk1.4.2/bin/javac
ln -s /usr/java/j2sdk1.4.2/bin/java
now you should be able to compile and run java programs from any directory. That's what I did, but I'm new to linux. Is there any advantages/disadvantages to doing it this way?
if u just compile java using javac, and if u just run java program using java (filename) then yea...setting symlink would be good enough.
but if u wanna use other options under /java/bin, then u will need to link the rest to /sbin and stuff, then might as well just point env vaiable to /java/bin
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.