Suranga P. Kulasekara wrote:HI,I'm new Linux, and I want to know that ,how to set classpath for java permantly on linux.I'm using Oracle Solaris 11.
By this I think you mean you dont want to issue the SET classpath command everytime. To do this , you will have to set up your variable either on Environment level or on user level
Note. Setting the variable on user level would require that all users RE_LOGIN to the machine after logout . While on the other hand if you set at the environment level , then your machine will need to be re-booted.
For Environment level . Edit the file /etc/environment and set the java class path . I'll paste a dummy environment file so you can compare yours
Save and close and
re-boot the machine.
For User level . Edit the /etc/bashrc ( or the /etc/profile ) and export the java path at the top of the file as follows
Save and close . Now the user for which you have set the variable needs to logout and log back in so that the bashrc file will re-execute for that session.