Gradle couldn't execute npm command - java

I'm trying to run a npm command inside of gradle task but I'm getting a strange error:
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'npm'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:65)
... 2 more
Caused by: java.io.IOException: Cannot run program "npm" (in directory "/Users/psilva/Documents/projects/registrolivre"): error=2, No such file or directory
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 4 more
Caused by: java.io.IOException: error=2, No such file or directory
And this is my task:
task npmInstall(type: Exec) {
commandLine "npm", "install"
}
Could someone help?

If you are on Windows try this:
task npmInstall(type: Exec) {
commandLine "npm.cmd", "install"
}
instead of this:
task npmInstall(type: Exec) {
commandLine "npm", "install"
}

This answer worked for me with a different npm-related task. The recommendation there is to use an executable and args rather than commandLine.
executable 'npm'
args ['install']
Depending on your directory structure, you may also need to add the workingDir property and set it to the directory where your package.json lives.
As an alternative, the Gradle Node Plugin is also really handy for managing the most common Node tasks in a Gradle build. I use this plugin as the basis for my Node tasks and then create other custom tasks as needed.

If you are using Windows OS, you have to use 'npm.cmd' instead of 'npm'. Better to detect whether OS is windows or not and build your npm command. Please see the code snippet below,
import org.apache.tools.ant.taskdefs.condition.Os
task npmInstall(type: Exec) {
String npm = 'npm';
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
npm = 'npm.cmd'
}
workingDir 'src/main/webapp'
commandLine npm, 'install'
}

On MX Linux I installed node in linux with nvm and none of the other answers worked for me.
The problem is
NVM patches environment variables on terminal startup only. If the IDE is launched from Terminal, it inherits Terminal environment...
Indeed it works starting IJ from bash terminal with ./idea.sh
In my case, nvm added the pathced env variables at the end of my ~./bashrc. The following steps worked for me;
Move the lines below from ~/.bashrc to ~./profile
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
$ sudo ln -s "$(which node)" /usr/local/bin/node
In IJ configure npm
Logout and login (session restart for step 1)
UPDATE:
In order to run nvm from bash. The following lines must be added to .bashrc
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

I used #ALDRIN P VINCENT answer to solve this issue. But if you need to pass command line arguments to npm script, you can do this:
Let's say following system properties are passed to gradle script
gradle test-Dsome1=dev -Dsome2=https://www.google.com
In your test script in build.gradle, you will do this:
task apifunctionaltest(type: Exec) {
String npm = 'npm';
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
npm = 'npm.cmd'
}
commandLine npm, 'run', 'test', '--', '--some1='+System.getProperty("some1"), '--some2='+System.getProperty("some2")
}
The main command starts with commandLine npm… This line equates to:
npm run test -- --some1=dev --some2=https://www.google.com
The test script in package.json also should have ‘npm install’ (it depends) command so node modules are installed before tests run. And if modules are already installed, node will not waste time and reinstall them. test script should be something like this:
"scripts": {
"test": "npm install && webpack"
}
And then you can pick those command line args thru process.argv[2] and process.argv[3].
If you have a simple script like mine, then some1 and some2 will be in the 2nd and 3rd position of an array, respectively.

Related

ASN1 Compile issue with Bash file in Android

I am trying to generate java files from asn1 file using the below in my android project and facing error in generating the files in Mac OS and in window it worked fine.
org.openmuc:jasn1:1.9.0
org.openmuc:jasn1-compiler:1.9.0
Below is the bash file
#!/bin/bash
JARS_LOCATION="../build/libs-all"
MAIN_CLASS="org.openmuc.jasn1.compiler.Compiler"
SYSPROPS=""
PARAMS=""
SCRIPT_HOME=`dirname $0`
CLASSPATH=$(JARS=("$SCRIPT_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}")
for i in $#; do
if [[ $i == -D* ]]; then
SYSPROPS="$SYSPROPS $i";
else
PARAMS="$PARAMS $i";
fi
done
java $SYSPROPS -cp $CLASSPATH $MAIN_CLASS $PARAMS
and the above bash file will be called from my projects build.gradle file.
Below is the final command will be executed from the bash. Shortened the file paths for easy understanding.
java -cp "/libs/antlr-2.7.7.jar:/libs/jasn1-1.9.0.jar:/libs/jasn1-compiler-1.9.0.jar" org.openmuc.jasn1.compiler.Compiler -p com.test.package.asn1 -f /asn1def/asn1/RSPDefinition.asn /asn1def/asn1/PKIX1Explicit88.asn /asn1def/asn1/PKIX1Implicit88.asn -o /asn1def/build/generated/source/java
Below is the error I am getting
Generated code will be saved in /asn1def/build/generated/source/java
Parsing "/asn1def/asn1/RSPDefinition.asn"
Parsing "/asn1def/asn1/PKIX1Explicit88.asn"
Parsing "/asn1def/asn1/PKIX1Implicit88.asn"
Generating classes for module "PKIX1Implicit88"
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
at org.openmuc.jasn1.compiler.HexConverter.toShortHexString(HexConverter.java:63)
at org.openmuc.jasn1.compiler.HexConverter.toShortHexString(HexConverter.java:59)
at org.openmuc.jasn1.compiler.HexConverter.appendShortHexString(HexConverter.java:99)
at org.openmuc.jasn1.compiler.HexConverter.appendHexString(HexConverter.java:108)
at org.openmuc.jasn1.compiler.HexConverter.toHexString(HexConverter.java:9)
at org.openmuc.jasn1.compiler.BerClassWriter.writeEncodeTag(BerClassWriter.java:2169)
at org.openmuc.jasn1.compiler.BerClassWriter.writeSequenceOrSetEncodeFunction(BerClassWriter.java:1107)
at org.openmuc.jasn1.compiler.BerClassWriter.writeSequenceOrSetClass(BerClassWriter.java:731)
at org.openmuc.jasn1.compiler.BerClassWriter.writeConstructedTypeClass(BerClassWriter.java:493)
at org.openmuc.jasn1.compiler.BerClassWriter.translateModule(BerClassWriter.java:194)
at org.openmuc.jasn1.compiler.BerClassWriter.translate(BerClassWriter.java:133)
at org.openmuc.jasn1.compiler.Compiler.main(Compiler.java:89)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 12 more
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':asn1def:compileAsn'.
> Process 'command '/asn1def/run-scripts/jasn1-compiler'' finished with non-zero exit value 1
I have the main class in the jasn1-compiler-1.9.0.jar file in the libs folder. The same generate files in windows but in Mac it is not working. The difference in windows & Mac is Java version. Mac has Java 11 & windows has Java 1.8. I also tried adding the JDK 1.8 location as below at the end of above code.
-Dorg.gradle.java.home=/Users/Shared/Jenkins/.jenkins/tools/hudson.model.JDK/JDK_1_8
Can anyone help me to point out what's missing?
Finally I found the answer. The error was happened because of the Java version in Mac, it has Java 11 and it didn't support javax xml bind. So I installed the JDK 1.8 in the mac machine and use that path in the bash file as below before the java execution line in bash file.
export JAVA_HOME=/usr/java/jdk1.8.161/
It may useful for someone.

How to add shortcut to Windows app from jpackage+wix?

I got a script (just a simplified excerpt for brevity) to build and package my app, but it boils down to generating WiX installer with:
jpackage \
--type msi \
--dest "$(cygpath -w "${base[build:dist]}")" \
--name "${appDisplayName}" \
--app-version "${version}" \
--app-image "$(cygpath -w "${base[build:app]}")" \
--license-file "$(cygpath -w resources/app/legal/LICENSE)" \
--vendor "${vendor}" \
--verbose \
--temp 'W:\_tmp_' \
--win-shortcut;
It fails with enigmatic: Command [light.exe, (...)] in (...) exited with 94 code. Which I found is about unresolved reference and particularly a reference to a shortcut icon: ...\config\bundle.wxf(10) : error LGHT0094 : Unresolved reference to symbol 'Icon:icon1798580986' in section 'Fragment:'.
When I examined generated WiX XML, I found this:
<?xml version="1.0" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Fragment>
...
<DirectoryRef Id="DesktopFolder">
<Component Win64="yes" Id="cshortcut9906e12cdacb303ebb5e48c888cf6949" Guid="{9906e12c-dacb-303e-bb5e-48c888cf6949}">
...
<Shortcut Id="shortcut9906e12cdacb303ebb5e48c888cf6949" Name="..." WorkingDirectory="INSTALLDIR" Advertise="no" IconIndex="0" Target="[#filed2065cdc42e13
55f8bdbbefc93d540f3]" Icon="icon1798580986"></Shortcut>
</Component>
</DirectoryRef>
...
</Wix>
And indeed there's this "icon1798580986" value, which does not tell me anything and even WiX is lost here (after reading this this https://stackoverflow.com/a/21019152/2024692 I checked and confirmed that I actually do have WixUIExtension.dll in WiX bin folder).
When I remove --win-shortcut option, then MSI installer is generated, but unfortunately w/o shortcut icon on the desktop (the app has it's proper icons, thou, as I generated application image with --icon switch and with --resource-dir pointing to a.o. app icons).
As you probably guessed, this is called from Cygwin, so sometimes it needs fiddling with paths, especially when one calls Windows executables (hence these cygpath things).
Well, I wasn't able to find any constructive approaches how to simply allow my Java application packed with jpackage (from both JDK-14/15 EA with no success) to have nice shortcut icon after it gets installed. Does anyone knows how to fix this? Thanks in advance.
its easier to do with a gradle plugin
You need to set the proper icon file path and have a valid .ico file. This is how I did it:
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = 'PDF Decorator'
jvmArgs = ['-Djdk.gtk.version=2'] // required due to a bug in Java: https://github.com/javafxports/openjdk-jfx/issues/175
}
jpackage {
installerOptions = [
'--description', project.description,
'--copyright', 'Copyrigth 2015-2019 WALCZAK.IT'
]
installerType = project.findProperty('installerType') // we will pass this from the command line (example: -PinstallerType=msi)
if (installerType == 'msi') {
imageOptions += ['--icon', 'src/main/resources/pdfdecorator/gui/icon.ico']
installerOptions += [
'--win-per-user-install', '--win-dir-chooser',
'--win-menu', '--win-shortcut'
]
}
if (installerType == 'pkg') {
imageOptions += ['--icon', 'src/main/resources/pdfdecorator/gui/icon.icns']
}
if (installerType in ['deb', 'rpm']) {
imageOptions += ['--icon', 'src/main/resources/pdfdecorator/gui/icon_256x256.png']
installerOptions += [
'--linux-menu-group', 'Office',
'--linux-shortcut'
]
}
if (installerType == 'deb') {
installerOptions += [
'--linux-deb-maintainer', 'office#walczak.it'
]
}
if (installerType == 'rpm') {
installerOptions += [
'--linux-rpm-license-type', 'GPLv3'
]
}
}
}
Here's an article how to build an app image using OpenJDK 11 and using OpenJDK 14 with jpackage only for building the installer / package: https://walczak.it/blog/distributing-javafx-desktop-applications-without-requiring-jvm-using-jlink-and-jpackage
You just had the pleasure given by convention over configuration
When using jpackage --app-image and --win-shorcut parameters then jpackage expect to find the executable and the icon at the root of app-image directory to create the shortcut. The executable and the icon must have the same name as the one provided using the --name parameter.
In your case jpackage expects:
$(cygpath -w "${base[build:app]}")\${appDisplayName}.exe
$(cygpath -w "${base[build:app]}")\${appDisplayName}.ico
to exists to be able to create the shortcut.
If error 94 happens without --win-shortcut
This might actually be a problem relating to the --app-image parameter given to jpackage! An indicator for that is the warning that the app-image wasn't created by jpackage.
If your destination parameter when creating the app-image looks like --dest target/app-image, then you have to use --app-image target/app-image/myapp when creating the installer. Using --app-image target/app-image results in this error. A minor oversight that can create a lot of head-scratching because of the cryptic message.
This seems to happen for the reason #Mumrah81 gave:
[...] jpackage expect to find the executable and the icon at the root of app-image directory to create the shortcut.

Command failed: gradlew.bat installDebug

While developing an app I came into following error. I tried downgrading the java version from 11 to 8, but that wasn't helpful.
FAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy().
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 15s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
Command failed: gradlew.bat installDebug
Error: Command failed: gradlew.bat installDebug
at checkExecSyncError (child_process.js:616:11)
at Object.execFileSync (child_process.js:634:13)
at runOnAllDevices (C:\Users\samie\Documents\React Native\auth\node_modules\react-native\local-cli\runAndroid\runAndroid.js:299:19)
at buildAndRun (C:\Users\samie\Documents\React Native\auth\node_modules\react-native\local-cli\runAndroid\runAndroid.js:135:12)
at isPackagerRunning.then.result (C:\Users\samie\Documents\React Native\auth\node_modules\react-native\local-cli\runAndroid\runAndroid.js:65:12)
at process._tickCallback (internal/process/next_tick.js:68:7)
How I solved this problem:
First, make sure that I have %java_home% variable set and also %path% has the java sdk included.
How to setup Java environment variables
Second, Go to your android folder and run this command:
C:\Projects\myproject\android>gradlew.bat app:installDebug.
Unzipping
C:\Users\codeb.gradle\wrapper\dists\gradle-4.10.2-all\9fahxiiecdb76a5g3aw9oi8rv\gradle-4.10.2-all.zip
to
C:\Users\codeb.gradle\wrapper\dists\gradle-4.10.2-all\9fahxiiecdb76a5g3aw9oi8rv
Exception in thread "main" java.util.zip.ZipException: error in
opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:225)
at java.util.zip.ZipFile.(ZipFile.java:155)
at java.util.zip.ZipFile.(ZipFile.java:169)
at org.gradle.wrapper.Install.unzip(Install.java:215)
at org.gradle.wrapper.Install.access$600(Install.java:27)
at org.gradle.wrapper.Install$1.call(Install.java:75)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
As you can see that my gradle download is corrupt. All you have to do is delete this folder and rerun the command.
C:\Projects\myproject\android>gradlew.bat app:installDebug
Downloading
https://services.gradle.org/distributions/gradle-4.10.2-all.zip
...............................................................................................................
Unzipping
C:\Users\codeb.gradle\wrapper\dists\gradle-4.10.2-all\9fahxiiecdb76a5g3aw9oi8rv\gradle-4.10.2-all.zip
to
C:\Users\codeb.gradle\wrapper\dists\gradle-4.10.2-all\9fahxiiecdb76a5g3aw9oi8rv
Welcome to Gradle 4.10.2!
Here are the highlights of this release:
- Incremental Java compilation by default
- Periodic Gradle caches cleanup
- Gradle Kotlin DSL 1.0-RC6
- Nested included builds
- SNAPSHOT plugin versions in the plugins {} block
For more details see https://docs.gradle.org/4.10.2/release-notes.html
Now, you can go back to your react native project and run
react-native run-android
info JS server already running. info Building and installing the app
on the device (cd android && gradlew.bat app:installDebug)...
Task :app:installDebug 01:03:18 V/ddms: execute: running am get-config 01:03:18 V/ddms: execute 'am get-config' on 'emulator-5554'
: EOF hit. Read: -1 01:03:18 V/ddms: execute: returning Installing APK
'app-debug.apk' on 'Pixel_2_API_28(AVD) - 9' for app:debug 01:03:18
D/app-debug.apk: Uploading app-debug.apk onto device 'emulator-5554'
01:03:18 D/Device: Uploading file onto device 'emulator-5554' 01:03:18
D/ddms: Reading file permision of
C:\Projects\xx\android\app\build\outputs\apk\debug\app-debug.apk
as: rwx------ 01:03:18 V/ddms: execute: running pm install -r -t
"/data/local/tmp/app-debug.apk" 01:03:19 V/ddms: execute 'pm install
-r -t "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1 01:03:19 V/ddms: execute: returning 01:03:19 V/ddms: execute:
running rm "/data/local/tmp/app-debug.apk" 01:03:19 V/ddms: execute
'rm "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit.
Read: -1 01:03:19 V/ddms: execute: returning Installed on 1 device.
BUILD SUCCESSFUL in 9s 27 actionable tasks: 1 executed, 26 up-to-date
info Running
C:\Users\codeb\AppData\Local\Android\Sdk/platform-tools/adb -s
emulator-5554 reverse tcp:8081 tcp:8081 info Starting the app on
emulator-5554
(C:\Users\codeb\AppData\Local\Android\Sdk/platform-tools/adb -s
emulator-5554 shell am start -n
com.myproject/com.myproject.MainActivity)... Starting:
Intent { cmp=com.myproject/.MainActivity }
Try running this command inside your project file
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
after that
cd (path to project/android folder) && gradlew clean && cd .. && react-native run-android
always gradlew clean before run react-native-run-android
the above command basically cleans up the gradle and previous builds.
for ENOENT Error
Check if $ yarn start works. The metro bundler wasn't able to run on port 8081 for me and I needed to run $ killall node
EDIT:
Also update the gradle-wrapper.properties
add
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
remove following code from build.gradle:
task wrapper(type: Wrapper) {
gradleVersion = '5.2.1'
distributionUrl = distributionUrl.replace("bin", "all")
}
after that
cd (path to project/android folder) && gradlew clean && cd .. && react-native run-android
always gradlew clean before run react-native-run-android the above command basically cleans up the gradle and previous builds.
You're good to go!
Just run sudo react-native run-android and it will build and install ./gradlew app:installDebug inside android directory for you.
I had this issue too and I was able to fix it by creating a new project in react-native 0.57.3 using the command:
react-native init --version="0.57.3" MyNewApp
You have to update the gradle-wrapper.properties file to use the newest version of gradle:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
And remove this block from build.gradle file:
task wrapper(type: Wrapper) {
gradleVersion = '5.2.1'
distributionUrl = distributionUrl.replace("bin", "all")
}
Then run a gradlew clean on the android folder and everything should work.
I had this issue too and I was able to fix it by run ./gradlew app:installDebug in android folder .
In my case, I uninstalled my java jdk17 and installed java jdk11. It worked for me few seconds ago. Really happy :)))
I had this issue myself, it eventually went away after I uninstalled and re-installed android studio and gradle, but a few other things you could try first
1: Setting GRADLE_USER_HOME in environment variables (if on windows)
2: Downgrade to react-native 0.57.0
3: Make sure you have the correct permissions to run the command and access files
4: Make sure your gradle files are synced correctly, and that location of gradle and the android skd are correct within project structure offline mode
5: Check gradle for updates
(Assuming you are using android studio)
Good luck
The problem is on file:
nameyourapp/android/local.properties
you have to substitute with the correct path: /Users/nameUser/AppData/Local/Android/sdk
I have the same error I just uninstall the JDK old version and install the latest version from https://www.oracle.com/java/technologies/javase-downloads.html and now it's working.
Open your settings.grandler file in the android folder
Change the \ to /
Save the file
Run the command react-native run-android

JCEF ICU Check Failed

I seem to be continually coming against a wall in getting chromium running with JCEF in eclipse. I was able to get to the point where the native functions are discovered but am still unable to complete initialization. I set the LD_PRELOAD variable. I am running both the MainFrame.java class and custom Scala code and run into the same problem in each. Is there a way to resolve this?
System:
OS: Ubuntu 16.04
JCEF version 3
CEF version 3
Java Jdk 8
Structure and Configuration:
Everything is under the binary distribution structure. I imported the jars as a library, added the native library path to the jcef jar and imported it into my project.
I setup the run configuration with the environment variables:
Display = :0.0
LD_PRELOAD = /path/to/libcef.so
All of my libraries and *.pak files are in the same directory and a subdirectory where the libcef.so is located (the binary distribution) as are the chrome sandbox and helpers.
Code and Error
The code fails after the following:
println("Generating Handlers")
CefApp.addAppHandler(Handlers.getHandlerAdapter)
private var settings = new CefSettings
settings.windowless_rendering_enabled = useOSR
println("Starting App")
private final val cefApp : CefApp = if(commandLineArgs != null && commandLineArgs.size > 0) CefApp.getInstance(ChromeCommandLineParser.parse(commandLineArgs)) else CefApp.getInstance(settings)
println("Creating Client")
private final val client : CefClient = cefApp.createClient()
The following output results:
Starting
Generating Handlers
Starting App
Creating Client
initialize on Thread[AWT-EventQueue-0,6,main] with library path /home/XXXXX/jcef/src/binary_distrib/linux64/bin/lib/linux64
[0413/135633:ERROR:icu_util.cc(157)] Invalid file descriptor to ICU data received.
[0413/135633:FATAL:content_main_runner.cc(700)] Check failed: base::i18n::InitializeICU().
#0 0x7ff8fa94a62e base::debug::StackTrace::StackTrace()
#1 0x7ff8fa95f88b logging::LogMessage::~LogMessage()
#2 0x7ff8fd7588d4 content::ContentMainRunnerImpl::Initialize()
#3 0x7ff8fa857962 CefContext::Initialize()
#4 0x7ff8fa85775b CefInitialize()
#5 0x7ff8fa80a9b8 cef_initialize
#6 0x7ff8d6946914 CefInitialize()
#7 0x7ff8d690200f Java_org_cef_CefApp_N_1Initialize
#8 0x7ff8de207994 <unknown>
All help is appreciated. Thanks
I had a lot of problems with this too, until I created the symlinks to "icudtl.dat", "natives_blob.bin" and "snapshot_blob.bin" under the $jdk/bin directory, instead of $jdk/jre/bin.
Now I don't get this error any more.
Using the example in https://bitbucket.org/chromiumembedded/java-cef/wiki/BranchesAndBuilding
I changed this...
$ sudo ln -s /path/to/java-cef/src/third_party/cef/linux64/Resources/icudtl.dat /usr/lib/jvm/java-8-oracle/jre/bin/icudtl.dat
$ sudo ln -s /path/to/java-cef/src/third_party/cef/linux64/Debug/natives_blob.bin /usr/lib/jvm/java-8-oracle/jre/bin/natives_blob.bin
$ sudo ln -s /path/to/java-cef/src/third_party/cef/linux64/Debug/snapshot_blob.bin /usr/lib/jvm/java-8-oracle/jre/bin/snapshot_blob.bin
To this...
$ sudo ln -s /path/to/java-cef/src/third_party/cef/linux64/Resources/icudtl.dat /usr/lib/jvm/java-8-oracle/bin/icudtl.dat
$ sudo ln -s /path/to/java-cef/src/third_party/cef/linux64/Debug/natives_blob.bin /usr/lib/jvm/java-8-oracle/bin/natives_blob.bin
$ sudo ln -s /path/to/java-cef/src/third_party/cef/linux64/Debug/snapshot_blob.bin /usr/lib/jvm/java-8-oracle/bin/snapshot_blob.bin
The solution that #dvlcube gave works, but it's not comfortable. You can add some extra logic to detect user's environment and if it's a linux you can copy required files - example:
GitHub - PandomiumLoadWorker [:53]
Instead of copying you can also create symlinks:
Java SE Tutorial: Links
If you don't want to specify related to linux environment variables before launching, you can also inject those variables (like LD_LIBRARY_PATH and LD_PRELOAD) at runtime:
GitHub - LinuxEnv

class: Configuration not found on when simulating Hadoop YARN SLS

I am trying to simulate Hadoop YARN SLS (Scheduling Load Simulator) with the sources given in Hadoop's GitHub and the SLS source files are located in [REF-1].
Here the step I have done :
Using VMWARE as the Host.
Using Ubuntu 14.04
Installing Hadoop v 2.6.0 [REF-2]
User : hduser | group : hadoop
Installing any needed packages (e.g. maven)
Get the clonning file of Hadoop's GitHub [REF-1]
Syntax : git clone https://git.apache.org/hadoop.git
Result : hduser#ubuntu:~/hadoop$
I made the changes inside directory hduser#ubuntu:~/hadoop/hadoop-tools$
FYI : I used the codes from MaxinetSLS [REF-3] as the way I compile the source files. The SLS source files can be downloaded by using this syntax in Linux : git clone https://github.com/wette/netSLS.git. By default, I can run this program with no error. The SLS Simulator can work perfectly.
From MaxiNetSLS's source files, I copied this files below into my work in hduser#ubuntu:~/hadoop/hadoop-tools$ :
netSLS/generator > hduser#ubuntu:~/hadoop/hadoop-tools$
netSLS/html > hduser#ubuntu:~/hadoop/hadoop-tools$
netSLS/sls.sh > hduser#ubuntu:~/hadoop/hadoop-tools$
netSLS/sls/hadoop/ > hduser#ubuntu:~/hadoop/hadoop-tools/hadoop-sls$
Then, I modified some files as follows.
netSLS/sls.sh
#!/usr/bin/env bash
function print_usage {
echo -e "usage: sls.sh TraceFile"
echo -e
echo -e "Starts SLS with the given trace file."
}
if [[ -z $1 ]]; then
print_usage
exit 1
fi
TRACE_FILE=$(realpath $1)
if [[ ! -f ${TRACE_FILE} ]]; then
echo "File not found: ${TRACE_FILE}"
print_usage
exit 1
fi
cd hadoop-sls
OUTPUT_DIRECTORY="/tmp/sls"
mkdir -p ${OUTPUT_DIRECTORY}
ARGS="-inputsls ${TRACE_FILE}"
ARGS+=" -output ${OUTPUT_DIRECTORY}"
ARGS+=" -printsimulation"
mvn exec:java -Dexec.args="${ARGS}"
hduser#ubuntu:~/hadoop/hadoop-tools/hadoop-sls/pom.xml$
[REF-4]
hduser#ubuntu:~/hadoop/hadoop-tools$ nano hadoop-sls/hadoop/etc/hadoop/sls-runner.xml
[REF-5]
Next step, I try to :
Compile the script using hduser#ubuntu:~/hadoop/hadoop-tools/hadoop-sls$ mvn compile
Compiled with no error (mvn_compile_perfect.jpg).
Run the program using hduser#ubuntu:~/hadoop/hadoop-tools$ ./sls.sh generator/small.json
Got the error here (error_json_compile.jpg). :(
Until now, I have went through some information related with similar problems I faced [REF-6] and tried it, but I still get the same problem. I guess I think the problem is in the ~/hadoop/hadoop-tools/hadoop-sls/pom.xml I mistakenly modified. I have lack of knowledge with Linux Environment. :(
References : http://1drv.ms/21zcJIH (txt file)
*Cannot post more than 2 links in my post. :(

Categories

Resources