Problem while accessing a java file on ubuntu

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












So basically i have installed ubuntu bash from microsoft store in windows 10.I have installed java on ubuntu (the native os is windows 10).javac is working perfactly even it displays the version of java which i have installed(javac 9.0.4).The file name is HelloWorld.java.The java version and rest of the problem is displayed in the this image.



The code is simple hello world program



public class HelloWorld 

public static void main(String args)
// Prints "Hello, World" to the terminal window.
System.out.println("Hello, World");





Even when i try to open the file with pico it displays the same error. [ Error reading HelloWorld.java: Permission denied ]



Solution: chmod u+r filename
But one problem still remains is how to give this permission automatically to all the files which will be copied from windows to ubuntu directory?










share|improve this question























  • Add the output of ls -l HelloWorld.java
    – user000001
    Mar 17 at 18:11











  • The output of ls -l HelloWorld.java is ---------- 1 aditya aditya 188 Mar 17 23:26 HelloWorld.java.It seems like it does not have any permission. @user000001
    – Under_stand
    Mar 17 at 18:16











  • it means you have no permissions. Try chmod u+r HelloWolrd.java, but I just noticed that it's on windows, no idea how you can fix permissions there, sorry..
    – user000001
    Mar 17 at 18:19







  • 2




    I tried chmod u+r HelloWolrd.java and it worked thanks mate.But Every file that i created on windows copied in ubuntu directory(C:UsersadityaAppDataLocalPackagesCanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgscLocalStaterootfshomeaditya) should be modified with explicit permission to read how to avoid this problem?How to give it permission for reading automatically for the copied file @user000001?
    – Under_stand
    Mar 17 at 18:27















up vote
1
down vote

favorite












So basically i have installed ubuntu bash from microsoft store in windows 10.I have installed java on ubuntu (the native os is windows 10).javac is working perfactly even it displays the version of java which i have installed(javac 9.0.4).The file name is HelloWorld.java.The java version and rest of the problem is displayed in the this image.



The code is simple hello world program



public class HelloWorld 

public static void main(String args)
// Prints "Hello, World" to the terminal window.
System.out.println("Hello, World");





Even when i try to open the file with pico it displays the same error. [ Error reading HelloWorld.java: Permission denied ]



Solution: chmod u+r filename
But one problem still remains is how to give this permission automatically to all the files which will be copied from windows to ubuntu directory?










share|improve this question























  • Add the output of ls -l HelloWorld.java
    – user000001
    Mar 17 at 18:11











  • The output of ls -l HelloWorld.java is ---------- 1 aditya aditya 188 Mar 17 23:26 HelloWorld.java.It seems like it does not have any permission. @user000001
    – Under_stand
    Mar 17 at 18:16











  • it means you have no permissions. Try chmod u+r HelloWolrd.java, but I just noticed that it's on windows, no idea how you can fix permissions there, sorry..
    – user000001
    Mar 17 at 18:19







  • 2




    I tried chmod u+r HelloWolrd.java and it worked thanks mate.But Every file that i created on windows copied in ubuntu directory(C:UsersadityaAppDataLocalPackagesCanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgscLocalStaterootfshomeaditya) should be modified with explicit permission to read how to avoid this problem?How to give it permission for reading automatically for the copied file @user000001?
    – Under_stand
    Mar 17 at 18:27













up vote
1
down vote

favorite









up vote
1
down vote

favorite











So basically i have installed ubuntu bash from microsoft store in windows 10.I have installed java on ubuntu (the native os is windows 10).javac is working perfactly even it displays the version of java which i have installed(javac 9.0.4).The file name is HelloWorld.java.The java version and rest of the problem is displayed in the this image.



The code is simple hello world program



public class HelloWorld 

public static void main(String args)
// Prints "Hello, World" to the terminal window.
System.out.println("Hello, World");





Even when i try to open the file with pico it displays the same error. [ Error reading HelloWorld.java: Permission denied ]



Solution: chmod u+r filename
But one problem still remains is how to give this permission automatically to all the files which will be copied from windows to ubuntu directory?










share|improve this question















So basically i have installed ubuntu bash from microsoft store in windows 10.I have installed java on ubuntu (the native os is windows 10).javac is working perfactly even it displays the version of java which i have installed(javac 9.0.4).The file name is HelloWorld.java.The java version and rest of the problem is displayed in the this image.



The code is simple hello world program



public class HelloWorld 

public static void main(String args)
// Prints "Hello, World" to the terminal window.
System.out.println("Hello, World");





Even when i try to open the file with pico it displays the same error. [ Error reading HelloWorld.java: Permission denied ]



Solution: chmod u+r filename
But one problem still remains is how to give this permission automatically to all the files which will be copied from windows to ubuntu directory?







permissions java






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 17 at 18:44

























asked Mar 17 at 18:10









Under_stand

63




63











  • Add the output of ls -l HelloWorld.java
    – user000001
    Mar 17 at 18:11











  • The output of ls -l HelloWorld.java is ---------- 1 aditya aditya 188 Mar 17 23:26 HelloWorld.java.It seems like it does not have any permission. @user000001
    – Under_stand
    Mar 17 at 18:16











  • it means you have no permissions. Try chmod u+r HelloWolrd.java, but I just noticed that it's on windows, no idea how you can fix permissions there, sorry..
    – user000001
    Mar 17 at 18:19







  • 2




    I tried chmod u+r HelloWolrd.java and it worked thanks mate.But Every file that i created on windows copied in ubuntu directory(C:UsersadityaAppDataLocalPackagesCanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgscLocalStaterootfshomeaditya) should be modified with explicit permission to read how to avoid this problem?How to give it permission for reading automatically for the copied file @user000001?
    – Under_stand
    Mar 17 at 18:27

















  • Add the output of ls -l HelloWorld.java
    – user000001
    Mar 17 at 18:11











  • The output of ls -l HelloWorld.java is ---------- 1 aditya aditya 188 Mar 17 23:26 HelloWorld.java.It seems like it does not have any permission. @user000001
    – Under_stand
    Mar 17 at 18:16











  • it means you have no permissions. Try chmod u+r HelloWolrd.java, but I just noticed that it's on windows, no idea how you can fix permissions there, sorry..
    – user000001
    Mar 17 at 18:19







  • 2




    I tried chmod u+r HelloWolrd.java and it worked thanks mate.But Every file that i created on windows copied in ubuntu directory(C:UsersadityaAppDataLocalPackagesCanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgscLocalStaterootfshomeaditya) should be modified with explicit permission to read how to avoid this problem?How to give it permission for reading automatically for the copied file @user000001?
    – Under_stand
    Mar 17 at 18:27
















Add the output of ls -l HelloWorld.java
– user000001
Mar 17 at 18:11





Add the output of ls -l HelloWorld.java
– user000001
Mar 17 at 18:11













The output of ls -l HelloWorld.java is ---------- 1 aditya aditya 188 Mar 17 23:26 HelloWorld.java.It seems like it does not have any permission. @user000001
– Under_stand
Mar 17 at 18:16





The output of ls -l HelloWorld.java is ---------- 1 aditya aditya 188 Mar 17 23:26 HelloWorld.java.It seems like it does not have any permission. @user000001
– Under_stand
Mar 17 at 18:16













it means you have no permissions. Try chmod u+r HelloWolrd.java, but I just noticed that it's on windows, no idea how you can fix permissions there, sorry..
– user000001
Mar 17 at 18:19





it means you have no permissions. Try chmod u+r HelloWolrd.java, but I just noticed that it's on windows, no idea how you can fix permissions there, sorry..
– user000001
Mar 17 at 18:19





2




2




I tried chmod u+r HelloWolrd.java and it worked thanks mate.But Every file that i created on windows copied in ubuntu directory(C:UsersadityaAppDataLocalPackagesCanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgscLocalStaterootfshomeaditya) should be modified with explicit permission to read how to avoid this problem?How to give it permission for reading automatically for the copied file @user000001?
– Under_stand
Mar 17 at 18:27





I tried chmod u+r HelloWolrd.java and it worked thanks mate.But Every file that i created on windows copied in ubuntu directory(C:UsersadityaAppDataLocalPackagesCanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgscLocalStaterootfshomeaditya) should be modified with explicit permission to read how to avoid this problem?How to give it permission for reading automatically for the copied file @user000001?
– Under_stand
Mar 17 at 18:27











1 Answer
1






active

oldest

votes

















up vote
0
down vote













To change permissions of all the .java files in the Ubuntu directory:



  1. Change directories with cd to the Ubuntu directory.



  2. Run this command:



    chmod u+rw *.java






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1016808%2fproblem-while-accessing-a-java-file-on-ubuntu%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    To change permissions of all the .java files in the Ubuntu directory:



    1. Change directories with cd to the Ubuntu directory.



    2. Run this command:



      chmod u+rw *.java






    share|improve this answer
























      up vote
      0
      down vote













      To change permissions of all the .java files in the Ubuntu directory:



      1. Change directories with cd to the Ubuntu directory.



      2. Run this command:



        chmod u+rw *.java






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        To change permissions of all the .java files in the Ubuntu directory:



        1. Change directories with cd to the Ubuntu directory.



        2. Run this command:



          chmod u+rw *.java






        share|improve this answer












        To change permissions of all the .java files in the Ubuntu directory:



        1. Change directories with cd to the Ubuntu directory.



        2. Run this command:



          chmod u+rw *.java







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 17 at 19:00









        karel

        50.9k11107127




        50.9k11107127



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1016808%2fproblem-while-accessing-a-java-file-on-ubuntu%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            GRUB: Fatal! inconsistent data read from (0x84) 0+xxxxxx

            What makes Checkinstall packages not suitable for distribution?

            Running the scala interactive shell from the command line