Results 1 to 6 of 6

Thread: java compiler and interpreter

  1. #1
    Junior Member registered user
    Join Date
    Aug 2003
    Posts
    17

    java compiler and interpreter

    i have a dual boot system with XP and knoppix.
    i am not very well versed when it comes to linux, but i can't really concentrate on learning linux because i am stuck using windows for all the programming stuff i do.

    i tried to download the compiler and interpreter from java.sun.com but i really don't know how to make it install or run. as i said im not well versed in linux. can i apt-get them someway?

    any help would be appreciated

  2. #2
    Junior Member registered user
    Join Date
    Sep 2003
    Posts
    22
    Sun does not use an open license for Java so it is not included with the official Debian archives, so you can't apt-get install with a stock /etc/sources.list file.

    However, the Blackdown project (blackdown.org) provides Java packages for Debian (and many others). These are not very up to date (usually) so I just download the Java SDK (not the JRE!) from Sun and install it.

    Here's how you do it:

    1. Download the "Linux self-extracting file" package from http://java.sun.com/j2se/1.4.2/download.html

    2. Create a directory for Java related stuff under /usr/local:
    $ cd /usr/local
    $ su (enter password for root, note that the prompt changes when you're root)
    # mkdir java
    # cd java

    3. Then you need to run the file. With this file you can do it like this:
    # sh j2sdk-1_4_2_01-linux-i586.bin
    ....or like this:
    # chmod +x j2sdk-1_4_2_01-linux-i586.bin (this makes the file executable)
    # /home/hw/downloads/j2sdk-1_4_2_01-linux-i586.bin (execute it - run this from the /usr/local/java directory)

    4. Now it's installed. Still, the java and javac commands won't work from the command line because the /bin subdirectory from the SDK isn't in the path. We need to add them somehow. There are many different ways of doing this but this is how I usually do it:
    Edit /etc/profile (as root) with your favourite text editor. There should be a line that specifies directories that contain executables and should be added to the PATH environment variable. Something like this:
    PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"
    The directories are separated by colons(. Add a colon at the end of the line (but before the closing quote) and add the Java bin directory. If you followed my outline above it should be /usr/local/java/j2sdk1.4.2/bin/.
    Now the line looks like this:
    PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/usr/local/java/j2sdk/bin"
    Save the file!

    Either log out and log in again or do a "source /etc/profile" to let the changes take effect. Type "javac" at the shell prompt and you should see the exact same thing as you see on Windows!

    hw

  3. #3
    Junior Member registered user
    Join Date
    Aug 2003
    Posts
    17
    thanks a shitload!! i will try this tonight for sure. thank you for your help, ill post if i have any troubles (i probably wont)

  4. #4
    Junior Member registered user
    Join Date
    Feb 2004
    Location
    Michigan
    Posts
    12
    Thanks a shit-load indeed. That is an excellent how-to post. You are a scholar and a gentleman.

  5. #5
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    Long Island, NY, USA
    Posts
    1,256
    Yup, getting everything from java.sun.com is a good idea. That way you have the full java suite including javac, java, javadoc and appletviewer.

    However, I use the following method without installing anything to an hdinstall (also works off a liveCD boot).

    http://www.knoppix.net/forum/viewtopic.php?p=38190
    http://www.knoppix.net/forum/viewtopic.php?p=38440

    Enjoy!

    Regards,
    AJG

  6. #6
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    Long Island, NY, USA
    Posts
    1,256
    OK, I just tried to install the *.rpm with alien and kpackage as root. I used the *.rpm for J2SE 1.5 instead of the method listed above because I need to change the version of java system wide so all my users would get the update. The JDK that comes with KNOPPIX doesn't include javax.swing.*, javadoc or appletviewer. So I want all my users to get all this stuff! The problem is that the new java installation isn't available to my users. Did I forget to do something???

    TIA,
    AJG

Similar Threads

  1. php interpreter error
    By mrobertson in forum General Support
    Replies: 0
    Last Post: 06-07-2005, 02:45 PM
  2. Can't execute a file since bad interpreter
    By gopikrish in forum General Support
    Replies: 1
    Last Post: 08-21-2004, 02:52 AM
  3. CC-Compiler & apt-get
    By Ralf79 in forum General Support
    Replies: 0
    Last Post: 11-26-2003, 09:34 PM
  4. Where do i find C++ compiler?
    By Rookie in forum General Support
    Replies: 3
    Last Post: 10-11-2003, 11:30 PM
  5. Bash Bad Interpreter
    By michaelmontagne in forum General Support
    Replies: 1
    Last Post: 09-04-2003, 09:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Acer Aspire 14

Acer Aspire 14" AI Copilot+PC Laptop Core Ultra 5 226V Gen 4 ARC 16GB 1TB Refurb

$480.63



Dell Latitude 14

Dell Latitude 14" Laptop Computer Intel i5 Up To 32GB RAM 1TB SSD Windows 11 Pro

$372.48



External SSD 1TB 2TB  Portable Hard Drive USB 3.1 Type-C High Speed PC Mac picture

External SSD 1TB 2TB Portable Hard Drive USB 3.1 Type-C High Speed PC Mac

$16.99



Acer Predator Helios Neo 16S AI 16

Acer Predator Helios Neo 16S AI 16" i9 275HX 2S RTX 5070 Ti 32GB 1TB SSD Refurb

$1794.16



SAMSUNG T7 Portable SSD 1TB Indigo Blue USB 3.2 Gen2 External MU-PC1T0H/AM picture

SAMSUNG T7 Portable SSD 1TB Indigo Blue USB 3.2 Gen2 External MU-PC1T0H/AM

$159.99



Netac 2TB 1TB 512GB 256GB Internal SSD 2.5inch SATAIII Solid State Drive lot picture

Netac 2TB 1TB 512GB 256GB Internal SSD 2.5inch SATAIII Solid State Drive lot

$1090.00



Fanxiang 1/2/5/10Pcs 2.5'' SATA SSD Lot 1TB 2TB 4TB 512GB 256GB TLC Internal SSD picture

Fanxiang 1/2/5/10Pcs 2.5'' SATA SSD Lot 1TB 2TB 4TB 512GB 256GB TLC Internal SSD

$129.99



Dell ST91000640SS 1TB 2.5

Dell ST91000640SS 1TB 2.5" 6Gb/s 64MB 7.2K RPM SAS Hard Drive Dell P/N: 0VXTPX

$16.99



WAVLINK Thunderbolt 5 Dock, 13-in-1 TB5 Docking Station with NVMe M.2  picture

WAVLINK Thunderbolt 5 Dock, 13-in-1 TB5 Docking Station with NVMe M.2

$162.98



Dell Latitude 5591 Hex Core i7-8850h@ 2.6 GHz  15.6

Dell Latitude 5591 Hex Core i7-8850h@ 2.6 GHz 15.6" 16gb NEW 1TB SSD "GRADE A+"

$499.00