LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 12-26-2003, 04:07 PM   #1
gooma
LQ Newbie
 
Registered: Dec 2003
Distribution: Red Hat 9
Posts: 7

Rep: Reputation: 0
java compilator and interpreter ???


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
 
Old 12-26-2003, 04:11 PM   #2
sirpelidor
Member
 
Registered: Oct 2003
Location: Madison
Distribution: mdk 8.2, 9.0, 9.2, slack 9.1
Posts: 403

Rep: Reputation: 30
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

virtual machine is jre from sun....

www.sun.com
www.java.com
 
Old 12-26-2003, 04:52 PM   #3
gooma
LQ Newbie
 
Registered: Dec 2003
Distribution: Red Hat 9
Posts: 7

Original Poster
Rep: Reputation: 0
whats 'eniv variable' ? i'm quite a newbie
 
Old 12-26-2003, 05:23 PM   #4
sirpelidor
Member
 
Registered: Oct 2003
Location: Madison
Distribution: mdk 8.2, 9.0, 9.2, slack 9.1
Posts: 403

Rep: Reputation: 30
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"

i learned a lot from it
 
Old 12-27-2003, 01:37 AM   #5
mansonmuni
Newbie
 
Registered: Oct 2003
Distribution: Redhat 9
Posts: 16

Rep: Reputation: 0
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:

export ENVIRONMENT_VARIABLE_NAME=environment_variable_value

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.

Hope this helps
 
Old 12-27-2003, 01:50 AM   #6
mansonmuni
Newbie
 
Registered: Oct 2003
Distribution: Redhat 9
Posts: 16

Rep: Reputation: 0
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:

export ENVIRONMENT_VARIABLE_NAME=environment_variable_value

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.

Hope this helps
 
Old 12-27-2003, 04:08 AM   #7
gooma
LQ Newbie
 
Registered: Dec 2003
Distribution: Red Hat 9
Posts: 7

Original Poster
Rep: Reputation: 0
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

Last edited by gooma; 12-27-2003 at 04:38 AM.
 
Old 12-27-2003, 01:22 PM   #8
sirpelidor
Member
 
Registered: Oct 2003
Location: Madison
Distribution: mdk 8.2, 9.0, 9.2, slack 9.1
Posts: 403

Rep: Reputation: 30
/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...
 
Old 12-27-2003, 01:37 PM   #9
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Its not BlackHawk java, it is Blackdown Java


By the way, why are you using gcj? My experience is that you are best running a java program as a java program, not trying to compile it.
 
Old 12-27-2003, 02:58 PM   #10
gooma
LQ Newbie
 
Registered: Dec 2003
Distribution: Red Hat 9
Posts: 7

Original Poster
Rep: Reputation: 0
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
 
Old 12-27-2003, 04:14 PM   #11
sirpelidor
Member
 
Registered: Oct 2003
Location: Madison
Distribution: mdk 8.2, 9.0, 9.2, slack 9.1
Posts: 403

Rep: Reputation: 30
jre java runtime enviroment
j2sdk java 2 software development kid

jre only got virual machine
j2sdk has compiler (for u to write program) as well as jre alone with it.
 
Old 12-27-2003, 04:30 PM   #12
Superdude
Member
 
Registered: Oct 2003
Distribution: Slackware 9.0
Posts: 47

Rep: Reputation: 15
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?
 
Old 12-27-2003, 04:46 PM   #13
sirpelidor
Member
 
Registered: Oct 2003
Location: Madison
Distribution: mdk 8.2, 9.0, 9.2, slack 9.1
Posts: 403

Rep: Reputation: 30
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
 
Old 12-28-2003, 04:20 AM   #14
gooma
LQ Newbie
 
Registered: Dec 2003
Distribution: Red Hat 9
Posts: 7

Original Poster
Rep: Reputation: 0
thanx for explanations. i'll try this

Last edited by gooma; 12-28-2003 at 04:29 AM.
 
Old 12-28-2003, 06:10 PM   #15
macewan
Senior Member
 
Registered: Jan 2002
Distribution: Ubuntu, Debian
Posts: 1,055
Blog Entries: 1

Rep: Reputation: 45
http://www.macewan.org/howto/java_an...n_redhat8.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is the Python Interpreter? Chomper Programming 8 01-15-2005 09:56 PM
bad interpreter???? yenonn Programming 4 09-25-2004 05:21 AM
interpreter gr33ndata Programming 5 04-23-2004 11:10 AM
java interpreter matt_w_lambert Programming 2 07-07-2003 06:02 AM
bad interpreter penzilsinc Linux - Newbie 5 06-26-2002 01:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration