question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running Intelij Community on a raspberry PI model 4 (4G) has a problem with loading pty4j and subsequently cant open terminals in the interface. This seems to be due to a lack of support for ARM 64 architecture. Intelij is fast and highly useable on Raspbian on pi4, I dont think it would be nessacary to support earlier PIs as pi4 is the first version that has suffient ram and performance to run Intelij.

CPU info is:

pi@raspberrypi:~/tmp $ more /proc/cpuinfo
processor	: 0
model name	: ARMv7 Processor rev 3 (v7l)
BogoMIPS	: 108.00
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt 
vfpd32 lpae evtstrm crc32 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

processor	: 1
model name	: ARMv7 Processor rev 3 (v7l)
BogoMIPS	: 108.00
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt 
vfpd32 lpae evtstrm crc32 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

processor	: 2
model name	: ARMv7 Processor rev 3 (v7l)
BogoMIPS	: 108.00
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt 
vfpd32 lpae evtstrm crc32 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

processor	: 3
model name	: ARMv7 Processor rev 3 (v7l)
BogoMIPS	: 108.00
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt 
vfpd32 lpae evtstrm crc32 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

Hardware	: BCM2835
Revision	: c03111
Serial		: 10000000fade59cd
Model		: Raspberry Pi 4 Model B Rev 1.1
pi@raspberrypi:~/tmp $ 

kernel info is:

pi@raspberrypi:~/tmp $ uname -a
Linux raspberrypi 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux
pi@raspberrypi:~/tmp $ 

idea.log showing loading issue.

2019-12-07 10:06:56,788 [1682070]   INFO - erminal.AbstractTerminalRunner - Cannot open Local Terminal 
java.util.concurrent.ExecutionException: Failed to start [/bin/bash, --rcfile, /home/pi/bin/intelij/idea-IC-193.5233.102/plugins/terminal/jediterm-bash.in, -i] in /home/pi/IdeaProjects/ktest
	at org.jetbrains.plugins.terminal.LocalTerminalDirectRunner.createProcess(LocalTerminalDirectRunner.java:197)
	at org.jetbrains.plugins.terminal.LocalTerminalDirectRunner.createProcess(LocalTerminalDirectRunner.java:47)
	at org.jetbrains.plugins.terminal.AbstractTerminalRunner.lambda$openSessionInDirectory$4(AbstractTerminalRunner.java:214)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:238)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Exec_tty error:Cannot load native pty executor library
	at com.pty4j.unix.UnixPtyProcess.execInPty(UnixPtyProcess.java:272)
	at com.pty4j.unix.UnixPtyProcess.<init>(UnixPtyProcess.java:86)
	at com.pty4j.PtyProcessBuilder.start(PtyProcessBuilder.java:111)
	at com.pty4j.PtyProcess.exec(PtyProcess.java:78)
	at com.pty4j.PtyProcess.exec(PtyProcess.java:49)
	at org.jetbrains.plugins.terminal.LocalTerminalDirectRunner.createProcess(LocalTerminalDirectRunner.java:189)
	... 8 more
Caused by: java.lang.RuntimeException: Cannot load native pty executor library
	at com.pty4j.unix.PtyHelpers.getPtyExecutor(PtyHelpers.java:257)
	at com.pty4j.unix.PtyHelpers.execPty(PtyHelpers.java:430)
	at com.pty4j.unix.UnixPtyProcess.exec(UnixPtyProcess.java:333)
	at com.pty4j.unix.UnixPtyProcess$Reaper.execute(UnixPtyProcess.java:389)
	at com.pty4j.unix.UnixPtyProcess$Reaper.run(UnixPtyProcess.java:395)
Caused by: java.lang.UnsatisfiedLinkError: Unable to load library '/home/pi/bin/intelij/idea-IC-193.5233.102/lib/pty4j-native/linux/x86/libpty.so':
/home/pi/bin/intelij/idea-IC-193.5233.102/lib/pty4j-native/linux/x86/libpty.so: cannot open shared object file: No such file or directory
/home/pi/bin/intelij/idea-IC-193.5233.102/lib/pty4j-native/linux/x86/libpty.so: cannot open shared object file: No such file or directory
Native library (home/pi/bin/intelij/idea-IC-193.5233.102/lib/pty4j-native/linux/x86/libpty.so) not found in resource path (/home/pi/bin/intelij/idea-IC-193.5233.102/lib/bootstrap.jar:/home/pi/bin/intelij/idea-IC-193.5233.102/lib/extensions.jar:/home/pi/bin/intelij/idea-IC-193.5233.102/lib/util.jar:/home/pi/bin/intelij/idea-IC-193.5233.102/lib/jdom.jar:/home/pi/bin/intelij/idea-IC-193.5233.102/lib/log4j.jar:/home/pi/bin/intelij/idea-IC-193.5233.102/lib/trove4j.jar:/home/pi/bin/intelij/idea-IC-193.5233.102/lib/jna.jar:/usr/lib/jvm/java-8-openjdk-armhf/lib/tools.jar)
	at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:302)
	at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:455)
	at com.sun.jna.Library$Handler.<init>(Library.java:192)
	at com.sun.jna.Native.loadLibrary(Native.java:646)
	at com.sun.jna.Native.loadLibrary(Native.java:630)
	at com.pty4j.unix.NativePtyExecutor.<init>(NativePtyExecutor.java:14)
	at com.pty4j.unix.PtyHelpers$2.call(PtyHelpers.java:222)
	at com.pty4j.unix.PtyHelpers$2.call(PtyHelpers.java:218)
	at com.pty4j.util.LazyValue.getValue(LazyValue.java:25)
	at com.pty4j.unix.PtyHelpers.getPtyExecutor(PtyHelpers.java:254)
	at com.pty4j.unix.PtyHelpers.<clinit>(PtyHelpers.java:234)
	at com.pty4j.unix.Pty.ptyMasterOpen(Pty.java:140)
	at com.pty4j.unix.Pty.openMaster(Pty.java:176)
	at com.pty4j.unix.Pty.<init>(Pty.java:55)
	at com.pty4j.unix.UnixPtyProcess.<init>(UnixPtyProcess.java:83)
	at com.pty4j.PtyProcessBuilder.start(PtyProcessBuilder.java:111)
	at com.pty4j.PtyProcess.exec(PtyProcess.java:78)
	at com.pty4j.PtyProcess.exec(PtyProcess.java:49)
	at org.jetbrains.plugins.terminal.LocalTerminalDirectRunner.createProcess(LocalTerminalDirectRunner.java:189)
	at org.jetbrains.plugins.terminal.LocalTerminalDirectRunner.createProcess(LocalTerminalDirectRunner.java:47)
	at org.jetbrains.plugins.terminal.AbstractTerminalRunner.lambda$openSessionInDirectory$4(AbstractTerminalRunner.java:214)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:238)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
	Suppressed: java.lang.UnsatisfiedLinkError: /home/pi/bin/intelij/idea-IC-193.5233.102/lib/pty4j-native/linux/x86/libpty.so: cannot open shared object file: No such file or directory
		at com.sun.jna.Native.open(Native Method)
		at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:191)
		... 26 more
	Suppressed: java.lang.UnsatisfiedLinkError: /home/pi/bin/intelij/idea-IC-193.5233.102/lib/pty4j-native/linux/x86/libpty.so: cannot open shared object file: No such file or directory
		at com.sun.jna.Native.open(Native Method)
		at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:204)
		... 26 more
	Suppressed: java.io.IOException: Native library (home/pi/bin/intelij/idea-IC-193.5233.102/lib/pty4j-native/linux/x86/libpty.so) not found in resource path (/home/pi/bin/intelij/idea-IC-193.5233.102/lib/bootstrap.jar:/home/pi/bin/intelij/idea-IC-193.5233.102/lib/extensions.jar:/home/pi/bin/intelij/idea-IC-193.5233.102/lib/util.jar:/home/pi/bin/intelij/idea-IC-193.5233.102/lib/jdom.jar:/home/pi/bin/intelij/idea-IC-193.5233.102/lib/log4j.jar:/home/pi/bin/intelij/idea-IC-193.5233.102/lib/trove4j.jar:/home/pi/bin/intelij/idea-IC-193.5233.102/lib/jna.jar:/usr/lib/jvm/java-8-openjdk-armhf/lib/tools.jar)
		at com.sun.jna.Native.extractFromResourcePath(Native.java:1095)
		at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:276)
		... 26 more
2019-12-07 10:07:14,600 [1699882]   INFO - rationStore.ComponentStoreImpl - Saving Module: 'ktest.linuxMain'FacetManager took 32 ms 
2019-12-07 10:07:14,643 [1699925]   INFO - rationStore.ComponentStoreImpl - Saving Module: 'ktest.linuxTest'FacetManager took 41 ms 

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:25

github_iconTop GitHub Comments

58reactions
krystofcelbacommented, May 8, 2021

Hey, I had the same issue but on macOS with an M1 processor and Android Studio Preview. The above solution works but I had to change the commands slightly. I’m sharing it here for anyone with the same issue on M1 Mac 😃.

git clone https://github.com/JetBrains/pty4j.git
cd pty4j/native
clang -fPIC -c *.c
clang -shared -o libpty.dylib *.o
cp libpty.dylib "/Applications/Android Studio Preview.app/Contents/lib/pty4j-native/darwin/"
11reactions
alerootcommented, Apr 1, 2020

In order to solve the problem you can simply compile the library yourself, for example for aarch4:

  • pty4j/native
  • gcc -fPIC -c *.c
  • gcc -shared -o libpty.so *.o
  • cp libpty.so /opt/idea-IC/lib/pty4j-native/linux/x86_64/libpty.so

Note that IntelliJ look for the library in x86_64 folder even if we are under aarch4 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

AArch64 - Wikipedia
AArch64 or ARM64 is the 64-bit extension of the ARM architecture family. ... (AArch64 only); Advanced SIMD complex number support (AArch64 and AArch32); ......
Read more >
A64 Instruction Set Architecture - Arm Developer
This guide introduces the A64 instruction set, used in the 64-bit Armv8-A architecture, also known as AArch64.
Read more >
Scalable Matrix Extension support for AArch64 Linux
This document outlines briefly the interface provided to userspace by Linux in order to support use of the ARM Scalable Matrix Extension (SME)....
Read more >
What Is ARM64 & Why Should You Use It? - JumpCloud
ARM64 processors are beneficial to enterprises because they can help: Reduce carbon footprint. A 64-bit core can undertake certain operations ...
Read more >
Support for Ubuntu Linux on ARM64 (aarch64) · Issue #4119
Problem We are starting to need to use ARM based Linux (using Ubuntu) but we can't use Sorbet since there is not a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found