sdkman appears to be installed but not showing up on my drive - groovy

I have started learning groovy and I just came across the SDKMAN utility.
To give it a try I folllowed the installation guidelines at the official site of sdkman and tried to run the below command to install sdkman on Windows 10 :
set SDKMAN_DIR="E:/sdkman" && curl -s "https://get.sdkman.io" | bash
But I donot see any sdkman folder present in my E drive.
When I try to re-run the command it says :
Looking for a previous installation of SDKMAN...
SDKMAN found.
======================================================================================================
You already have SDKMAN installed.
SDKMAN was found at:
"E:/sdkman"
I am just confused as to why am I not able to see it with my eyes. I have even tried enabling view hidden items.
Tried to execute which sdk. but it clearly says which: no sdk in (..
...
has anyone else experienced similar issue. Any help is highly appreciated.

which bash implementation are you using under windows? cygwin? gitbash?
I believe at least in gitbash that the path syntax is /e/sdkman/, i.e. you would do:
export SDKMAN_DIR="/e/sdkman" && curl -s "https://get.sdkman.io" | bash
but it's been a long time since I was on windows and I suspect this is bash-implementation specific (i.e. it might differ between cygwin and gitbash for example).
If this assumption is correct, the syntax you were using might have created a directory called E:/sdkman under your user's home directory or whatever directory you happened to be in when you ran this. Just guessing here, but worth a look.

Related

Where is the `sdk` command installed for sdkman

I just installed sdkman for installing grails on my machine (MacOS). When I run which sdk command I don't get any output. But when I run the sdk help command the shell is able to resolve it and give the right output. I checked all the directories mentioned in $PATH environment variable but I could not find any executable sdk. So my question is how is shell able to resolve the sdk command?
Note: I also checked in Ubuntu and I see the same behavior.
As you mentioned correctly "sdk" is not a command, its a declared function created by sdkman-main.sh (in ~/.sdkman/src) once called from ~/.sdkman/bin/sdkman-init.sh
This is the reason why the installation page of sdkman asks for appending the following steps in the .bash_profile which declares this function each time the bash profile is loaded :
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
[[ -s "/home/dudette/.sdkman/bin/sdkman-init.sh" ]] && source "/home/dudette/.sdkman/bin/sdkman-init.sh"
This is also the reason "which" command doesn't pick it up as it checks for the installed commands on the linux PATH
OK. So I found it out. As #that-other-guy mentioned in the comment above, I used type -a instead of which, which showed me that it was a function defined.

How to change default directory for a command in Bash?

Firstly, I am new to Linux so excuse me if any terminology is wrong; I'll try to phrase the problem as competently as possible.
I have installed Ruby (2.4.0) via Linuxbrew. The ruby command works fine; it installed correctly. However, when I try to use the gem command (which Ruby should have installed) I receive this error:
bash: /usr/bin/gem: No such file or directory
Now, because I installed this with Linuxbrew I know that this directory isn't correct. For example:
result of which gem : /home/me/.linuxbrew/bin/gem
result of which ruby : /home/me/.linuxbrew/bin/ruby
Therefore, it seems gem is installed but the gem command isn't linked to the correct path. I assume I need to direct the gem command to the path of which gem as opposed to /usr/bin/gem that bash is saying doesn't exist. How would I go about changing this? I tried in vain to change the bash_profile but I'm not sure what to do.
Again, excuse me if ruby and gem are not referred to as commands and if the problem isn't the "default directory" as stated in the title. I wasn't sure how to label it.
EDIT/TL;DR:
Basically, how can I make gem execute this: /home/me/.linuxbrew/bin/gem instead of looking for the program in /usr/bin/gem?
Instead of running gem, run /home/me/.linuxbrew/bin/gem, i.e. type the full path name (followed by any arguments you may need).
If this becomes too tiresome, you could change your PATH. Prepend your bin directory with
PATH=$HOME/.linuxbrew/bin:$PATH
First, the reason you get the error /usr/bin/gem not found, is that earlier in the same shell session, the file used to be there. Bash will cache this to speed things up when running the same command many times. Running hash -r will clear this.
Editing PATH you seem to have managed, hence the which command gives the result it does.
To answer my own question-
As I had previously installed and uninstalled Ruby via apt-get instead of Linuxbrew in the same Terminal window, Bash was looking for gem in usr/bin as opposed to the path specified in my bash_profile to Linuxbrew.
Therefore, Stian's answer above with hash -r would also work, I am sure.

Using sudo atom no longer opens Atom at all, let alone as root

I'm using the Atom editor. Yesterday, if I typed:
sudo atom . it opened the current directory as root
sudo atom it opened Atom with whatever I last had open as root
Today if I run either of those commands nothing happens. The editor doesn't open and there are no error messages.
These terminal commands worked yesterday on these exact same files, today they do not.
How can I fix this?
Why is this happening?
If I have not provided enough information it's because I don't know what info one would need to have a fuller explanation of my circumstance. Let me know what I should add I'll happily edit this question to provide it.
Atom : 1.13.0
Electron: 1.3.13
Chrome : 52.0.2743.82
Node : 6.5.0
Ubuntu 14.04 LTS
Elementary OS Freya (64-bit)
After updating Atom text editor it seems I require to run --no-sandbox flag but after a while it becomes boring so I wrote a simple BASH script to be doing this for me:
eval "atom --no-sandbox flag"
just save this in a common directory that you frequently use and type ./atom_text_editor.sh in the terminal to deploy(Depending on the name you choose for your script)
A recommendation, when working on linux avoid using sudo or su instrucctions, they are intended to execute privileged instructions like system configurations. It might be related to permissions, execute ls -al and verify that the owner/group of yor files is root, if not, then check if "others" have read permission, if not, then thats is the problem.
Be aware running atom with sudo is not recommended.
I've had this problem for a few days, I installed atom using snap (on ubuntu 18.04) a few weeks ago, back then it worked perfectly, but the last few days if i ran 'sudo atom' nothing would happen at all, reinstalled it using snap, still didn't work, removed settings, still didn't work.
I ended up installing atom using the apt packagage manager and now it works. I used this guide: https://codeforgeek.com/install-atom-editor-ubuntu-14-04/
Furthermore when running atom with sudo it should be ran with the --no-sandbox flag.
Conclusion: seems to be a problem with atom when installed using snap.

Setting up Cygwin + Android NDK + cocos2Dx to work with Eclipse

I'm following a tutorial from this website: Monetizing Game Apps by Todd Perkins
Access to all the files are not required for the questions I'm asking. I have done research on how to solve this on stack overflow and discussed it below
I have followed the tutorial and it has asked me to:
Install Cygwin
Download Cocos2dx-2.0.1(I know this is old, but I don't want to deal with deprecating problems until I'm more confident with the environment)
Run create-android-project.bat(works fine).
Open project I created- and move to proj.android and run build_native.sh in Cygwin.
Then I open up cygwin.bat, navigate to myproject/proj.android and run ./build_native.sh
Problem:
$ ./build_native.sh
Using prebuilt externals
./build_native.sh: line 74: /cygdrive/c/android-ndk-r9c-windows-x86_64/ndk-build: No such file or directory
So I looked into the files and double-checked my changes:
In create-android-project.bat I modified the following variables:
set _CYGBIN=c:\Cygwin64\bin
set _ANDROIDTOOLS=c:\Program Files (x86)\ADT\adt-bundle-windows-x86_64-20130219\sdk\tools
set _NDKROOT=c:\android-ndk-r9c-windows-x86_64
Check line 74 that cygwin complained about in myproject/proj.android/build_native.sh:
echo "Using prebuilt externals"
$NDK_ROOT/ndk-build -C $GAME_ANDROID_ROOT \
NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt
Double check what NDK_ROOT is pointing to in build_native.sh:
NDK_ROOT=/cygdrive/c/android-ndk-r9c-windows-x86_64
COCOS2DX_ROOT=/cygdrive/c/Users/DarkRaveDev/Documents/cocos2d-x-2.0.1
GAME_ROOT=$COCOS2DX_ROOT/chaara
GAME_ANDROID_ROOT=$GAME_ROOT/proj.android
RESOURCE_ROOT=$GAME_ROOT/Resources
My Research:
I surfed SO for quite some time and tried the following from SO:
EOL Conversion in Notepad++ so LF works for windows for the build_native.sh
An answer somewhere said I need to install the make package when installing cygwin.. I'm not getting this problem, so I'm not sure if this applies.
I have searched many ways to set path - NDK_ROOT
QUESTION:
What exactly am I doing wrong? Is it the variables are badly set or is cygwin not properly installed?
Thank you to everyone who commented! :)
This is what I ended up doing.
Reinstall Cygwin : When you get to the select packages to install page, make sure to find DEVEL and change the install action from default to install. I know its a lot of megs but it's easier than combing through it. If you do want to comb through it and get only what you need, I suggest using this website: Installing a c++ compiler for windows
Make your paths simple : Like user2359247 suggested.
Finally run the create_android.bat, open your android project. Keep the path location of your build_native.sh file in mind and open your cygwin terminal.
Navigate to the path in cygwin, and run the file with sh build_native.sh: At this point everything was quite smooth sailing.
NOTE:
Also I kept using my version of ndk which is r9 instead of r8 in the tutorial, it didn't give me any hiccups.
Thank you SO!

Node.js Cygwin not supported

I am trying to install node.js. I followed this tutorial and i am stuck in the middle.
When I write ./configure in my cygwin terminal it says "cygwin not supported". Please help me out
Thanks in advance.
Node in my experience runs fine in cygwin, what Node usually has EINVAL errors in seems to be MINTTY which is a terminal emulation 'skin' that is default to cygwin. I still am not sure why these EINVAL errors happen 100% but the following are the steps and tricks I use to get node working.
In my /cygwin/home/{username}/.bashrc I add node to path so cygwin can find it
export PATH=$PATH:"/cygdrive/c/Program Files/nodejs/"
If you run a 32 bit version of node:
export PATH=$PATH:"/cygdrive/c/Program Files (x86)/nodejs/"
Then to make npm run without windows to linux issues I launch cygwin in admin mode then run:
dos2unix '/cygdrive/c/Program Files/nodejs/npm'
At this point running files and most npm packages will run in MINTTY just fine, although every once and awhile you will run into EINVAL issues with certain npm packages as karma. Also you will not be able to run the interpreter directly in MINTTY, anytime I want to do these things I run:
cygstart /bin/bash
This will open a native cygwin bash.exe window, from here you run the interpreter or an any troubling package command that results in a EINVAL. It slightly sucks you have to do this but I rarely use this day to day, and I love MINTTY too much to not use it.
Also note that you can run any one line node code in MINTTY by just running something like:
node -e "console.log('hello node')"
As a simpler derivative of troy's answer for those just looking to install NPM packages:
Install Node.js with the Windows installer package.
Add it to the PATH with export PATH=$PATH:"/cygdrive/c/Program Files/nodejs/" (obviously replacing the path to Node.js's installation directory with where you installed it).
There's a current bug in the Windows version that can be fixed by running mkdir -p ~/AppData/Roaming/npm. This is a bug for all of Windows and not just Cygwin. At some point of the future, you won't have to do this anymore, but the command shouldn't have any negative side effects.
Test it. Eg, npm install pretty-diff -g.
In order to be able to run the newly installed software, you'll need to add the install locations to your PATH. You can find these with npm bin -g and npm bin (the -g flag is the "global" installation location).
Not really anything special that you have to do to get it to run in Cygwin (although I can't say if everything works).
Use Console2, it allows you to run create tabs of CLI shells. It seems running cygwin inside console2 allows me to use node REPL just fine. I have no idea why :P
Follow this guide to add cygwin to console2:
http://blog.msbbc.co.uk/2009/11/configuring-console-2-and-bash-with.html
With Bjørn's suggestion (using Console2) and Soyuka's alias (steps here), my node.js v0.10.13 and npm v1.3.2 are now working under Babun v1.02, a Cygwin distribution.
For windows, Just run bash.exe in cmd, so that you could have a bash work around with cmd console directly, which could support ALL NODE WORKING PERFECTLY.
C:\Users\郷>bash
郷#CHIGIX ~
$ node
>
I'm using this wrapper in /usr/local/bin/node (note no extension!)
#!/bin/sh
_cmd="$(cygpath -lw -- "$1" )"
shift
"/proc/cygdrive/C/Program Files/nodejs/node.exe" "$_cmd" "$#"
This is far from perfect, as Node do not understand Cygwin directory tree, but works relatively well with relative names.
From Windows, run Cygwin.bat (instead of Cygwin Terminal) then in that run node: see and reply on this answer on this effectively-same question asked 1.5 years later.
Grab and run the node.js Windows installer.
In the Cygwin prompt type node
See if it works.

Resources