I've tried running this command in PowerShell as an admin:
choco install -y openjdk11
and it returns this error:
I use "winget" to download packages from Powershell. Firstly, you have to search for the package, which would look like this:
winget search openjdk
This will provide many options along with the ID which you will need to install the program.
To install, use
winget install {Program ID}
Related
I'm trying to setup JPostal + LibPostal on a Windows 10 PC.
JPostal documentation states that the following command must execute without errors:
pkg-config --cflags --libs libpostal
However, when I execute the above command I get the following error:
bash: pkg-config command not found
The documentation did not state to install any other software to execute the above command. Is there something missing? I'm on Windows 10.
Update:
I re-read the documentation on libpostal which states:
libpostal has support for pkg-config, so you can use the
pkg-config to print the flags needed to link your program against it..
It seems like once I install libpostal the above command should work. Why isn't it working?
Thanks
bash: pkg-config command not found
shows that you are using WSL (Windows Subsystem for Linux) or Cygwin. In either case, you will first have to install the pkg-config package using the command below. Afterward, the setup shall work.
sudo apt install pkg-config
We've been using VowPal Wabbit on Ubuntu 16. We want to move to Ubuntu 18 but there doesn't appear to be a VW build for Ubuntu 18. First - does one exists? Secondly, if not, can someone point me to the instructions to build and make a Ubuntu 18 compatible library? We use Java and JNI to talk to the library currently.
Thanks,
Ron
We haven't got proper binary releases at the moment, so you'll need to build from source. Docs are somewhat sparse on this, so I'll go over it here.
To build the Java JNI lib on Ubuntu you need the dependencies:
sudo apt install libboost-dev libboost-thread-dev libboost-program-options-dev libboost-system-dev libboost-math-dev libboost-test-dev zlib1g-dev cmake g++ default-jdk
From here: https://github.com/VowpalWabbit/vowpal_wabbit/wiki/Dependencies#ubuntu
Then you need to use CMake to generate the build files and run the build:
# The important bit here is that the submodules are downloaded.
git clone --recursive https://github.com/VowpalWabbit/vowpal_wabbit.git
cd vowpal_wabbit
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DWARNINGS=Off -DBUILD_JAVA=On -DBUILD_DOCS=Off -DBUILD_PYTHON=Off -DSTATIC_LINK_VW_JAVA=On -DBUILD_TESTS=Off
make vw_jni -j `nproc`
cd ..
mvn test -f java/pom.xml
-DBUILD_JAVA=On Java is optional so this is needed to have the target generated
-DSTATIC_LINK_VW_JAVA=On This will statically link some dependencies, optional
The vw_jni target also runs mvn check
-DBUILD_DOCS=Off -DBUILD_PYTHON=Off -DBUILD_TESTS=Off Saves time by not doing things you don't need
Java is built and tested as part of CI, an example script can be seen here.
An example of this which runs in CI is here:
https://github.com/VowpalWabbit/vowpal_wabbit/blob/master/.pipelines/build-linux-java.yml
https://github.com/VowpalWabbit/vowpal_wabbit/blob/master/.scripts/linux/build-static-java.sh
I launched a new AWS EC2 instance (Amazon Linux AMI). I can install Java 1.8.0 on the machine like so:
sudo yum install java-1.8.0
I can also install using this command:
sudo yum install java-1.8.0-openjdk
The same packages and dependencies are installed in both cases. When I perform the following, I receive "No matching Packages to list":
yum info java-1.8.0
When I perform the following, "java-1.8.0" does not appear in the list, only "java-1.8.0-openjdk":
yum search java-1.8.0
My related questions are:
Why does "sudo yum install java-1.8.0" work? Is it an alias on the yum repo?
If this is indeed an alias, how would I know it exists? Is there a way to search for or list out aliases?
If "yum install" doesn't find a package with a specified name, it will look for packages providing a feature with that name. From the install section in the yum man page:
If the name doesn’t match a package, then package "provides" are searched (e.g. "_sqlite-cache.so()(64bit)") as are filelists (Eg. "/usr/bin/yum").
"java-1.8.0" is listed as a feature in the java-1.8.0-openjdk RPM, which is why that was installed by "yum install java-1.8.0-openjdk". If there were other packages providing that feature in yum, you could just as easily have gotten one of those instead. I'm not sure how yum chooses between multiple packages providing the same feature, but it's not something I would rely upon if the specific flavor/version of an application is important to you at all.
If you install yum-utils, the repoquery command can show you information about package features (among many other things). For example, repoquery --provides java-1.8.0-openjdk would list all the features provided by that package. To search for all the packages providing the java-1.8.0 feature, you could either use repoquery --whatprovides java-1.8.0 or just yum provides java-1.8.0. Note that in yum, "whatprovides" is the same as"provides"; both search for packages providing the specified feature. If you want to the features in a specified package, you need to use repoquery. (The rpm command would also work, if you've already installed or downloaded the package you want to query.)
When I run MATLAB install script in Ubuntu, I get the following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class java.awt.Component
longer output is available here
I know that it's a Java problem and could potentially be fixed by changing the classpath or something like that but I don't exactly know how.
Any Ideas?
For me this error was fixed when I installed the JRE on my system:
apt-get install default-jre
on Ubuntu 12.04, instead of having MATLAB use its own.
I've been battling this problem for the whole evening as well but I stumbled onto a solution that works for me at least.
After trying to install using the silent installer I got a different error with a bit more information. It turned out that a library was missing (libXtst.so.6). I was able to install that on my Ubuntu system with:
apt-get install libxtst6
After that I tried running the GUI installer (over X forwarding) and it looks like it's going to work now.
For MATLAB R2012a Student Edition, in Ubuntu 14.04, I had to install these prerequisites first:
sudo apt-get install default-jre libxtst6:i386 libXext6:i386 libxi6:i386 libncurses5:i386 libxt6:i386 libxpm4:i386 libxmu6:i386 libxp6:i386
Next I installed/activated per MATLAB's instructions (sudo ./install). I answered "yes" when the installer asked to add a symbolic link in /usr/local/bin/
Finally, when launching MATLAB, I have to specify that it run in 32-bit mode:
matlab -glnx86
I assembled those steps from this answer: https://askubuntu.com/questions/363878/how-to-install-32-bit-matlab-in-ubuntu-64-bit
and the Ubuntu MATLAB guide:
https://help.ubuntu.com/community/MATLAB
Optional
I didn't want to type the -glnx86 option each time I launch MATLAB, so I replaced the matlab symbolic link in /usr/local/bin/ with a script that automatically specifies the -glnx86 option:
ls -l /usr/local/bin/matlab #note the destination of the symbolic link
sudo mv /usr/local/bin/matlab /usr/local/bin/matlab.bak
#ensure the first path below matches your symbolic link's destination
echo '/usr/local/MATLAB/R2012a_Student/bin/matlab -glnx86 "$#"' | sudo tee /usr/local/bin/matlab
sudo chmod +x /usr/local/bin/matlab
With that, I can type 'matlab' and it launches properly. (The "$#" in the script forwards all input arguments to matlab.) There's probably a more elegant way to accomplish this, but it worked.
I also encountered a "/lib/libc.so.6: not found" error on matlab startup, which I fixed by following this answer.
Installing gnome (sudo apt-get install gnome) fixed this problem for me. I'm sure this was total overkill, but the required libraries are now available.
I'm trying to run a .jar file on my centos box, but it says "java: command not found".
What's the best or easiest way to solve this? I was hoping for a yum command but not sure that that will exist for java?
Apparently some versions of CentOS doesn't come with a JVM installed due to some licensing restriction. See HowTo Install Java on CentOS 4 and CentOS 5 for instructions.
You can use such command to check if Java is available in your repository:
yum list | grep java
It should return something like that:
java-1.6.0-openjdk
java-1.6.0-sun
If such package exists you can install it using such command (run it as the root user):
yum install java-1.6.0-openjdk
Either the JRE is not installed or, more likely, its location is not included in your PATH environment variable. If the java executable is not in your PATH, you would need to use the full path & filename to execute it.
cd to the location of the jar file
C:\temp>java -jar sample.jar