GVM Error Setting Default Groovy Version - groovy

I installed groovy with GVM:
gvm install groovy
But when I say yes to the set 2.4.6 as default version, I get this error:
rm: `/c/Users/<user_name>/.sdkman/candidates/groovy/current' is a directory
ln: `/c/Users/<user_name>/.sdkman/candidates/groovy/current': cannot overwrite direc
tory
Not sure why it's trying to rm the current folder but then create a symbolic link to it. Any ideas what I'm doing wrong?

current should be a symbolic link to the directory of your current version, not a directory itself
Looks like for some reason, it's currently a directory
Try moving current out of the way, and trying again
PS: gvm is now called sdkman and the command is sdk not gvm though gvm still currently works for historic compatibility

From the name it looks like you are on "MinGW" shell. sdkman cannot handle the softlinks in this environment.
Delete current directory and copy the version you want to use. This is not a groovy issue; affects all tools available under sdkman (such as lazybone, grails..)

Related

Overriding System Binaries With Home Directory Binaries

I'm trying to compile a piece of software in my home directory (OpenMPI). One of the build dependencies (autoconf) installed on my system is not the newer version asked for by the OpenMPI autogen script. I compiled and installed the newer version of autoconf in my home directory.
Is there anyway for the binary installed in my home directory to "override" the version installed on the system for my session?
I tried setting an alias which works via command line but not for the script used to generate the configure script.
Add the path to the binary you want to override to your $PATH environment variable.
Like PATH=/path/to/binary:$PATH ./compile
Your added path will then be looked up first when trying to find the compile command. It will only be valid for that execution and will not remain after command has returned. You can use export PATH=/path/to/binary/:$PATH and it will be saved for that session.
EDIT: As Eric.J states, you can use which compile which will output the path to the command, just to make sure it's the right one.
You can change the PATH environment variable so that your home directory appears before the system directory, e.g.
PATH=$HOME/bin:$PATH
You can then use the which command to ensure the correct binary is being picked up.

Run time installation directory of debian package contents

I have a debian package that I built that contains a tar ball of the files, a control file, and a postinst file. Its built using dpkg-deb and it installs properly using dpkg.
The modification I would like to make is to have the installation directory of the files be determined at runtime based on an environment variable that will be set when dpkg -i is run on the deb file. I echo out the environment variable in the postinst script and I can see that its set properly.
My questions:
1) Is it possible to dynamically determine the installation directory at runtime?
2) If its possible how would I go about this? I have read about the rules file and the mypackage.install files but I don't know if either of these would allow me to accomplish this.
I could hack it by copying the files to the target location in the posinst script but I would prefer to do it the right way if possible.
Thanks in advance!
So this is what I found out about this problem over the past couple of weeks.
With prepackaged binaries you can't build a debian package with a destination directory dynamicall determined at runtime. I believe that this might be possible if installing a package that is built from source where you can set the install directory using configure. But in this case since these are embedded Ubuntu machines they don't have make so I didn't pursue such an option. I did work out a non traditional method (hack) for installing that did work. Since debian packages simply contain a tar ball relative to / simply build your package relative to a directory under /tmp. In the postinst script you can then determine where to copy the files from the archive into a permanent location.
I expected that after rebooting and the automatic deletion of the subdirectory under /tmp that dpkg might not know that the file package existed. This wasn't a problem. When I ran 'dpkg -l myapp' it showed as still installed. Updating the package using dpkg/apt-get also worked without a hitch.
What I did find is that if you attempted to remove the package using 'dpkg -r myapp' that dpkg would try and remove /tmp which wasn't good. However /tmp isn't easily removed so it never succeeded. Plus in our situation we never remove packages but instead simply upgrade them.
I eventually had to abandon the universal package due to code differences in the sources resulting in having to recompile per platform but I would have left it this way and it did work.
I tried using --instdir to change the install directory of the package and it does relocate the files but dpkg fails since the dpkg file can't be found relative to the new instdir. Using --instdir is sort of like a chroot. I also tried --admindir and --root in various combinations to see if I could use the dpkg system relative to / but install relocate the files but they didn't work. I guess rpm has a relocate option that works but not Ubuntu.
You can also write a script that runs dpkg-deb with a different environment for 6 times, generating 6 different packages. When you make a modification, you simply have to run your script, and all 6 packages gets generated and you can install them on your machines avoiding postinst hacking!
Why not install to a standard location, and simply use a postinst script to create symbolic links to the desired location? This is much cleaner, and shouldn't break anything in dpk -I.

update Apache Ant on CentOS

I need to update Apache Ant on my server.
I downloaded the newest Ant, built it, and (I thought) installed it. But when when I check it says the old version is still installed.
How do I update/replace the previous version of Apache Ant on a CentOS 5.? server?
take care,
lee
As mentioned it's probably getting picked up in your path. Post the output from echo $PATH
To configure your CentOS after installing a new version of Apache Ant, proceed to the following steps:
Locate the directory where the new Ant is located
Set the ANT_HOME environment variable to this directory
Add $ANT_HOME/bin to your PATH
P.S. To modify environment variables, you may edit the /etc/environment file, and reboot, or modify your local .bashrc. Look at your current environment variables by analyzing the output of printenv, e.g., to see the current value of PATH and then add the Ant path to it, e.g.
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64/bin:/usr/local/ant/bin

Freeswitch mod_java installation problem

I am trying to install mod_java on ubuntu.
I have installed the latest java(1.6).
I have configured freeswitch with mod_java module enabled in module.conf.xml
then when i run the make file, it says:
freeswitch_java.h:5:17: error: jni.h: No such file or directory
I have searched through the java installtion folders, but did not find any include folder or jni.h.
Can anyone help, what is being the problem here.
Thanks for reading this question.
I had the same problem. The solution was to run configure with the option --with-java:
./configure --with-java=/usr/lib/jvm/java-1.6.0-openjdk/include/
I don't know if it makes any difference but I added mod_java after building freeswitch without it. It was disabled in my initial build in module.conf.xml but afterwards I ran the above command plus:
make mod_java-install
It worked for me on ubuntu with openjdk. Are you using the Sun JDK? Maybe in the version you have dont have the include folder which has the source files. Try installing the other JDK. Or try and see of ther are some other related packages in apt that will get you the include folder.
Type this linux command to locate your jni.h file on your filesystem.
locate jni.h
you should be able to get it somewhere
in /usr/lib/java directory or some other directory
depending upon your java home.
copy paste the jni.h in src/include folder of your freeswitch src.
It will throw you some more errors for different .h files
just copy all of them to your src/include folder.
in latest freeswitch, installing through Makefile, its not possible to configure as the Makefile downloads and installs. Its possible by modifying the Makefile.in file to add the include path
mod_java_la_CPPFLAGS
-I/usr/lib/jvm/default-java/include \

change svn used by svnant

I've installed a newer version of svn on my system in ~my/home/bin and put the path to it.
So now from command line a newer version of svn is used instead of the old one, located in /usr/bin/.
However svnant keeps using an older svn in /usr/bin.
How can I tell svnant to use a newer svn?
As seen there svnant does not always uses the executable : http://subclipse.tigris.org/svnClientAdapter.html
1st-JavaHL native (JNI) subversion library (http://svn.apache.org/repos/asf/subversion/trunk/subversion/bindings/javahl/)
2nd-JavaSVN (pure Java) subversion API implementation (http://tmate.org/svn/)
3rd-svn(.exe) command line client wrapper
For the first too you would have to upgrade the jar.
If it really uses the executable you should try putting your executable in the path first before the other svn exe or linking it to /usr/bin
ln -s /home/yourself/bin/svn /usr/bin/svn
You may want to do something like:
mv /usr/bin/svn /usr/bin/svn_old
ln -s ~/your/home/bin/svn /usr/bin/svn
So you have a copy of the old one if you need it, while linking the currently used binary to your new version.
Add your new svn path to java.library.path

Resources