"cp: cannot stat" error while installing Java 9 on OpenSuse 42.3 - opensuse

I am trying to install Java 9 on OpenSuse 42.3.
I have downloaded java 9 rpm file and trying to install on OpenSuse 42.3 but I get below error.
user#localhost:~> sudo rpm -ivh Downloads/jdk-9_linux-x64_bin.rpm
Preparing... ################################# [100%]
Updating / installing...
1:jdk-9-2000:9-ga ################################# [100%]
Unpacking JAR files...
plugin.jar...
javaws.jar...
deploy.jar...
cp: cannot stat '/usr/java/jdk-9/lib/desktop/icons/hicolor/16x16/apps/sun-java.png': No such file or directory
cp: cannot stat '/usr/java/jdk-9/lib/desktop/icons/hicolor/16x16/apps/sun-javaws.png': No such file or directory
cp: cannot stat '/usr/java/jdk-9/lib/desktop/icons/hicolor/48x48/apps/sun-java.png': No such file or directory
cp: cannot stat '/usr/java/jdk-9/lib/desktop/icons/hicolor/48x48/apps/sun-javaws.png': No such file or directory
cp: cannot stat '/usr/java/jdk-9/lib/desktop/icons/hicolor/48x48/apps/sun-java.png': No such file or directory
cp: cannot stat '/usr/java/jdk-9/lib/desktop/icons/hicolor/48x48/apps/sun-javaws.png': No such file or directory
update-alternatives: using /usr/java/jdk-9/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: error: alternative appletviewer can't be slave of javac: it is a slave of java
warning: %post(jdk-9-2000:9-ga.x86_64) scriptlet failed, exit status 2
How can I resolve this issue?

I installed Java 9.0.4 on Centos7 and got only 'can not stat' messages but the installation seems to be OK:
sudo rpm -ivh jdk-9.0.4_linux-x64_bin.rpm
Preparing... ################################# [100%]
Updating / installing...
1:jdk-9.0.4-2000:9.0.4-ga ################################# [100%]
Unpacking JAR files...
plugin.jar...
javaws.jar...
deploy.jar...
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/hicolor/16x16/apps/sun-java.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/hicolor/16x16/apps/sun-javaws.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/hicolor/48x48/apps/sun-java.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/hicolor/48x48/apps/sun-javaws.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/HighContrast/16x16/apps/sun-java.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/HighContrast/16x16/apps/sun-javaws.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/HighContrast/48x48/apps/sun-java.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/HighContrast/48x48/apps/sun-javaws.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/hicolor/48x48/apps/sun-java.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/hicolor/48x48/apps/sun-javaws.png’: No such file or directory
:
The directory tree after installation looks like:
:tree /usr/java/jdk-9.0.4/lib/desktop/icons
/usr/java/jdk-9.0.4/lib/desktop/icons
├── hicolor
│   ├── 16x16
│   │   ├── apps
│   │   │   └── sun-jcontrol.png
│   │   └── mimetypes
│   │   ├── gnome-mime-application-x-java-archive.png
│   │   ├── gnome-mime-application-x-java-jnlp-file.png
│   │   └── gnome-mime-text-x-java.png
│   └── 48x48
│   ├── apps
│   │   └── sun-jcontrol.png
│   └── mimetypes
│   ├── gnome-mime-application-x-java-archive.png
│   ├── gnome-mime-application-x-java-jnlp-file.png
│   └── gnome-mime-text-x-java.png
├── HighContrast
...

Related

Sample library build fails with meson

I'm following the instructions described in https://mesonbuild.com/IndepthTutorial.html to build a library
Having created the necessary directories and filled with appropriate files. I encounter difficulty when executing "$ meson compile".
The following is a console output of the progress.
[~/tmp/sample_lib_prj]
$ tree --dirsfirst
.
├── include
│   ├── foolib.hpp
│   └── meson.build
├── src
│   ├── meson.build
│   ├── source1.cpp
│   └── source2.cpp
├── test
│   ├── footest.cpp
│   └── meson.build
└── meson.build
[~/tmp/sample_lib_prj]
$ meson builddir && cd builddir
The Meson build system
Version: 0.53.2
Source dir: /home/user/tmp/sample_lib_prj
Build dir: /home/user/tmp/sample_lib_prj/builddir
Build type: native build
Project name: sample_lib_prj
Project version: 0.1
C++ compiler for the host machine: c++ (gcc 9.3.0 "c++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0")
C++ linker for the host machine: c++ ld.bfd 2.34
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Run-time dependency glib-2.0 found: YES 2.64.6
Build targets in project: 2
Found ninja-1.10.0 at /usr/bin/ninja
[~/tmp/sample_lib_prj/builddir]
$ tree --dirsfirst
.
├── include
├── meson-info
│   ├── intro-benchmarks.json
│   ├── intro-buildoptions.json
│   ├── intro-buildsystem_files.json
│   ├── intro-dependencies.json
│   ├── intro-installed.json
│   ├── intro-projectinfo.json
│   ├── intro-targets.json
│   ├── intro-tests.json
│   └── meson-info.json
├── meson-logs
│   └── meson-log.txt
├── meson-private
│   ├── build.dat
│   ├── cmd_line.txt
│   ├── coredata.dat
│   ├── foobar.pc
│   ├── install.dat
│   ├── meson_benchmark_setup.dat
│   ├── meson.lock
│   ├── meson_test_setup.dat
│   ├── sanitycheckcpp.cc
│   └── sanitycheckcpp.exe
├── src
├── test
├── build.ninja
└── compile_commands.json
6 directories, 22 files
[~/tmp/sample_lib_prj/builddir]
$ meson compile
ERROR: Neither directory contains a build file meson.build.
With the current version of meson (0.62.1) you can compile your project the way you first tried: going into the build directory and running meson $ cd builddir then $ meson compile.
Alternatively you can compile the project by remaining on the source root directory and run $ meson compile -C builddir. The -C flag is used to specify a directory to cd into before running a command.

Using cmake, how can I link a third_party library to my own program (to find the project, build it from source, and install, link)

How can I do it in a good practice. This is the repo structure:
~/workspace$ tree -L 3
.
├── my_program
│   ├── src
│   │   ├── module1
│   │   ├── module2
│   │   ├── CMakeLists.txt
│   │   └── ...
├── needed_library
│   ├── src
│ │ ├── module3
│ │ ├── module4
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│   │   └── ...
For needed_library, I learned from the README that I can build it manually by:
mkdir build
cd build
cmake ../src
make
make install
And needed library and headers will be installed.
How can I integrate this process into my own program's CMakelists.txt? And link the desired library and header to my program?

Heroku can't find out that python is necessary

I have a project with the structure similar to what is described in Two Scoops of Django.
Namely:
1. photoarchive_project is repository root (where .git lives).
2. The project itself is photoarchive.
3. Config files are separate for separate realities.
The traceback and other info is below.
The file runtime.txt is situated next to .git directory. That is in the very directory where git is initialized.
The problem is: it can't even determine that python should be applied. Could you give me a kick here?
.git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = ssh://git#bitbucket.org/Kifsif/photoarchive.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "heroku"]
url = https://git.heroku.com/powerful-plains-97572.git
fetch = +refs/heads/*:refs/remotes/heroku/*
traceback
(photoarchive) michael#ThinkPad:~/workspace/photoarchive_project$ git push
heroku master
Counting objects: 3909, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3617/3617), done.
Writing objects: 100% (3909/3909), 686.44 KiB | 0 bytes/s, done.
Total 3909 (delta 2260), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to powerful-plains-97572.
remote:
To https://git.heroku.com/powerful-plains-97572.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/powerful-plains-97572.git'
tree
(photoarchive) michael#ThinkPad:~/workspace/photoarchive_project$ tree
.
├── docs
├── media
├── photoarchive
│   ├── config
│   │   ├── settings
│   │   │   ├── base.py
│   │   │   ├── constants.py
│   │   │   ├── heroku.py
│   │   │   ├── __init__.py
│   │   │   ├── local.py
│   │   │   └── production.py
│   └── manage.py
├── .git
├── .gitignore
├── Procfile
└── runtime.txt
runtime.txt
python-3.6.1
I
You need to define a requirements.txt inside the root of your project folder. This file should contain a list of all your project dependencies.
You can generate this file on your local development machine by running:
$ pip freeze > requirements.txt
Then checking it into version control, and pushing it to Heroku.
Heroku looks for this file to determine that your app is, in fact, a Python application =)

Unable to create environment in AWS Elastic Beanstalk?

I Made a small Django app; I want to deploy it on AWS. I followed the commands here . Now when I do eb create it fails saying
ERROR: Your requirements.txt is invalid. Snapshot your logs for details.
ERROR: [Instance: i-05fde0dc] Command failed on instance. Return code: 1 Output: (TRUNCATED)...)
File "/usr/lib64/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
Detailed logs are here. My database in postgresql, for that do I have to run separate RDS instance ?
My config.yml
branch-defaults:
master:
environment: feedy2-dev
group_suffix: null
global:
application_name: feedy2
default_ec2_keyname: aws-eb
default_platform: Python 2.7
default_region: us-west-2
profile: eb-cli
sc: git
My 01-django-eb.config
option_settings:
"aws:elasticbeanstalk:application:environment":
DJANGO_SETTINGS_MODULE: "feedy2.settings"
PYTHONPATH: "/opt/python/current/app/feedy2:$PYTHONPATH"
"aws:elasticbeanstalk:container:python":
WSGIPath: "feedy2/feedy2/wsgi.py"
container_commands:
01_migrate:
command: "django-admin.py migrate"
leader_only: true
My directory structure :
.
├── feedy2
│   ├── businesses
│   │  
│   ├── customers
│   │ 
│   ├── db.sqlite3
│   ├── feedy2
│   │   ├── __init__.py
│   │   ├── __init__.pyc
│   │   ├── settings.py
│   │   ├── settings.pyc
│   │   ├── urls.py
│   │   ├── urls.pyc
│   │   ├── wsgi.py
│   │   └── wsgi.pyc
│   ├── manage.py
│   ├── questions
│   │  
│   ├── static
│   ├── surveys
│   └── templates
├── readme.md
└── requirements.txt
You truncated the relevant part of output but it's in the pastebin link:
Collecting psycopg2==2.6.1 (from -r /opt/python/ondeck/app/requirements.txt (line 20))
Using cached psycopg2-2.6.1.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
Error: pg_config executable not found.
You need to install the postgresql[version]-devel package. Put the following in .ebextensions/packages.config'.
packages:
yum:
postgresql94-devel: []
Source: Psycopg2 on Amazon Elastic Beanstalk

Changing CMake files standard location

I have a source directory with a folder called "phantom-dir/" where I put all generated files I don't need. I want to put all generated files by CMake inside this phantom directory (together with other generated and "ugly" files).
A mini example:
$ mkdir cmake-test
$ cd cmake-test
$ echo 'message("Hello World!")' > CMakeLists.txt
$ cmake . | grep "Hello"
Hello World!
$ tree
.
├── CMakeCache.txt
├── CMakeFiles
│   ├── CMakeCCompiler.cmake
│   ├── cmake.check_cache
│   ├── CMakeCXXCompiler.cmake
│   ├── CMakeDetermineCompilerABI_C.bin
│   ├── CMakeDetermineCompilerABI_CXX.bin
│   ├── CMakeDirectoryInformation.cmake
│   ├── CMakeOutput.log
│   ├── CMakeSystem.cmake
│   ├── CMakeTmp
│   ├── CompilerIdC
│   │   ├── a.out
│   │   └── CMakeCCompilerId.c
│   ├── CompilerIdCXX
│   │   ├── a.out
│   │   └── CMakeCXXCompilerId.cpp
│   ├── Makefile2
│   ├── Makefile.cmake
│   ├── progress.marks
│   └── TargetDirectories.txt
├── cmake_install.cmake
├── CMakeLists.txt
└── Makefile
4 directories, 20 files
By default, all CMake files (CMakeCache.txt, cmake_install.cmake, Makefile, CMakeFiles) are written in the working directory. But, I want something like that:
$ mkdir cmake-test
$ cd cmake-test
$ mkdir phantom-dir
$ echo 'message("Hello World!")' > CMakeLists.txt
$ // editing CMakeLists.txt to set some cmake variables.
$ cmake . | grep "Hello"
Hello World!
$ tree
.
├── phantom-dir
│ ├── CMakeCache.txt
│ ├── CMakeFiles
│ │   ├── CMakeCCompiler.cmake
│ │   ├── cmake.check_cache
│ │   ├── CMakeCXXCompiler.cmake
│ │   ├── CMakeDetermineCompilerABI_C.bin
│ │   ├── CMakeDetermineCompilerABI_CXX.bin
│ │   ├── CMakeDirectoryInformation.cmake
│ │   ├── CMakeOutput.log
│ │   ├── CMakeSystem.cmake
│ │   ├── CMakeTmp
│ │   ├── CompilerIdC
│ │   │   ├── a.out
│ │   │   └── CMakeCCompilerId.c
│ │   ├── CompilerIdCXX
│ │   │   ├── a.out
│ │   │   └── CMakeCXXCompilerId.cpp
│ │   ├── Makefile2
│ │   ├── Makefile.cmake
│ │   ├── progress.marks
│ │   └── TargetDirectories.txt
│ ├── cmake_install.cmake
├── CMakeLists.txt
└── Makefile
4 directories, 20 files
That means: the Makefile in the current directory (to make, "cmake . && make"), but the remaining generated files inside the "phantom" directory.
I know I can make it with:
$ cd phantom-dir/
$ cmake ../
But it's a little tiresome for me to do it each time I want to re-compiling or remake cmake, above all taking into account that I'm modifying many times my CMakeLists.txt.
Which variables I have to set in the CMakeLists.txt file in order to achieve it?
You could make use of the undocumented CMake options -H and -B to avoid leaving your source dir. -H specifies the path to the main CMakeLists.txt file, and -B specifies the path to your desired build directory.
cmake -H. -Bphantom-dir
Note that these are undocumented and so I suppose could change at any time the Kitware guys feel like.
To build your project without leaving your source dir, you can make use of the (official) option --build This is a cross-platform way to invoke your chosen build tool, and you can pass whatever flags you want to this tool. e.g.
cmake --build phantom-dir -- -j3