Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
Hello, I am using Mandriva 2006 and I just download java from: Here I need to java working as soon as possible. I have it working but I have to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2006
    Posts
    55

    Java Installation--help


    Hello, I am using Mandriva 2006 and I just download java from: Here

    I need to java working as soon as possible. I have it working but I have to go the bin directory then do the command
    Code:
    ./java (file)
    I need to know how to get the classpath working so that I can run the java from my home folder or other folders. I really appreciate the help. Thank you.

    ~Linux1245

  2. #2
    Linux User
    Join Date
    Jan 2006
    Posts
    414
    If you're using KDE then;
    right click on the desktop
    create new --> link to application
    Name it as Java (or whatever)
    Go to the application tab
    enter the location of the application in command (something like /bin/java most likely)
    click OK and you should now have a desktop icon

    right clicking on Kmenu and selecting menu editor will allow you to add a link from the menu in a similar manner.

  3. #3
    Just Joined!
    Join Date
    Jan 2006
    Posts
    55
    I tried that but here's what happened in the command line:
    Code:
    [root@localhost name]# ls
    Desktop/    Download/        java*   Pictures/  Video/
    Documents/  HelloWorld.java  Music/  tmp/
    [root@localhost name]# ./java
    ./java: line 1: [Desktop: command not found
    ./java: line 17: X-DCOP-ServiceType=: command not found
    ./java: line 18: X-KDE-SubstituteUID=false: command not found
    ./java: line 19: X-KDE-Username=: command not found
    [root@localhost name]#
    Am I putting the correct properties in for the application tab? Thanks again.

    ~Linux1245

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User
    Join Date
    Jan 2006
    Posts
    414
    Where EXACTLY is java located on your system?

    From your first post I take entering either of following in the command line will run java
    Code:
    /bin/java
    or
    Code:
    cd /bin/
    ./java
    Is this correct?
    If not what do you enter to run it?

    If this is correct then enter /bin/java in the command area on the application tab of the link setup window.

    Otherwise enter the full pathname of the application.

    It should look something like this;

  6. #5
    Just Joined!
    Join Date
    Jan 2006
    Posts
    55
    It is located in
    Code:
    /usr/java/jdk1.5.0_06/bin
    This is where the java and other commands are located.
    So what exactly would I put in? Thanks for all the help

    ~Linux1245

  7. #6
    Just Joined!
    Join Date
    Jan 2006
    Posts
    55
    I tried what you said but I still get the same error. Can I try changing classpath or something? I really need to get this working. Thanks so much.

    ~Linux1245

  8. #7
    Linux Engineer Zelmo's Avatar
    Join Date
    Jan 2006
    Location
    Riverton, UT, USA
    Posts
    1,001
    The easiest thing I've found is to add the path to Java's bin directory to my ~/.bashrc.
    For example, here's two lines I appended to the end of my .bashrc:
    Code:
    # Path to java
    export PATH=/usr/local/apps/jdk1.5.0_06/bin:$PATH
    With this, my shell knows to keep that path in mind, and I can run java apps from anywhere.
    Stand up and be counted as a Linux user!

  9. #8
    Just Joined!
    Join Date
    Jan 2006
    Posts
    55
    I just copied the java command to /usr/sbin and the java command works except it comes up with an error:
    Code:
    [root@localhost name]#java
    Error: could not find libjava.so
    Error: could not find java 2 Runtime Environment
    I tried the command when I was in the bin directory and it worked. I'm guessing it is not working because I am not running it from the bin directory.

  10. #9
    Just Joined!
    Join Date
    Jan 2006
    Posts
    55
    In the bin directory, the error still comes up but it doesn't if I run ./java instead of just java. If I run ./java from a different directory it says file not found and if I just run java then the error comes up. Any Ideas? Thanks.

    ~Linux1245

  11. #10
    Linux Guru fingal's Avatar
    Join Date
    Jul 2003
    Location
    Birmingham - UK
    Posts
    1,539
    Have you tried adding the Java executable to your path?

    PATH=$PATH:/path/to/java/binary



    Also - in your /etc directory there's a file called environment. As root you could add this line to environment:

    export JAVA_HOME=/usr/java/

    You might need to log out and in again. Then type env on the command line to see if it got added. I tried this the other week and it worked for me. It kind of assumes a similar java installation to mine, but I think we have the same version.
    I am always doing that which I can not do, in order that I may learn how to do it. - Pablo Picasso

Page 1 of 2 1 2 LastLast

Posting Permissions

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