Java compiler

Need help with C, C++, perl, python, etc?

Java compiler

Postby warydig » 2006-10-23 13:31

Hi, ive installed java on my debian sarge system, and it seems to work fine. But I cant seem to get the "javac" command to work, so that I can compile my java applications. Do I have to install a new package?
warydig
 
Posts: 47
Joined: 2006-10-16 12:52

Re: Java compiler

Postby jbergin » 2006-10-27 01:34

Hi warydig, when it comes to setting up a Java environment under Linux there are a few options, but in my own opinion, only one decent option (Sun's or IBM's SDK).

There are a few open source Java compilers, namely; GCJ, and Jikes. For a Java Virtual Machine (runs the byte code) there are; GIJ and Kaffee, but each of the previously mentioned software do not fully implement the Java 2 specification. So, you'll have problems running Java programmes from Java Games, to Java desktop applications. Also both the compilers and interpreters (Virtual Machines) use pretty basic optimisation techniques when compared to Sun's and IBM's Java implementations.

So, I suggest you "apt get remove..." whatever Java stuff you've installed, and instead download Java 1.5 from Sun.

https://sdlc2d.sun.com/ECom/EComActionServlet;jsessionid=9BEFBEB2F60332E5487E34CFEF710C50

Choose the "self-extracting" version, and

Code: Select all
chmod u+x jdk-1_5_0_09-linux-i586.bin
./jdk-1_5_0_09-linux-i586.bin


Move the directory to where ever you want it to go, and create a symbolic link to it, so "java" and "javac" are available to other programmes. In the example below I'm using "/export/bin/java-1.5" as the place where I've installed Java 1.5

Code: Select all
su -
rm -f /usr/bin/java /usr/bin/javac
ln -s  /export/bin/java-1.5/bin/java /usr/bin/java
ln -s  /export/bin/java-1.5/bin/javac /usr/bin/javac


Also, you make sure you set your browser up with Java support. I'm using Firefox, but for Mozilla or Opera its pretty much the same. Again, I've assumed you've installed Sun's Java in "/export/bin/java-1.5", so in your case change to the appropriate directory.

Code: Select all
cd /export/bin/java-1.5
find . -iname libjavaplugin_oji.so -exec cp {} /usr/lib/firefox/plugins/ \;


The last line looks for the file "libjavaplugin_oji.so" and installs it in /usr/lib/firefox/plugins/ but the plugins directory for your browser is most likely in a different place e.g "~/.mozilla/firefox/plugins" or few other places.

Anyways, hope this works.

:twisted:

warydig wrote:Hi, ive installed java on my debian sarge system, and it seems to work fine. But I cant seem to get the "javac" command to work, so that I can compile my java applications. Do I have to install a new package?
jbergin
 
Posts: 3
Joined: 2006-10-27 00:58

Postby brain » 2006-10-27 02:16

And if you want to turn the bin-file from Sun into a deb-package (which easily can be removed later), install the package java-package, then do:
Code: Select all
make-jpkg jdk-1_5_0_09-linux-i586.bin
and then install the package:
Code: Select all
dpkg -i <deb-file>
User avatar
brain
 
Posts: 253
Joined: 2006-04-25 17:15

Postby warydig » 2006-10-29 16:49

That worked brilliantly! Thank you very much!
warydig
 
Posts: 47
Joined: 2006-10-16 12:52


Return to Programming

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable