Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Thursday 11 March 2021

Setting Java Home in Ubuntu 20

1.Open Terminal Using the command ctr+alt+T

2.Type the Command 'sudo -H gedit /etc/profile

3.Separate Window Opens up there add the following

JAVA_HOME=/opt/java/jre1.8.0_281/bin
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH

4.In JAVA_HOME point it to the directory where you have extracted the Java.Save it and close the window.

5.Logout and Login again now test the java home using the echo $JAVA_HOME

Happy Learning.!!!!


Sunday 16 August 2020

Unexpected token Error During Ant Build

Today I was facing the Strange Error, Which I have not Faced earlier. 


Error Log:

$ ./cant create-ear

./cant: line 2: $'\r': command not found

./cant: line 4: $'\r': command not found

 create-ear

./cant: line 32: syntax error near unexpected token `elif'

'/cant: line 32: `elif [ "$system" = "Linux" ];then


Later Investigating it Found the Issue with the File System. Hence Googled it and Found the Solution. The Solution is First Identify which Machine are you using, ie Linux or Windows. Then Procced to the Solution


Cause:

In My case, I was using the Linux Machine and trying to execute the File Saved in Windows.


Solution:

To Fix this Open the File in Notepad ++ and Navigate to EDIT>EOL Conversion

Select Unix(LF) Conversion If you need to execute it in the Linux Environment.

Select Windows (CR LF) In case you need to execute in Windows Environment.

Select Macintosh (CR) In Case of Mac.

This Solution is not Specific to ant alone, can be used for other files as well.

Happy Learning !!!



Sunday 6 August 2017

Clearing Cache In Linux

Hi All,
         Today, I was Facing error with Respect to the Memory , Though I have Enough Memory in my Machine, it's not Clearing out . 

How I identified this 

1) Executed the Command free -m 

this will give the Free Memory Report in the Linux Box.

2) I am Running only one Instance but taking lot of memory ,it  has not cleared the Cache Memory this can be cleared out by the Below Command .

 #!/bin/sh
sync; echo 3 > /proc/sys/vm/drop_caches


Make Sure you are running as the Root Before Executing this.

Happy Learning !!!!