How to pass arguments to javaFx deployed application - deployment

I have a Java application, I am using JavaFx deployment steps + ant to build this application. I have two kinds of this applications. One is user interface and other is command line version. If I provide arguments at command prompt then it run as command line application.
For eg -
C:\CmdApp.exe -name:myname -class:myClass
Trying this on exe created with JavaFx nothing is shown at command prompt. Is there other way to read command line arguments ?
Note : My application is created in Java not in JavaFX
I have provided argumnets in my build.xml in deployment steps as -
<fx:application name="${commandlineapp.title}" mainClass="${main.class} toolkit=swing">
<fx:argument>Arg1</fx:argument>
<fx:argument>Arg2</fx:argument>
<fx:argument>Arg3</fx:argument>
<fx:argument>Arg4</fx:argument>
<fx:argument>Arg5</fx:argument> </fx:application>
Please let me know how to pass command line argument to run my command line application using JavaFx deplyment?
Thanks

Related

Executing Karate scenarios calling external JAR from VScode

I use Karate as standalone JAR, and for writing scenarios I've installed Visual Source Code with the "karate-runner" plugin as IDE support.
I use an external jar for encryption treatments.
The trouble is that, when I execute a Karate scenario from Visual Source Code (for debuggig purpose), my external jar is not taken into account, and during execution, I get the message "java.lang.ClassNotFoundException: GenerateSign" in the console.
I've no problem when I launch the scenario directly in command line like :
Karate.bat mytest.feature
With the content of karate.bat is :
java -cp karate.jar;Sign.jar;. com.intuit.karate.Main %*
So, how to configure the tools in order to execute my karate scenarios from VScode taking into account my external jar too?
Thanks a lot.
I suspect the problem is you haven't updated the "karateCli" property in your launch.json debug configuration. Can you try to update it including your additional jar file and try again.
EDIT
Based on what command line does work in your batch file you should update your "Karate Runner" extensions settings as shown below in the images.
For running tests from Codelens with "Run Karate Test(s)"
For running tests with VSCode debugger
Maybe you simply are on the wrong version. Dir you try 0.9.5 ?
Here are the instructions: https://marketplace.visualstudio.com/items?itemName=kirkslota.karate-runner
For those coming across this in the future, you can use this as an additional reference: https://github.com/intuit/karate/wiki/Karate-Robot-Windows-Install-Guide

how to include run as configurations in exported eclipse product

I am exporting eclipse rcp application using "eclipse product export wizard". I want to redirect console logs into a file.
I am doing the below, which is working fine when I run as a eclipse application. It is not reflecting after export.
The Run configurations cover how to run something, i.e. they are the part external(ish)* to your application.
In particular, the Output File and Standard Input and Output settings are ways in the Eclipse development environment to handle redirects of the application.
A quick rundown would be to run the console application like this:
$ path/to/app -application com.example.yourname > file.log
If the shell you are using is Bash, there is a long bit in the manual with further options. Powershell and cmd on windows have similar options.
Of course, if you want your program to write to a file all the time (with a possible command line argument to specify file), you probably will want to code that yourself.
* The reason I put "ish" on external is that some of the settings, like Configuration and Plug-ins are part of what you export, but Arguments, Tracing and Environment are not.

Running a single test class from sbt , in a multi module project

I would like to run a single test class in a non interactive mode, in a multi module project.
I know how to do it when interactively first launching sbt, then selecting the project, and then using the "testOnly".
How to do it all via one command (or a script)
You can achieve that with the following syntax
sbt "project-name/testOnly classpath.of.Test"
So for example
running the Test biz.neumann.MySpec in the submodule logic you can use this command on the shell:
sbt "logic/testOnly biz.neumann.MySpec"
The " are important otherwise each withespace is interpreted as as an separator for additional arguments.

How to run Eclipse RCP application using command line

I am developing a small Eclipse RCP application and want to run it through command line arguments which takes three arguments as file paths.
It is not very clear what you are asking, if you mean accessing the command line arguments this is what to use:
In your IApplication you can get the command line arguments from the IApplicationContext argument using
(String [])appContext.getArguments().get(IApplicationContext.APPLICATION_ARGS);
elsewhere in the application you can use
Platform.getCommandLineArgs();

deploying a scala app built using IDEA

I developed a simple scala app that uses casbah to query the DB for the command line argument passed to it. For example
$ querydb.scala execution 10
it will run a casbah query to find 10 records matching execution in mongo. Now i have two questions.
1) How do i test this in my local. If i click execute in intellij it is just running the program, i am not able to pass command line arguments to my program.
2) How do i deploy it to run on my server, it is just going to used as console app in my ubuntu server, but im not sure how i should deploy this, which files i should put up on the server and how do i execute it in server, and stuff like that.
Any pointers would be useful for me.
or try to use sbt, IDEA has a plugin with sbt, the wiki of it has an explanation on how to use it.
I usually use sbt directly in Terminal instead of running in IDE.
1) First you need to find "Select Run/Debug Configuration" button at the top of your screen
Click on it and choose edit
Create new one, if you haven't got it yet.
Your program parameters should be written in "Program parameters" field
2) Compile your .scala files with scalac and you'll got .class files.
Then deploy it, as you usually do with java code. Hence you don't need to install scala on target machine - all you need is JDK.