Problem while accessing a java file on ubuntu

Clash 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?
permissions java
add a comment |Â
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?
permissions java
Add the output ofls -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. Trychmod 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 triedchmod u+r HelloWolrd.javaand 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 a comment |Â
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?
permissions java
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
permissions java
edited Mar 17 at 18:44
asked Mar 17 at 18:10
Under_stand
63
63
Add the output ofls -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. Trychmod 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 triedchmod u+r HelloWolrd.javaand 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 a comment |Â
Add the output ofls -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. Trychmod 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 triedchmod u+r HelloWolrd.javaand 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
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
To change permissions of all the .java files in the Ubuntu directory:
Change directories with
cdto the Ubuntu directory.Run this command:
chmod u+rw *.java
add a comment |Â
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:
Change directories with
cdto the Ubuntu directory.Run this command:
chmod u+rw *.java
add a comment |Â
up vote
0
down vote
To change permissions of all the .java files in the Ubuntu directory:
Change directories with
cdto the Ubuntu directory.Run this command:
chmod u+rw *.java
add a comment |Â
up vote
0
down vote
up vote
0
down vote
To change permissions of all the .java files in the Ubuntu directory:
Change directories with
cdto the Ubuntu directory.Run this command:
chmod u+rw *.java
To change permissions of all the .java files in the Ubuntu directory:
Change directories with
cdto the Ubuntu directory.Run this command:
chmod u+rw *.java
answered Mar 17 at 19:00
karel
50.9k11107127
50.9k11107127
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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.javaand 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