Find the answer to your Linux question:
Results 1 to 4 of 4
for running javac i need to write the below mentioned code everytime : export JAVA_HOME=<PATH OF JDK> export PATH=$JAVA_HOME/bin:=$PATH is there anything of some sort which can help me in ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2004
    Location
    India
    Posts
    25

    configuring javac and java


    for running javac i need to write the below mentioned code everytime :


    export JAVA_HOME=<PATH OF JDK>
    export PATH=$JAVA_HOME/bin:=$PATH


    is there anything of some sort which can help me in such a way that i dont need to write it again and again
    i mean some permanent code or command which configures the path


    please help

  2. #2
    Linux Newbie
    Join Date
    Jan 2004
    Location
    Belgrade, S&M
    Posts
    177
    You can alias them or add the lines to /etc/rc.local.
    aliasing:
    add
    alias java 'export JAVA_HOME=<PATH OF JDK>;
    export PATH=$JAVA_HOME/bin:=$PATH'
    to the shell file you are using (/usr/.bashrc);

  3. #3
    Linux Newbie
    Join Date
    Apr 2004
    Location
    Greece
    Posts
    187

    java

    you can just make a script in your /etc/profile.d/ directory like java.sh if you use sh shell with those commands and it will work

  4. #4
    Linux Guru
    Join Date
    May 2004
    Location
    forums.gentoo.org
    Posts
    1,817
    Yet another way, with a tool you should learn, is with a soft link. Assuming you usually work in directory /home/yourname/javafiles:
    Code:
    # ln -s /usr/java/j2sdk1.4.2_04/bin/javac  /home/yourname/javafiles/javac
    Of course you need to adjust for your exact filepaths. If the folder your work in is not in your path, you can change your path, or you can
    Code:
    ./javac  yourfile.java

Posting Permissions

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