Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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
    ./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.


  2. #2
    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
    I tried that but here's what happened in the command line:
    [root@localhost name]# ls
    Desktop/    Download/        java*   Pictures/  Video/
    Documents/  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.


  4. $spacer_open
  5. #4
    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
    cd /bin/
    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
    It is located in
    This is where the java and other commands are located.
    So what exactly would I put in? Thanks for all the help


  7. #6
    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.


  8. #7
    Linux Engineer Zelmo's Avatar
    Join Date
    Jan 2006
    Riverton, UT, USA
    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:
    # 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
    I just copied the java command to /usr/sbin and the java command works except it comes up with an error:
    [root@localhost name]#java
    Error: could not find
    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
    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.


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


    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

Posting Permissions

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