Using the JJS tool for Nashorn+ JVM, how do we set JVM arguments?
I tried this:
jjs -Xmx512m test.js
but got this:
"-Xmx512m" is not a recognized option. Use "-h" or "-help" to see a
list of all supported options.
Sepcifically I want to set the following
-XX:MaxDirectMemorySize=512m
-Xmx512m
For JJS use -J before jvm args:
-J-Xmx512m
-J-XX:MaxDirectMemorySize=512m
Related
I am using oh-my-zsh for my terminal. I have set IntelliJ to use /bin/zsh as the shell path. However no environment variable in my .zshrc file ever seems to get picked up. I'm defining environment variables like this (for instance):
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/mailcreds.json"
But if I run:
echo $GOOGLE_APPLICATION_CREDENTIALS
Nothing comes up.
Set environment variables in ~/.profile instead of ~/.bashrc or ~/.zshrc, see this issue for details.
For me, the issue was that I load tmux automatically using .zshrc.
I followed the solution here: https://youtrack.jetbrains.com/articles/IDEA-A-19/Shell-Environment-Loading
Wrapped just the export ZSH_TMUX_AUTOSTART=true like this:
if [ -z "$INTELLIJ_ENVIRONMENT_READER" ]; then
export ZSH_TMUX_AUTOSTART=true
fi
For Ubuntu, I edited my IDE desktop launcher to run zsh with login interactive:
Go to /usr/share/applications (where the desktop entry usually located).
Edit jetbrains-idea.desktop(might be named differently).
Change Exec field to include /bin/zsh -l -i -c "/opt/intellij/bin/idea.sh".
The final result of the file:
[Desktop Entry]
Version=1.0
Type=Application
Name=IntelliJ IDEA Ultimate Edition
Icon=/opt/intellij/bin/idea.svg
Exec=/bin/zsh -l -i -c "/opt/intellij/bin/idea.sh" %f
Comment=Capable and Ergonomic IDE for JVM
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-idea
StartupNotify=true
Shared the same wrong behavior with Intellij in Manjaro (Arch), which uses zsh by default.
The issue comes with Flatpak, switching to Snap or downloading binaries directly from vendor's page got this solved.
Is similar to this issue (PyCharm): https://github.com/flathub/com.jetbrains.IntelliJ-IDEA-Ultimate/issues/23.
Crate Version : 2.1.5
OS : Windows
I have an error when starting whith crate.bat:
PS D:\Dev\Crate\crate-2.1.5\bin> .\crate.bat
starts CrateDB
Option Description
-C <KeyValuePair> Configure a setting
-V, --version Prints CrateDB version information and exits
-d, --daemonize Starts CrateDB in the background
-h, --help show help
-p, --pidfile <Path> Creates a pid file in the specified path on start
-q, --quiet Turns off standard ouput/error streams logging in console
-s, --silent show minimal output
-v, --verbose show verbose output
**ERROR: E is not a recognized option**
Java path is : "C:\Program Files\Java\jdk1.8.0_131\bin\java" -Xms256m
-Xmx1g -Xss256k -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -Djna.nosys=true -Dfile.encoding=UTF-8 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -cp "D:\Dev\Crate\crate-2.1.5/lib/;D:\Dev\Crate\crate-2.1.5/lib/enterprise/;D:\Dev\Crate\crate-2.1.5/lib/sigar/*"
"io.crate.bootstrap.CrateDB" -Epath.home="D:\Dev\Crate\crate-2.1.5" -V
Do you have the same problem?
An idea of where the error might come from?
Thanks
This will be fixed in the upcoming release of 2.1 - Thanks. https://github.com/crate/crate/issues/6129
Work around in the meantime:
In crate.bat, replace
set CRATE_PARAMS=-Epath.home="%CRATE_HOME%"
by
set CRATE_PARAMS=-Cpath.home="%CRATE_HOME%"
and remove:
) else if "!param:~0,2!" equ "-C" (
set param=!param:-C=-E!
source: https://github.com/crate/crate/pull/6142
Something happened with my Drone configuration. It's not finding the environment variables since today. Until few days ago, I could run a pipeline, but today I can't.
This is the step into the pipeline:
pipeline:
[...]
sdk:
image: mycompany/swagger-codegen:latest
environment:
- API_SWAGGER_JSON_URL=http://api.mycompany.biz:9000/v1/swagger.json
- API_PACKAGE=com.mycompany.api
- API_GROUP_ID=com.mycompany.api
- API_ARTIFACT_ID=sdk
- API_VERSION=0.1-SNAPSHOT
when:
branch: master
commands:
- java -jar /usr/lib/swagger/swagger-codegen-cli.jar generate
-i ${API_SWAGGER_JSON_URL}
--api-package ${API_PACKAGE}
--invoker-package ${API_PACKAGE}.client
--model-package ${API_PACKAGE}.client.model
--group-id ${API_GROUP_ID}
--artifact-id ${API_ARTIFACT_ID}
--artifact-version ${API_VERSION}
-l java
-o ./swagger-codegen-source
- etc.
And this is what I get
+ java -jar /usr/lib/swagger/swagger-codegen-cli.jar generate -i --api-package --invoker-package .client --model-package .client.model --group-id --artifact-id --artifact-version -l java -o ./swagger-codegen-source
Exception in thread "main" io.airlift.airline.ParseArgumentsUnexpectedException: Found unexpected parameters: [java]
at io.airlift.airline.Cli.validate(Cli.java:148)
at io.airlift.airline.Cli.parse(Cli.java:116)
at io.airlift.airline.Cli.parse(Cli.java:97)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:36)
Look at the command. Every environment variable was substituted by an empty string. Am I doing something wrong?
You should use $variable or $${variable} instead of ${variable}
This is because drone interpolates runtime variables [1] into the yaml using ${variable} syntax. This behavior is similar to docker-compose which drone uses as a baseline for functionality and syntax.
[1] http://docs.drone.io/environment/
[2] http://docs.drone.io/secrets-not-working/#variable-expansion
I wrote pig script as :
my_script.pig
bag_1 = LOAD '$INPUT' USING PigStorage('|') AS (LN_NR:chararray,ET_NR:chararray,ET_ST_DT:chararray,ED_DT:chararray,PI_ID:chararray);
bag_2 = LIMIT bag_1 $SIZE;
DUMP bag_2;
and made one param file as :
my_param.txt:
INPUT = hdfs://0.0.0.0:8020/user/training/example
SIZE = 10
now, I am calling the script by
pig my_param.txt my_script.pig
this command but getting error as:
ERROR 1000: Error during parsing. Lexical error
any suggestions for that
I think you need to provide the parameter file using -m or -param_file option. Refer the help documentation below.
$ pig --help
Apache Pig version 0.11.0-cdh4.7.1 (rexported)
compiled Nov 18 2014, 09:08:23
USAGE: Pig [options] [-] : Run interactively in grunt shell.
Pig [options] -e[xecute] cmd [cmd ...] : Run cmd(s).
Pig [options] [-f[ile]] file : Run cmds found in file.
options include:
-4, -log4jconf - Log4j configuration file, overrides log conf
-b, -brief - Brief logging (no timestamps)
-c, -check - Syntax check
-d, -debug - Debug level, INFO is default
-e, -execute - Commands to execute (within quotes)
-f, -file - Path to the script to execute
-g, -embedded - ScriptEngine classname or keyword for the ScriptEngine
-h, -help - Display this message. You can specify topic to get help for that topic.
properties is the only topic currently supported: -h properties.
-i, -version - Display version information
-l, -logfile - Path to client side log file; default is current working directory.
-m, -param_file - Path to the parameter file
-p, -param - Key value pair of the form param=val
-r, -dryrun - Produces script with substituted parameters. Script is not executed.
-t, -optimizer_off - Turn optimizations off. The following values are supported:
SplitFilter - Split filter conditions
PushUpFilter - Filter as early as possible
MergeFilter - Merge filter conditions
PushDownForeachFlatten - Join or explode as late as possible
LimitOptimizer - Limit as early as possible
ColumnMapKeyPrune - Remove unused data
AddForEach - Add ForEach to remove unneeded columns
MergeForEach - Merge adjacent ForEach
GroupByConstParallelSetter - Force parallel 1 for "group all" statement
All - Disable all optimizations
All optimizations listed here are enabled by default. Optimization values are case insensitive.
-v, -verbose - Print all error messages to screen
-w, -warning - Turn warning logging on; also turns warning aggregation off
-x, -exectype - Set execution mode: local|mapreduce, default is mapreduce.
-F, -stop_on_failure - Aborts execution on the first failed job; default is off
-M, -no_multiquery - Turn multiquery optimization off; default is on
-P, -propertyFile - Path to property file
$
You are not using the command correctly.
To use a property file, use -param_file in the command:
pig -param_file <file> pig_script.pig
You can refer more details in the Parameter Substitution
When Pig is running in distributed (HDFS) mode, you can pass additional jars to it from command-line using the following syntax, so that you don't have to explicitly using the REGISTER call
pig -Dpig.additional.jars=jar1.jar:jar2.jar -f pigfile.pig
But when I do the same thing while running in local mode, it fails
pig -x local -Dpig.additional.jars=jar1.jar:jar2.jar -f pigfile.pig
Does anyone know how to register additional jars while running Pig in local mode?
Properties should be passed before any Pig-specific options:
pig -Dpig.additional.jars=jar1.jar:jar2.jar -x local -f pigfile.pig