SDKMAN 5.5.9+231 says package is not a valid candidate on MacOS - sdkman

I have no idea why this started happening, but my SDKMAN stopped working and only displays the following message for whatever package I want to list, install, or use.
$ sdk list java
Stop! java is not a valid candidate.
$ sdk install java
Stop! java is not a valid candidate.
$ sdk use java 8u131
Stop! java is not a valid candidate.
Just typing sdk list works, though. But I can't do anything. My .bash_profile contains the following:
export JAVA_HOME=$(/usr/libexec/java_home)
export SDKMAN_DIR="/Users/myusername/.sdkman"
[[ -s "/Users/myusername/.sdkman/bin/sdkman-init.sh" ]] && source "/Users/myusername/.sdkman/bin/sdkman-init.sh"

Also double check if you put the target sdk in front of the version.
This won't work:
sdk install 9.0.4-openjdk
Stop! 9.0.4-openjdk is not a valid candidate.
Specifying it correctly works:
sdk install java 9.0.4-openjdk

The problem was on the server side. Something to do with SDKMAN's Candidates API. As pointed out in the GitHub issue, you can get over the problem using the following command:
sdk flush candidates
Make sure to restart your terminal after that.

Faced the same issue today. I was getting the same message after using sdk flush candidates and restarting the terminal.
So had to run sdk update and then restart the terminal. This added the candidates back.

My problem was that the following export
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh
was not at the bottom of ~/.bashrc file.
It happened because I installed the other tools which ended up at the bottom of ~/.bashrc.
When I moved it to the bottom and restarted the terminal sdk started to work.

Related

how to get typesafe-activator 1.3.6 on mac [duplicate]

I am trying to install the typesafe activator (scala, AKKA, play framework, activator)
I have Yosemite OSX
My bash is Oh my ZSH
I already have JDK 1.7, installed and exported
I downloaded and unzipped the file "typesafe-activator-1.2.10-minimal". Finally I put the export path on my ~/.zshrc
but when I type activator on the terminal it prints that cant find the file
thank you
get HomeBrew.
play documentation says this :
Play install on mac
But there have been some changes to that. Now you have to do this.
Try this:
brew install typesafe-activator
And then use activator command to start it
I made a big mistake, In the ~/.zshrc where I should put
export PATH=$PATH:/relativePath/to/activator
I added the executable file to the path. I post this answer in case is helpful for someone else.
For people like me, who are reading this in 2019 (or later) and are unable to find activator recipee in homebrew, be informed that activator has been decommissioned
Good news is, it's fairly simple to create new projects (including templates for play, akka etc.) with sbt new command and Giter8 templates.
Open terminal and follow the below steps,
mkdir ~/bin
ln -s <path to your play home>/activator ~/bin
echo "export PATH=~/bin:$PATH" >> ~/.bashrc
. ~/.bashrc
These days, in 2020, it seems Activator isn't available from Homebrew anymore?
But old Activator releases remain downloadable, from e.g. https://downloads.typesafe.com/typesafe-activator/1.3.6/typesafe-activator-1.3.6.zip. (I assume other version numbers work as well.)
export PATH=$PATH:/Users/XXX/XXX/activator-dist-1.3.12/bin

wasm-bindgen: command not found even though wasm-pack is installed (0.8.1)

From this article https://asquera.de/blog/2018-10-01/webassembly-and-wasm-bindgen/ I found we can run wasm-bindgen target/wasm32-unknown-unknown/release/qr_wasm.wasm --out-dir ./dist --no-modules --no-typescript to create wasm and js files without running wasm-pack build (it would install wasm-bindgen regardless if I have previously installed one, making it a bit slow) which seems more flexible to me but when I ran wasm-bindgen xxx it says: zsh: command not found: wasm-bindgen
I googled it but no one seems to have encountered this issue. I also have cargo install wasm-bindgen and wasm-bindgen-cli in my project.
Make sure $HOME/.cargo/bin is in your PATH.
If not:
export PATH="$PATH:$HOME/.cargo/bin"
or edit your .bashrc or some other way
I got here from google with the same problem.
My fix was cargo install wasm-bindgen-cli, per here: https://docs.rs/crate/wasm-bindgen/0.2.8
I installed wasm-bindgen using cargo install wasm-bindgen-cli command, however I wasn't able to execute it.
On Arch, I fixed it with yay -S wasm-bindgen-bin

Flutter Doctor - Unable to determine bundled Java version

I actually didn't want to install Android Studio to use flutter, so i just installed the Android SDK Command Line Tools.
The thing is, when i run flutter doctor i get the following warning.
And when i create a new project i get this one.
I am able to create and compile flutter projects without any issues, it is only the warning that worries me. Could it cause dependency trouble in the future for java related packages?
Execute these commands one by one and it resolved my issue in MAC .
cd /Applications/Android\ Studio.app/Contents/jre
ln -s ../jre jdk
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk
Please ensure Java is in your PATH and that JAVA_HOME is defined and pointing to the JDK. I've had Windows put the JRE in the path instead of the JDK, which leads to all kinds of issues.
Please take a look at your PATH environment variable and remove everything Java related that does not point to the JDK folder.
Oracle has some documentation on how to do this here : Installing Java and setting JAVA_HOME.
I hope I was able to help you.
Just to add, I had 2 versions of Android studio. And I removed one. So there might be a possibility that you have an older/another version of Android Studio present in your machine.

What is missing from my build environment when trying to compile emacs-25.1?

I'm trying to build emacs-25.1 from source on OSx. Everything goes fine until make install. When Emacs is trying to compile xml.c I get:
xml.c:23:10: fatal error: 'libxml/tree.h' file not found
#include <libxml/tree.h>
What is happening?
I'm not sure what your exact error is. However, there is an easier way to build emacs25 on OSX and macOS. Install homebrew is easy and once you have it, all you need to do is run
brew install emacs --with-cocoa --with-rsvg --with-ns
and then
brew linkapps emacs
and your done. Even if you want to do it by hand, you can get the recipe homebrew users to see how it does the build and install, which might help track down your error.
NOTE Check what the actual args are you can pass to the build environment. the ones I've listed are from memory and there are some others you may want to include.
A colleague was having the same problem and posted in the GNU emacs devel list right here. Daniel Suton provided the answer. Xcode is missing:
xcode-select --install
MacOS provides a libxml implementation (and headers) by default when you install xcode. Note that I had installed xcode already. But I've also upgraded from EL Captain to Sierra so my xcode installation must have been erased in the process.
Anyway, after installing xcode like described above and then after git clean -fxd I was able to rebuild emacs again.

memcache install for MAMP using wrong API version

I'm attempting to install memcache for MAMP. It seems to configure/make/install fine but I'm getting an error saying the API version is wrong:
[26-Oct-2012 17:40:51 UTC] PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0
I am using MAMP 2.1.1 on OS X Mountain Lion.
I'm using this memcache build:
http://pecl.php.net/package/memcache/2.2.7
I extracted the archive into this directory:
/Applications/MAMP/bin/php/php5.4.4/include/memcache-2.2.7
And then ran these commands from the extracted directory:
/Applications/MAMP/bin/php/php5.4.4/bin/phpize
./configure
make
sudo make install
No errors except what I noted above, which I am seeing in:
/Applications/MAMP/logs/php_error.log
Any ideas on how to fix this?
Ok so after a few hours of trying to figure this out, I was able to find the problem and fix it. I'm pretty much a huge noob when it comes to all of this stuff, but here is the best I can explain what I think I figured out:
So, when I ran first ran phpize on the module, it was configured for my system's default installation of php. I had to point php and phpize to my PATH in my .bash_profile
export PATH=/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php5.4.3/bin:/usr/local/bin:$PATH:/opt/local/bin
Make sure to change the php version to what ever version you are running.
After adding this to your path, running phpize -v should return:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
and running which phpize should return: /Applications/MAMP/bin/php/php5.4.3/bin/phpize
So then it was just a matter of deleting all of the files that were installed the first time, and running through the installation process again. I unzipped the downloaded file cd into the unzipped folder and ran:
/Applications/MAMP/bin/php/php5.4.3/bin/phpize
./configure
make
cp modules/memcache.so /Applications/MAMP/bin/php/php5.4.3/lib/php/extensions/no-debug-non-zts-20100525/
And boom done. It works!
This article helped me out a lot, even though it isn't related to memcache: http://drupal.org/node/1464236