You are not logged in.

#1 2023-05-22 16:15:14

Yurim64
Member
Registered: 2023-05-22
Posts: 4

Eclipse runs only with sudo

Hi, I'm new to Arch and I'm trying to install the package eclipse-java from the AUR.
I followed the installation guide for AUR packages, but when i try to lunch eclipse I'm getting the error:

[Ike@archlinux ~]$ eclipse
bash: eclipse: command not found

I searched for the executable in /usr/bin, and the file "eclipse" is present with permission:

[Ike@archlinux bin]$ ls -l eclipse 
lrwxrwxrwx 1 root root 24 May 22 14:32 eclipse -> /usr/lib/eclipse/eclipse

I tried to run eclipse using sudo, and it run perfectly.
I already tried to uninstall and reinstall the package, but the situation does not change at all.
I don't think this is the usual behavior, but I don't understand why is this happening and what can I do to fix it.

Last edited by Yurim64 (2023-05-22 16:17:03)

Offline

#2 2023-05-22 16:45:37

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: Eclipse runs only with sudo

First off, don't run eclipse as root.   It will very likely create files owned by root throughout your home directory that you won't be able to overwrite, chance or delete.  Perhaps not even read.

As your user, what are the output of which eclipse  and echo $PATH  ?
How about as root?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2023-05-22 16:53:03

Yurim64
Member
Registered: 2023-05-22
Posts: 4

Re: Eclipse runs only with sudo

For user the outputs are:

[Ike@archlinux ~]$ which eclipse
which: no eclipse in (/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
[Ike@archlinux ~]$ echo /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

For root:

[root@archlinux Ike]# which eclipse
/usr/bin/eclipse
[root@archlinux Ike]# echo /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

It seems like my user can't find the eclipse executable, but its there so i don't really know whats going on. Maybe something with the permission that i don't see?

Offline

#4 2023-05-22 16:55:42

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,461

Re: Eclipse runs only with sudo

stat /usr/lib/eclipse/eclipse

Offline

#5 2023-05-22 17:01:45

Yurim64
Member
Registered: 2023-05-22
Posts: 4

Re: Eclipse runs only with sudo

Ok this is what i find out.

[Ike@archlinux ~]$ stat /usr/lib/eclipse/eclipse
stat: cannot statx '/usr/lib/eclipse/eclipse': Permission denied
[Ike@archlinux ~]$ ls -l /usr/lib/eclipse/eclipse
ls: cannot access '/usr/lib/eclipse/eclipse': Permission denied
[Ike@archlinux ~]$ sudo ls -l /usr/lib/eclipse/eclipse
[sudo] password for Ike: 
-rwx--x--x 1 root root 25784 May 22 14:32 /usr/lib/eclipse/eclipse
[Ike@archlinux ~]$ 

And this are the permission of the directory /usr/lib/eclipse:

drwx--x---   8 root root      4096 May 22 14:37 eclipse

Tecnically i should have the permission to execute eclipse right?

Offline

#6 2023-05-22 18:47:45

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: Eclipse runs only with sudo

Technically, you don't have permissions to enter /usr/lib/eclipse, so you can also not access anything inside.

Since the reason of your problem is clear, let's look for the cause

pacman -Qo /usr/lib/eclipse
pacman -Qikk $(pacman -Qoq /usr/lib/eclipse)

Offline

#7 2023-05-22 20:31:51

Yurim64
Member
Registered: 2023-05-22
Posts: 4

Re: Eclipse runs only with sudo

pacman -Qo /usr/lib/eclipse:

/usr/lib/eclipse/ is owned by eclipse-java 2:4.27-1

pacman -Qikk $(pacman -Qoq /usr/lib/eclipse)
While running this im getting a lot of warning for permission denied

Name            : eclipse-java
Version         : 2:4.27-1
Description     : Highly extensible IDE (Java version)
Architecture    : x86_64
URL             : https://www.eclipse.org/
Licenses        : EPL
Groups          : None
Provides        : eclipse=4.27-1
Depends On      : java-environment>=11  webkit2gtk  unzip
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : eclipse
Replaces        : None
Installed Size  : 348.83 MiB
Packager        : Unknown Packager
Build Date      : Mon 22 May 2023 02:32:38 PM UTC
Install Date    : Mon 22 May 2023 02:37:09 PM UTC
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : None

eclipse-java: 1811 total files, 1709 altered files

sudo pacman -Qikk $(pacman -Qoq /usr/lib/eclipse)

Name            : eclipse-java
Version         : 2:4.27-1
Description     : Highly extensible IDE (Java version)
Architecture    : x86_64
URL             : https://www.eclipse.org/
Licenses        : EPL
Groups          : None
Provides        : eclipse=4.27-1
Depends On      : java-environment>=11  webkit2gtk  unzip
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : eclipse
Replaces        : None
Installed Size  : 348.83 MiB
Packager        : Unknown Packager
Build Date      : Mon 22 May 2023 02:32:38 PM UTC
Install Date    : Mon 22 May 2023 02:37:09 PM UTC
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : None

eclipse-java: 1811 total files, 12 altered files

Offline

#8 2023-05-22 20:41:28

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: Eclipse runs only with sudo

eclipse-java: 1811 total files, 12 altered files

So something happened to that package - Qikk should™ have told you md5sum/permission mismatches?
Any idea how you might have changed them (and why)?

Simply fix the package.

Offline

Board footer

Powered by FluxBB