Eclipse still thinks I have RVM installed, but I don't - ruby

I'm using Eclim to get auto-completion for Java, Ruby, etc in Vim. It starts an instance of Eclipse. Eclipse still thinks I have RVM installed for some reason (I use rbenv now). Any idea how I should get rid of this configuration problem or work-around this error?
2014-06-22 22:43:10,123 INFO [org.eclim.plugin.jdt.PluginResources] Setting 'JRE_SRC' to '/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/src.zip'
org.eclipse.core.runtime.CoreException: Exception occurred executing command line.
at org.eclipse.debug.core.DebugPlugin.exec(DebugPlugin.java:875)
at org.eclipse.dltk.internal.launching.execution.LocalExecEnvironment.exec(LocalExecEnvironment.java:72)
at org.eclipse.dltk.launching.ScriptLaunchUtil.runScriptWithInterpreter(ScriptLaunchUtil.java:85)
at org.eclipse.dltk.ruby.internal.launching.RubyGenericInstall$BuiltinsHelper.generateLines(RubyGenericInstall.java:70)
at org.eclipse.dltk.ruby.internal.launching.RubyGenericInstall$BuiltinsHelper.load(RubyGenericInstall.java:171)
at org.eclipse.dltk.ruby.internal.launching.RubyGenericInstall$BuiltinsHelper.getSources(RubyGenericInstall.java:144)
at org.eclipse.dltk.ruby.internal.launching.RubyGenericInstall.getBuiltinModules(RubyGenericInstall.java:246)
at org.eclipse.dltk.internal.core.BuiltinProjectFragment.isSupported(BuiltinProjectFragment.java:97)
at org.eclipse.dltk.internal.core.ScriptProject.computeProjectFragments(ScriptProject.java:673)
at org.eclipse.dltk.internal.core.ScriptProject.computeProjectFragments(ScriptProject.java:605)
at org.eclipse.dltk.internal.core.ScriptProject.computeProjectFragments(ScriptProject.java:565)
at org.eclipse.dltk.internal.core.ScriptProject.getAllProjectFragments(ScriptProject.java:2921)
at org.eclipse.dltk.internal.core.ScriptProject.getAllProjectFragments(ScriptProject.java:2915)
at org.eclipse.dltk.core.search.indexing.core.ProjectRequest.run(ProjectRequest.java:67)
at org.eclipse.dltk.core.search.indexing.AbstractJob.execute(AbstractJob.java:76)
at org.eclipse.dltk.internal.core.search.processing.JobManager.run(JobManager.java:467)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Cannot run program "/Users/ivan/.rvm/rubies/ruby-2.0.0-p195/bin/ruby" (in directory "/var/folders/nh/07hs5mmj0hs7fdq3181dwpbc0000gn/T/dltk60850.tmp/scripts"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1042)
at java.lang.Runtime.exec(Runtime.java:620)
at org.eclipse.debug.core.DebugPlugin.exec(DebugPlugin.java:871)
... 16 more
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:185)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1023)
... 18 more

Eclim uses .buildpath for projects to set configurations. Check to make sure there aren't any remnant rvm / ruby configuration files left in any of your current active/existing projects in Eclipse.

Eclim uses .buildpath files to set the configuration for each project. There was an old project on my hard drive that had a reference to an rvm ruby in the text of the .buildpath file. It can be really hard to track down all old projects without the use of a file find utility such as locate. For this particular issue, I used locate buildpath | xargs grep rvm to search each buildpath file for the string rvm. Because the stack trace does not point to the project or build path file, only by doing this kind of search was I able to resolve the issue.

Related

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniavutil in java.library.path:

I am getting the following error while adding and testing javaCV to project in intellij in ubuntu 22.04. I hava read the documentation(https://github.com/bytedeco/javacv) but didn't understand what to do extactly. What I have done for adding javaCV to project is,
File -> Project Structure -> Module -> dependencies (+ add dependencies)
then selected javacpp.jar, javacv.jar, opencv.jar and ffmpeg.jar from the 'javacv-platform-1.5.7-bin' folder which I downloaded.
This is the output which I get after running a code:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniavutil in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2434)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:848)
at java.base/java.lang.System.loadLibrary(System.java:2015)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1800)
at org.bytedeco.javacpp.Loader.load(Loader.java:1402)
at org.bytedeco.javacpp.Loader.load(Loader.java:1214)
at org.bytedeco.javacpp.Loader.load(Loader.java:1190)
at org.bytedeco.ffmpeg.global.avutil.<clinit>(avutil.java:14)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:488)
at java.base/java.lang.Class.forName(Class.java:467)
at org.bytedeco.javacpp.Loader.load(Loader.java:1269)
at org.bytedeco.javacpp.Loader.load(Loader.java:1214)
at org.bytedeco.javacpp.Loader.load(Loader.java:1190)
at org.bytedeco.ffmpeg.avformat.Read_packet_Pointer_BytePointer_int.<clinit>(Read_packet_Pointer_BytePointer_int.java:45)
at org.bytedeco.javacv.FFmpegFrameGrabber.<clinit>(FFmpegFrameGrabber.java:362)
at com.cooltrickshome.MovieToImage.convertMovietoJPG(MovieToImage.java:31)
at com.cooltrickshome.MovieToImage.main(MovieToImage.java:25)
Caused by: java.lang.UnsatisfiedLinkError: Could not find jniavutil in class, module, and library paths.
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1767)
... 14 more
Process finished with exit code 1
Can anyone tell the exact steps to follow to add javaCV to the project in intellij ?
I have a similar problem as it failed to find the the library. I ends up build my own ffmpeg, and copying the dylib files in jniLibs, and adding a line like System.loadLibrary("avutil.57") in the static scope.
another way could be setting up the library path:
-Djava.library.path=/Users/xxx/ffmpeg-java-samples/src/main/jniLibs
Since you are in Ubuntu, up to this point, it should be able to fix your issue. However, for the mac, the end result the exception message changes to
tried:'/Users/xxx/ffmpeg-java-samples/src/main/jniLibs/libavutil.57.dylib',
but hitting to another issue: (mach-o file, but is an incompatible
architecture (have (arm64), need (x86_64)))
I am still figuring out the ffmpeg for mac M1 chip part.
after making sure the following jar file, it seems running:
export CLZPATH=$CLZPATH:$JARROOT/org/bytedeco/javacpp/1.5.8/javacpp-1.5.8.jar
export CLZPATH=$CLZPATH:$JARROOT/org/bytedeco/javacpp-presets/ffmpeg/4.1-1.4.4/ffmpeg-4.1-1.4.4.jar
export CLZPATH=$CLZPATH:$JARROOT/org/bytedeco/javacpp-presets/ffmpeg/4.1-1.4.4/ffmpeg-4.1-1.4.4-macosx-x86_64.jar

Gradle Ant java 7 gives CreateProcess error=206, The filename or extension is too long

My project path: c:\dev_latest
Java-version: JDK7 update 21 (I cannot use any other version due to project limitation)
Build Tools: Ant, Gradle
IDE: IntelliJ 17.3,
OS: Windows 10.
tried but not worked for me links:
1) CreateProcess error=206, The filename or extension is too long when running main() method
2) Createprocess error=206; the filename or extension is too long
3) https://coderwall.com/p/795oma/eclipse-junit-createprocess-error-206-filename-or-extension-is-too-long
4) How to set a long Java classpath in Windows?
I am sick of getting this exception :
Caused by: java.io.IOException: Cannot run program "C:\Java\jdk1.7.0_21\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long
at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeAsForked(JUnitTask.java:1257)
A week before my code was running just fine. Now I am stuck.
None of the previous answers on the forum resolved my issue.
My colleagues are on same environment but they are not experiencing the same issue.
Thanks in advance.
Just change the launch configuration to avoid using the default shorten line.
see this image for more info.
This will worked for me.
This is very similar to CreateProcess error=206 The filename or extension is too long, and the issue is related (even though it is a different version of IntelliJ, and what you are doing is different).
The problem exists in the IntelliJ workspace, and so you must manually add dynamic.classpath in order for it to work as you expect -- this is in addition to "shorten classpath" setting in the run configuration.
I would not say this is a duplicate question, but it's 90% the same (as it's the same underlying fault causing the issue).

Building RXTX with --disable-locks

I need to build RXTX (http://rxtx.qbang.org/wiki/index.php/Main_Page) for a 64 bit platform with --disable-locks. ( the target platform is a Ubuntu Snappy platform so there is a problem with the permissions and lock files).
The .configure --disable-locks and make seemed to run ok.
I got a new .jar file and librxtxSerial.so as a result.
However when I installed them, I get the following error :
java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver
java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver
Is there something else I need to do?
Are there other object files I need to copy over.
Thanks in advance.
I solved the problem myself.
The problem was that the configure script was not expecting a java version higher than 1.5 as shown here in t he extract :
case $JAVA_VERSION in
1.2*|1.3*|1.4*|1.5*)
#fix_parameters $JPATH/jre/lib/javax.comm.properties
CLASSPATH=".:\$(TOP):\$(TOP)/src:"find $JPATH/ -name RXTXcomm.jar |head -n1
RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
JHOME=$JPATH/"jre/lib/ext"
So the paths were not being set up correctly for me.
I changed it to
case $JAVA_VERSION in
1.2*|1.3*|1.4*|1.5*|1.7*)
Then it worked ok.

SonarQube 5.1 PAM - no jpam in java.library.path

I'm unable to use PAM plugin on SonarQube 5.1 on Debian 8 (64bit).
I did setup according to https://github.com/SonarCommunity/sonar-pam and still getting following error during login:
Java::JavaLang::UnsatisfiedLinkError (no jpam in java.library.path):
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886)
java.lang.Runtime.loadLibrary0(Runtime.java:849)
java.lang.System.loadLibrary(System.java:1088)
net.sf.jpam.Pam.<clinit>(Pam.java:51)
org.sonar.plugins.pam.PamConfiguration.newInstance(PamConfiguration.java:61)
org.sonar.plugins.pam.PamConfiguration.getPAM(PamConfiguration.java:49)
org.sonar.plugins.pam.PamAuthenticator.authenticate(PamAuthenticator.java:45)
org.sonar.api.security.SecurityRealm$1.doAuthenticate(SecurityRealm.java:60)
Here's setup (sonar is located at /var/lib/sonarqube-5.1):
/var/lib/sonarqube-5.1/lib/JPam-1.1.jar
native libs (64bit and 32bit) have been put to /var/lib/sonarqube-5.1/bin/linux-x86-64/lib/libjpam.so and /var/lib/sonarqube-5.1/bin/linux-x86-32/lib/libjpam.so (just for sure in case sonar was run as 32bit)
All directories leading to native libraries and libraries themselves have +rx access
Any idea what can be causing problem?
I'd print the java.library.path variable. The only thing I can think of is that the jpam lib is in the wrong place or there is an issue with permissions. (Did you check the SonarQube user can actually read that file?)
UPDATE
Check java.library.path in Settings->System Info page
Move jpam lib to one of those paths

Leiningen repl EOF exception in project

Just installed Leiningen 2.1.2 (lein.bat) on Windows XP in D:\lein\, added this dir to path.
Then I started repl
D:\lein>lein repl
and it runs fine.
Also it runs in other dir and can execute commands well.
Then i made sample project 'helloworld':
D:\lein>lein new app helloworld
Lein made project dir with sample app.
Then I go to project dir with
D:\lein>cd helloworld
And now i run command inside project folder:
D:\lein\helloworld>lein repl
and get this error:
Exception in thread "main" clojure.lang.LispReader$ReaderException: java.lang.Ru
ntimeException: EOF while reading string
at clojure.lang.LispReader.read(LispReader.java:220)
at clojure.core$read.invoke(core.clj:3407)
at clojure.core$read.invoke(core.clj:3405)
at clojure.main$eval_opt$fn__6602.invoke(main.clj:306)
at clojure.main$eval_opt.invoke(main.clj:306)
at clojure.main$initialize.invoke(main.clj:327)
at clojure.main$script_opt.invoke(main.clj:353)
at clojure.main$main.doInvoke(main.clj:440)
at clojure.lang.RestFn.invoke(RestFn.java:3894)
at clojure.lang.Var.invoke(Var.java:527)
at clojure.lang.AFn.applyToHelper(AFn.java:410)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: EOF while reading string
at clojure.lang.Util.runtimeException(Util.java:219)
at clojure.lang.LispReader$StringReader.invoke(LispReader.java:461)
at clojure.lang.LispReader.readDelimitedList(LispReader.java:1148)
at clojure.lang.LispReader$ListReader.invoke(LispReader.java:982)
at clojure.lang.LispReader.readDelimitedList(LispReader.java:1148)
at clojure.lang.LispReader$ListReader.invoke(LispReader.java:982)
at clojure.lang.LispReader.readDelimitedList(LispReader.java:1148)
at clojure.lang.LispReader$ListReader.invoke(LispReader.java:982)
at clojure.lang.LispReader.readDelimitedList(LispReader.java:1148)
at clojure.lang.LispReader$ListReader.invoke(LispReader.java:982)
at clojure.lang.LispReader.readDelimitedList(LispReader.java:1148)
at clojure.lang.LispReader$ListReader.invoke(LispReader.java:982)
at clojure.lang.LispReader.read(LispReader.java:185)
... 12 more
Exception in thread "Thread-1" clojure.lang.ExceptionInfo: Subprocess failed {:e
xit-code 1}
at clojure.core$ex_info.invoke(core.clj:4327)
at leiningen.core.eval$fn__2654.invoke(eval.clj:213)
at clojure.lang.MultiFn.invoke(MultiFn.java:231)
at leiningen.core.eval$eval_in_project.invoke(eval.clj:283)
at leiningen.repl$start_server.invoke(repl.clj:117)
at leiningen.repl$server$fn__6110.invoke(repl.clj:173)
at clojure.lang.AFn.applyToHelper(AFn.java:159)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:617)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1788)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:621)
at clojure.core$bound_fn_STAR_$fn__4102.doInvoke(core.clj:1810)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Unknown Source)
REPL server launch timed out.
I feel I missed something or my system messed somehow. Anyone have ideas?
SOLVED
Installed JDK instead of JRE and it works ok.
ALSO
Problem can raise when 'java.exe' from jre-s comes first on the path, i have cleaned system by recursively looking 'where' java.exe is and removing its presence from path everywhere except jdk path.
It can be :
under windows\system32 folder /just delete it from there
under jdk-s path-s /just remove that path-s from $PATH variable
You have to change lein version in your script lein.bat from 2.1.3 to 2.1.0 LEIN_VERSION=2.1.0 then enter the command lein self-install in the command prompt
This worked for me:
remove directory %home%.lein with all contents/files under it
download win installer http://leiningen-win-installer.djpowell.net/
install leiningen
run repl like this:
[WINKEY + R]
CMD.EXE [ENTER]
C:>\ lein repl
Upgrading from jdk 1.6 to jdk 1.7 fixed that problem for me.

Resources