LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-14-2004, 12:06 AM   #16
lasindi
Member
 
Registered: Apr 2004
Distribution: Slackware, Ubuntu
Posts: 101

Rep: Reputation: 15

I've tried to use gcj without Sun's JRE installed, and it won't work. Has GNU (or any other free/open source group) written a free/open source Java library that could be used with gcj? I also wonder, is a free JRE out there, that could be used in place of Sun's?

lasindi
 
Old 10-14-2004, 03:43 AM   #17
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
Megaman:
Quote:
I also never said that it was not possible to compile Java to byte code with gcj, did I?
Not sure what is going on in this forum lately... looks like peoples always try to prove you wrong or reply to an already answered question to increase post numbers or something
I didn't jump in to correct you and prove I am more of a man than you. We are all trying to help others, and while you didn't say gcj COULDN'T compile class code, the way you wrote your answer made it sound like gcj was limited to compiling native code. I admit I didn't read your link, but then, I wasn't the one looking for a multi-page introduction to java.

lasindi:
I've compiled and run simple java code without Sun's JRE active, although I do need it to run .class files. A fully free JVM is at www.kaffe.org, or you can use IBM's JVM (which some people swear by, but I'm pretty sure is not open source).
 
Old 10-14-2004, 03:50 AM   #18
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Sun's JRE and JDKs are free, most of the library is open source (6667 class source files in my JDK1.5 src.zip).
Sun is actively contributing to the open source community (http://www.sunsource.net/)
Why don't you want to use Sun's JRE ?
 
Old 10-14-2004, 04:01 AM   #19
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
Quote:
Originally posted by CroMagnon
Megaman:


I didn't jump in to correct you and prove I am more of a man than you. We are all trying to help others, and while you didn't say gcj COULDN'T compile class code, the way you wrote your answer made it sound like gcj was limited to compiling native code. I admit I didn't read your link, but then, I wasn't the one looking for a multi-page introduction to java.

l
CroMagnon:

I understand CroMagnon. You've not done anything wrong, nor did jlliagre. It's was me who used my butt ratter then my head before posting. I really apologize to you and everybody in this thread.
 
Old 10-14-2004, 07:17 AM   #20
jordanGSU
Member
 
Registered: Sep 2004
Distribution: Debian, Slackware, Arch
Posts: 65

Original Poster
Rep: Reputation: 15
Hi lasindi,
I have had luck using gcj to compile java programs without the SUN sdk installed. I had to compile gcc with java enabled as a language...

Below are the commands I used to compile a test.java. Hope this helps

gcj -c -g -O test.java
gcj --main=test -o test test.o

then to execute:
./test
 
Old 10-14-2004, 07:29 AM   #21
javeree
Member
 
Registered: Jun 2004
Location: Belgium
Posts: 49

Rep: Reputation: 15
And if you're looking for a really good personal study book, look for 'Thinking in Java' which is available online for free. When you have worked through that, you will really understand the language, including it's strenghts and weaknesses.
 
Old 10-15-2004, 03:04 AM   #22
lasindi
Member
 
Registered: Apr 2004
Distribution: Slackware, Ubuntu
Posts: 101

Rep: Reputation: 15
jlliagre,

The reason I didn't want to use Sun's libraries was that I was under the impression that these libraries aren't free. So they are? If the JRE and the libraries are all open, then is the only thing closed the compiler? It seems like it would be silly of Sun to not open the compiler for fear of forking; it's the library and the runtime that would be in "danger" of forking. I know that Sun is a well meaning company, but they should open Java more quickly.

lasindi
 
Old 10-15-2004, 09:12 AM   #23
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
lasindi

The libraries are free as in free beer. They are also open source in the sense that you can view their source code as reference, but, as far as I understand, you are only allowed to modify any of the java.* (and perhaps com.sun.* and javax.*) branches inside what is called the java community program, which is open to anyone willing to participate, and free ($0) to individuals.
 
  


Reply



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
How do I configure 'javac' and Using Java on Linux akosombo Linux - General 7 03-13-2005 08:26 AM
How to make javac (java compiler) available on whole system? tisam Linux - Software 11 02-14-2005 09:11 AM
Help php compile javac or java system environment variable antony_csf Programming 1 06-16-2004 01:12 PM
Help php exec, system function for compile javac or java antony_csf Programming 0 06-15-2004 01:45 AM
Can't compile Java Swing Applet with javac chansky Programming 4 09-23-2002 04:50 PM

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

All times are GMT -5. The time now is 07:52 PM.

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