经测试,jetbrain大部分版本都是可以安装在loongarch上的,但内置的terminal不能用。需要注意jetbrain版本和openjdk版本的对应关系。
2023年的版本需编译一下几个so库,替换掉x86_64的文件 可以在 https://github.com/JetBrains/intellij-community 这个仓库中找
貌似软件里的终端打不开,报错信息如下。
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native at com.sun.jna.NativeLong.<clinit>(NativeLong.java:35) at jtermios.linux.JTermiosImpl.<clinit>(JTermiosImpl.java:61) at jtermios.JTermios.<clinit>(JTermios.java:288) at com.pty4j.unix.PtyHelpers.<clinit>(PtyHelpers.java:190) at com.pty4j.unix.Pty.ptyMasterOpen(Pty.java:130) at com.pty4j.unix.Pty.openMaster(Pty.java:166) at com.pty4j.unix.Pty.<init>(Pty.java:64) at com.pty4j.unix.UnixPtyProcess.<init>(UnixPtyProcess.java:59) at com.pty4j.PtyProcessBuilder.start(PtyProcessBuilder.java:147) at org.jetbrains.plugins.terminal.LocalTerminalDirectRunner.createProcess(LocalTerminalDirectRunner.java:258) at org.jetbrains.plugins.terminal.LocalTerminalDirectRunner.createProcess(LocalTerminalDirectRunner.java:56) at org.jetbrains.plugins.terminal.AbstractTerminalRunner.lambda$openSessionInDirectory$2(AbstractTerminalRunner.java:216) at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:272) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:740) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:737) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:737) at java.base/java.lang.Thread.run(Thread.java:1623) Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: Unable to locate JNA native support library [in thread "DefaultDispatcher-worker-19"] at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:1018) at com.sun.jna.Native.<clinit>(Native.java:221) at com.intellij.jna.JnaLoader.load(JnaLoader.java:19) at com.intellij.idea.StartupUtil$loadSystemLibsAndLogInfoAndInitMacApp$1$2.invokeSuspend(StartupUtil.kt:366) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
at com.sun.jna.NativeLong.<clinit>(NativeLong.java:35) at jtermios.linux.JTermiosImpl.<clinit>(JTermiosImpl.java:61) at jtermios.JTermios.<clinit>(JTermios.java:288) at com.pty4j.unix.PtyHelpers.<clinit>(PtyHelpers.java:190) at com.pty4j.unix.Pty.ptyMasterOpen(Pty.java:130) at com.pty4j.unix.Pty.openMaster(Pty.java:166) at com.pty4j.unix.Pty.<init>(Pty.java:64) at com.pty4j.unix.UnixPtyProcess.<init>(UnixPtyProcess.java:59) at com.pty4j.PtyProcessBuilder.start(PtyProcessBuilder.java:147) at org.jetbrains.plugins.terminal.LocalTerminalDirectRunner.createProcess(LocalTerminalDirectRunner.java:258) at org.jetbrains.plugins.terminal.LocalTerminalDirectRunner.createProcess(LocalTerminalDirectRunner.java:56) at org.jetbrains.plugins.terminal.AbstractTerminalRunner.lambda$openSessionInDirectory$2(AbstractTerminalRunner.java:216) at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:272) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:740) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:737) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:737) at java.base/java.lang.Thread.run(Thread.java:1623)
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: Unable to locate JNA native support library [in thread "DefaultDispatcher-worker-19"]
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:1018) at com.sun.jna.Native.<clinit>(Native.java:221) at com.intellij.jna.JnaLoader.load(JnaLoader.java:19) at com.intellij.idea.StartupUtil$loadSystemLibsAndLogInfoAndInitMacApp$1$2.invokeSuspend(StartupUtil.kt:366) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
看错误提示 大概是没有jna,需要去 https://github.com/java-native-access/jna 构建一个loongarch版本,但是jna一般是用作调用so库的省略jni的一个简化方案。看到出错堆栈里面还有pty的调用,可能还要构建本地pty的库等等
https://github.com/java-native-access/jna/tree/master/lib/native
我看了眼 貌似已经有了预编译的loongarch的jna库
https://github.com/java-native-access/jna/blob/master/lib/native/linux-loongarch64.jar
这个仓库里貌似可以编译pty。
https://github.com/cheungxi/jetbrains-loongarch
但我用这里面的脚本试了一下好像还是调用不出terminal, 可能是jna的问题?不知道这里的jna是不是新世界的。
测了上面的项目 是旧世界的。我看上面有源码,可能可以编译成新世纪
直接把已经编译好的jna替换就可以了
https://blog.csdn.net/fantaiced/article/details/136025885?csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22136025885%22%2C%22source%22%3A%22fantaiced%22%7D
本站文章除其作者特殊声明外,一律采用CC BY-NC-SA 4.0许可协议进行授权。进行转载或二次创作时务必以相同协议进行共享,严禁用于商业用途。