Build OpenJDK 9 in CentOS5 - java

I was trying to build OpenJDK 9 in Centos 5. I used
sh ./configure --disable-warnings-as-errors
make all
I am getting the following error.
Building target 'all' in configuration 'linux-x86_64-normal-server-release'
/root/jdk9/build/linux-x86_64-normal-server-
release/support/native/java.base/libjava/io_util_md.o: In function
`handleSetLength':
/root/jdk9/jdk/src/java.base/unix/native/libjava/io_util_md.c:228:
undefined reference to `fallocate64'
collect2: ld returned 1 exit status
/usr/bin/objcopy: '/root/jdk9/build/linux-x86_64-normal-server-
release/support/modules_libs/java.base/libjava.so': No such file
gmake[3]: *** [/root/jdk9/build/linux-x86_64-normal-server-
release/support/modules_libs/java.base/libjava.so] Error 1
gmake[2]: *** [java.base-libs] Error 2
ERROR: Build failed for target 'all' in configuration 'linux-x86_64-normal-
server-release' (exit code 2)
=== Output from failing command(s) repeated here ===
* For target support_native_java.base_libjava_BUILD_LIBJAVA_link:
/root/jdk9/build/linux-x86_64-normal-server-
release/support/native/java.base/libjava/io_util_md.o: In function
`handleSetLength':
/root/jdk9/jdk/src/java.base/unix/native/libjava/io_util_md.c:228:
undefined reference to `fallocate64'
collect2: ld returned 1 exit status
* All command lines available in /root/jdk9/build/linux-x86_64-normal-
server-release/make-support/failure-logs.
=== End of repeated output ===
No indication of failed target found.
Hint: Try searching the build log for '] Error'.
Hint: See common/doc/building.html#troubleshooting for assistance.
make[1]: *** [main] Error 2
make: *** [all] Error 2
I also tried other make targets such as make images and make install. But still getting the same error. My GCC version is gcc (GCC) 4.4.7 which I manually installed because Centos 5 by default has an older version.

Building JDK requires at least GCC 5.0 (see Building the JDK: CC).
This seems to be a problem in the glibc version (see redhat-issue, util-linux). So, updating your glibc to the latest version might solve it.
If you don't want to update your system's glibc, here is another alternative:
By looking at the man page of fallocate, we find that the description mentions that posix_fallocate(3) is a portable, POSIX.1-specified version of it, in case the mode parameter has the default value (0). The same applies to fallocate64.
Since all the occurrences of the aforementioned error already use the default mode value, you can replace them with posix_fallocate64() (instead of commenting them out as you mentioned in another comment).
The denoted man page says that:
This default behavior [of fallocate with mode=0] closely resembles the
behavior of the posix_fallocate(3) library function, and is intended
as a method of optimally implementing that function.

Related

How to fix an error : 'Could not load library 'toscomm': no toscomm in java.library.path'?

I am getting familiar with Tiny OS enviroment, currently I am at lesson 4 "Mote-PC serial communication and SerialForwarder"
and I am stuck with the part where I have to listen to serial port for any incoming data. I am trying to implement a simple example where I need to use TestSerial script to listen for any incoming messages however when I run
java TestSerial -comm serial#/dev/ttyUSB0:iris
my output looks like that:
Error loading the TinyOS JNI libraries the conventional way!
Attempting to load library 'toscomm'
Could not load library 'toscomm': no toscomm in java.library.path
----------
java.lang.UnsatisfiedLinkError: no toscomm in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1865)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1119)
at net.tinyos.util.TOSLibraryLoader.load(TOSLibraryLoader.java:85)
at net.tinyos.comm.TOSCommJNI.<clinit>(TOSCommJNI.java:14)
at net.tinyos.comm.NativeSerial.getTOSCommMap(NativeSerial.java:207)
at net.tinyos.comm.TOSSerial.<init>(TOSSerial.java:277)
at net.tinyos.packet.SerialByteSource.openStreams(SerialByteSource.java:67)
at net.tinyos.packet.StreamByteSource.open(StreamByteSource.java:61)
at net.tinyos.packet.Packetizer.openSource(Packetizer.java:149)
at net.tinyos.packet.AbstractSource.open(AbstractSource.java:78)
at net.tinyos.packet.Packetizer.open(Packetizer.java:142)
at net.tinyos.packet.PhoenixSource.run(PhoenixSource.java:178)
----------
In order to load the library 'toscomm' Java tries to locate the file 'libtoscomm.so' in one of the following paths:
/usr/java/packages/lib/i386:/lib:/usr/lib
The operating system is 'Linux' (i386)
Trying to locate the file 'linux_x86_toscomm.lib' in the classpath
Temporary file created: '/tmp/toscomm3780740783398787473.lib'
Library copied successfully. Let's load it.
Library loaded successfully
serial#/dev/ttyUSB0:57600: resynchronising
Sending packet 0
Sending packet 1
instead of having
Sending packet 1
Received packet sequence number 4
Sending packet 2
Received packet sequence number 5
as it described in tutorial
I am concerned about the warnings I get when I run this script, particularly this one
Attempting to load library 'toscomm'
Could not load library 'toscomm': no toscomm in java.library.path
According to tutorial, this error can be resolved by running
sudo tos-install-jni,
however when I type this, I get the error that tos command not found.
I tried to go to tinyos-2.x/tools/tinyos/java. directory and typed sudo make
and sudo make install, nevertheless that did not work either giving me the following error:
make[1]: Entering directory '/home/wsn/tinyos-main/tools'
/bin/sh ./config.status --recheck
running CONFIG_SHELL=/bin/sh /bin/sh ./configure --no-create --no-recursion
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for ranlib... ranlib
checking for a Python3 interpreter with version >= 3.0... python3
checking for python3... /bin/python3
checking for python3 version...
checking for python3 platform... linux
checking for python3 script directory... ${prefix}/lib/python3.4/site-packages
checking for python3 extension module directory... /lib/python/site-packages
checking for a Python interpreter with version >= 2.5... python2
checking for python2... /bin/python2
checking for python2 version... 2.7
checking for python2 platform... linux2
checking for python2 script directory... ${prefix}/lib/python2.7/site-packages
checking for python2 extension module directory... (cached) /lib/python/site-packages
checking for perl... /bin/perl
checking for python2... /bin/python2
checking for python3... /bin/python3
checking for python2.7-config... /bin/python2.7-config
checking for dot... no
configure: I can't find dot. dot is required for documentation.
checking for nescc... /bin/nescc
checking for cygwin... no
checking for JDK location... configure: error: java not found
Makefile:377: recipe for target 'config.status' failed
make[1]: *** [config.status] Error 1
make[1]: Leaving directory '/home/wsn/tinyos-main/tools'
Makefile:374: recipe for target '../../config.status' failed
make: *** [../../config.status] Error 2
When I try to run the same command for BaseStation script, the program gives the same warning and just gets frozen at this point:
serial#/dev/ttyUSB0:57600: resynchronising
So I don't even see any packets sent or received!
I am not sure what is the problem here, please help.
I am using Virtual Machine with Fedora OS
I am trying to run the program on mib520 platform and I use iris motes
my java version
openjdk version "1.8.0_31"
OpenJDK Runtime Environment (build 1.8.0_31-b13)
OpenJDK Server VM (build 25.31-b07, mixed mode)
I do not think your issue is with toscomm, as long as the library ends up being loaded successfully you should not be getting any issues. I always used to get the same exception that you are seeing being thrown over there everytime I used the serial but never bothered to fix it as it didn't really hamper the operation of the serial port.
In the end, I got rid of the exception by copying libtoscomm from the {TOS_ROOT}/tools/tinyos/java/serial/ directory to one of the directories that TinyOS is looking for libraries in. In your case you would put a copy of the libtoscomm file in one of the directories /usr/java/packages/lib/i386 , /lib or /usr/lib.
You can try doing that and seeing if that resolves the exception issue for you.
What I suspect might be causing your issue is that you do not have TestSerialAppC loaded onto you mote and connected to the serial port. Have you made sure the mote is connected to the serial port?
I loaded ran the application on a mote and got the output below, so the issue is not with TestSerialAppC
serial#/dev/tty.usbserial-FTYRYAHT:115200: resynchronising
Sending packet 0
Received packet sequence number 3
Sending packet 1
Received packet sequence number 4
Sending packet 2

chef-run windows unexpected end-of-input, expecting keyword_end

I'm trying to install java jdk 8 onto an ubuntu 16.04 instance using chef-run. Although when it attempts to install I get Failed to converge target, when I open the logs I have the following:
[2018-06-21T20:24:34+01:00] ERROR: Remote chef-client error follows:
[2018-06-21T20:24:34+01:00] ERROR: SyntaxError: /var/chef-workstation/cache/cookbooks/windows/resources/share.rb:275: syntax error, unexpected end-of-input, expecting keyword_end
I have the following structure in my chef-repo:
cookbooks
-- jdk
-- attributes
-- default.rb
-- recipes
-- default.rb
metadata.rb
Within attributes/default.rb:
default['java']['install_flavor'] = 'openjdk'
default['java']['jdk'] = '8'
Within recipes/default.rb:
include_recipe 'java'
Within metadata.rb:
name 'name'
maintainer 'maintainer'
maintainer_email 'maintainer_email#email.com'
license 'MIT'
description 'Installs/Configures java'
long_description 'Installs/Configures java'
version '0.1.0'
chef_version '>= 12.14' if respond_to?(:chef_version)
depends 'java', '~> 2.1.0'
I can't see what the error is being caused by. Any help on this would be appreciated.
Edit:
If it helps the command i'm using with arguments is the following:
chef-run -i ~/.ssh/key jack#host jdk
This issue should be resolved in the latest stable version 0.1.139.
This is a bug in ChefDK 3.0 when using policy tarball exports. It will be fixed in ChefDK 3.1 next week. In the mean time, add this to your knife.rb config file:
require "mixlib/archive/lib_archive"
Mixlib::Archive::LibArchive.define_singleton_method(:new) { raise LoadError }
Just make sure you remove it when you upgrade to 3.1.

Gradle aapt error: syntax ")" not found on Android Studio 1.5.1 Linux

Unburden
First of all, I would like to unburden: Android Studio completely sucks and it is by far the worst big IDE I've used all my life long! I got stuck on errors just for opening that thing! And when I have hardly fixed one, seventeen new ones come rightly from the hell to my screen! I am (trying) to use that piece of [you know] for 4 days now, and till now I was not able to code one single line of code! What does an IDE is supposed to be useful for again?
-- Edit1: I just installed the full 1.4.1 version right now and first thing it showed me was: WizardException: Ignoring unknown package filter 'source-25' and others errors.
-- Edit2: I did a new FRESH Mint 18 install in a completely clean partition, installed only Java 7 (Oracle) and tried to run the AS-1.5.1 but... the same error on install and a subtle different log of error messages (please, see the log here) when gradleing.
The problem
Ok, the last problem (1.5.1) is that now I am trying to make gradle to build the "project" (it is just an empty activity created by the wizard, default code untouched) and I get this error:
~/AndroidStudioProjects/MyApplication $ gradle clean build --stacktrace
Incremental java compilation is an incubating feature.
:clean UP-TO-DATE
:app:clean
//...[other succesfull msgs here]...
:app:mergeDebugResourcesAAPT err(Facade for 16120822): /home/sidney/Android/Sdk/build-tools/25.0.0/aapt: 3: /home/sidney/Android/Sdk/build-tools/25.0.0/aapt: Syntax error: Unterminated quoted string
AAPT err(Facade for 22545775): /home/sidney/Android/Sdk/build-tools/25.0.0/aapt: 3: /home/sidney/Android/Sdk/build-tools/25.0.0/aapt: Syntax error: Unterminated quoted string
//...[other repeated errors here]...
Exception in thread "png-cruncher_8" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/sidney/Android/Sdk/build-tools/25.0.0/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 60 seconds
at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
at java.lang.Thread.run(Thread.java:745)
//...[other repeated errors here]...
--- UPDATE: Please, see this other log of the external terminal used to run AS ---
What I've tried to solve that:
Install aapt system-wide;
Switch from Java 8 to Java 7;
Change gradle to off-line;
Change JDK configs to switch from the AS one to the system one;
Set SLAVE_AAPT_TIMEOUT to 30 (I changed back as you can see in the log link)
Set ANDROID_EMULATOR_FORCE_32BIT to true;
Install via ubuntu-make and also via ppa;
And so many others things I could find over Internet.
Environment specs
Linux Mint 18 (32 bits)
AS 1.5.1 (now (trying to use) 2.1.0)
Java Oracle 8 (Already tried the 7)
Why don't I just switch to Eclipse with plug-in
I have a course in mind (in Udacity) and they use that "thing" and it is a prerequisite. I've sent 3 e-mails to them questioning about the possibility of use other IDEs but without answer after 4 days, unfortunately.
Thank you so much for any help!
That error looks like your build tools aren't properly installed/set up. The aapt distributed with the build tools is versioned/linked with the tools, so studio probably isn't going to grab the random system level one. Have you attempted to install them, or did the older Studio version fail to prompt you to do so?
Beyond that, I'm afraid that Studio 1.4 is very deprecated and was missing many, many fixes that are in the newer versions, so it's somewhat likely that you would run into random errors with that version :-( What errors were you encountering with 2.2.1? It would be easier for the Studio team to help address those versus anything you find in 1.4.
My solution? Buy a 64 bits laptop! No installation error, no gradle error, no java error, no error anymore.

Removing package with Chef

Can you please tell me, is this possible to remove Java JDK package with Chef, with windows_package, or I have to execute command to silent uninstall? Much better would be the first option.
I've tried this way:
windows_package node['name']['JDK1.6'] do
action :remove
end
and even added option installer_type :custom, still got this error:
FATAL: Mixlib::ShellOut::ShellCommandFailed: windows_package[Java(TM) SE Development Kit 6 Update 35] (line 4) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0, 42, 127], but received '1603'
---- Begin output of MsiExec.exe /I{32A3A4F4-B792-11D6-A78A-00B0D0160350} /qn ----
STDOUT:
STDERR:
---- End output of MsiExec.exe /I{32A3A4F4-B792-11D6-A78A-00B0D0160350} /qn ----
Ran MsiExec.exe /I{32A3A4F4-B792-11D6-A78A-00B0D0160350} /qn returned 1603
Well, I am out of ideas. On official Opscode site I've found this information:
:remove: remove a package. The remove action is completely hit or miss as many application uninstallers do not support a full silent/quiet mode.
But as far as I know, JDK supports silent uninstall.
So - how should I do this in order to properly uninstall packages? Is this even possible?
Many thanks for every help.
Specification:
Chef 12.4.1
Windows 7
Java JDK in versions: 6u35, 7u79, 8u45
If you need additional information, feel free to ask.
Well, I've ended up with my own implementation. For those, who would need this, too:
# variable 'code' is for JDK version code from registry.
# Uninstall comand: MsiExec.exe /quiet /X[CODE]
# Codes are in regkey HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. Be aware to check key for JDK, not JRE!
remove_command = "MsiExec.exe /quiet /X#{code}"
execute "Remove JDK from system" do
command remove_command
returns [0,1605] # 1605 for non-existing product error
end
For example, for JDK 1.6.35 (mentioned in question) code should be
code = '{32A3A4F4-B792-11D6-A78A-00B0D0160350}'
So it seems like this is different command than used by Chef:
used by Chef
MsiExec.exe /I{32A3A4F4-B792-11D6-A78A-00B0D0160350} /qn
this command
MsiExec.exe /quiet /X{32A3A4F4-B792-11D6-A78A-00B0D0160350}
Maybe somebody will find this useful.
This looks like it might not be a chef problem as such. The uninstaller is hitting an error for some reason. Try googling for "java install error 1603" and you'll see a bunch of posts, including one that's apparently a bug that's currently under investigation https://www.java.com/en/download/help/error_1603.xml - though it sounds like that might be install not uninstall.
Try removing it manually and debug that, then once you understand it you can chef it.
I did something similar to your answer, but it only requires the package name rather than the code from the registry.
execute 'uninstall_jdk8u72' do
command "wmic product where name=\"#{node[:java8u72][:package_name]}\" call uninstall"
end
I got the idea from https://github.com/chef-cookbooks/windows/issues/89

Error in ls(envir = envir, all.names = private) : invalid 'envir' argument in R

I met with this error when I used a package in R for loading data, in this package, pakcage rJava was used.
Every time I run a function, the error is
Error in ls(envir = envir, all.names = private) :
invalid 'envir' argument
This package has been proved without any problem, just some environment problem in my computer.
when I debugged, I found that in the last process before
ls(envir=envir,all.names = private )
the variable envir is NULL,which should be some value but not NULL I think.
After some trials, I kind of solved the problem, by installing rJava every time. And in addition, only when the error comes out, then I install 'rJava', it will work. If I install at the first, it won't work. So, I guess, installing 'rJava'(or probably installing packages), will cause some environment variables to change.
Either Java 7 and Java 8, including jdk or jre are tested, doesn't work. And for R, I am using the 3.1.3 R and all the packages are up to date.
Following is some information that I think may be useful for the troubleshooting.
By installing the package, jvm.dll needs to be added to the windows environment path: "Path" and I did that.
My sessionInfo is shown below:
R version 3.1.3 (2015-03-09)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Danish_Denmark.1252 LC_CTYPE=Danish_Denmark.1252 LC_MONETARY=Danish_Denmark.1252 LC_NUMERIC=C
[5] LC_TIME=Danish_Denmark.1252
attached base packages:
[1] grid stats graphics grDevices utils datasets methods base
other attached packages:
[1] rgdal_0.9-1 fields_8.2-1 spam_1.0-1 raster_2.3-33 sp_1.0-17 ecomsUDG.Raccess_2.2-6
[7] downscaleR_0.5-2 maps_2.3-9 downscaleR.java_0.0-2 rJava_0.9-6 gWidgetsRGtk2_0.0-83 cairoDevice_2.22
[13] RGtk2_2.20.31 gWidgets_0.0-54 R.utils_2.0.0 R.oo_1.19.0 R.methodsS3_1.7.0
loaded via a namespace (and not attached):
[1] abind_1.4-3 bitops_1.0-6 boot_1.3-15 CircStats_0.2-4 colorspace_1.2-6 dtw_1.17-1 lattice_0.20-30 MASS_7.3-39
[9] munsell_0.4.2 plyr_1.8.1 proxy_0.4-14 Rcpp_0.11.5 RCurl_1.95-4.5 scales_0.2.4 tools_3.1.3 verification_1.41
Thank you for any help you can provide.
Have u fully solved your issue? i had a similar issue just a few days ago, sorted it out and would like to share with the community. Actually those wrapper functions (in my case, Rbbg package) call rJava functions had a log file in your user folder under C drive, you could delete those log files as it will enable you to escape from the the error message.
In my case, I need to delete the blpjavaapi0.log.0 and org.findata.blpwrapper.0 files created by Rbbg package.

Categories

Resources