LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-01-2006, 10:40 AM   #1
alek66
Member
 
Registered: Apr 2004
Location: Argentina
Distribution: netBSD/Linux
Posts: 256

Rep: Reputation: 30
A doubt I always had about compilers


Heres the deal, i´m running a linux under 64bit. I am programming in java... y lets say a make a program, works and everything ok. And i compile it to have a binary. Will this binary work only under 64bit linux only... what´s the deal with the compilators and the outputs rewarding to the arquitecture of your box.
Well actually the thing started to bite my head, when i started thinking in making some programs in java for my palm or cellphone.
Any thoughts, pages, and stuff are welcome.
 
Old 02-01-2006, 10:59 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Because java binaries run on a virtual machine, It's a save guess that it will run on 32-bit Linux as well as Win32, Win64 and Solaris.

BTW AFAIK there does not even exist (yet) a 64-bit java for Linux. So your java-compiler is running in 32-bit mode.
 
Old 02-01-2006, 10:59 AM   #3
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Traditionally a compiler will generate machine instructions specific for the destination architecture, and it is quite possible to build a binary for an architecture different to the one on which the compiler resides (after all it is only generating machine instructions, not trying to execute them)

Traditionally, that was the picture (albeit very simplified) Java and other byte code languages changed that picture a little. The Java compiler will take the source code and generate machine independent instructions which are executed on the target machine via the Java Virtual Machine (JVM) the JVM must reside on the target machine for the java program to work but the source code doesn't need to be recompiled for that specific architecture.

cheers,

graeme
 
Old 02-01-2006, 12:04 PM   #4
alek66
Member
 
Registered: Apr 2004
Location: Argentina
Distribution: netBSD/Linux
Posts: 256

Original Poster
Rep: Reputation: 30
Thanks! for the info.
 
Old 02-01-2006, 02:21 PM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Ubuntu/WSL
Posts: 9,788

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by Hko
BTW AFAIK there does not even exist (yet) a 64-bit java for Linux.
There is definitely a 64 bit JVM for Linux available, (for AMD64 Opteron chips).
 
  


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
Fortran compilers section8 Programming 1 03-30-2005 06:11 AM
Compilers lramos85 Programming 4 10-03-2004 01:50 PM
C++ Compilers (!~CoW~!) Linux - Software 12 11-18-2003 09:52 AM
Compilers... ChaosZ3RO Linux - Software 1 09-15-2003 06:08 PM
CD with many compilers...Are there any? Colonel Panic Programming 5 10-16-2001 07:16 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:21 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