How to run a Dart Console Application? - dart

I just follow https://www.dartlang.org/docs/dart-up-and-running/ch01.html to run a Dart console application,but the result is ‘HTML file could not be found’.

If you want to know how to start it from DartEditor, just right-click the file in the Files view and choose Run. If you click the Run button in the toolbar, probably the previously launched file is launched (didn't use DartEditor since 1/2 year)
If you want to launch it from command line just run dart bin/main.dart

Related

How to run an MSIX installed application from the command line

I have an application packaged and signed as an MSIX, it installs and runs from the start menu. I'd like to be able to run the application from the command line too, for automated testing, but I can't see a way to do it. From powershell the docs suggest Invoke-CommandInsideDesktopPackage, but that requires developer mode which I'd rather not enable on test machines, and also is not the same as just running the app. What I'd love is a simple command line command that starts the app in the same way that the start menu does it.
By design, the binaries from an installation folder of an MSIX folder are not directly accessible through their direct path.
The correct way to run an app from the command line from an MSIX package is with the use of an execution alias. The following article contains more details about how an execution alias works and how you can define it in your package, no matter the tool you use to build the MSIX package.
- App Execution Alias
Also, here is a related question on SO.

How to get LUA to work in VSCode so it runs to the output window?

I installed LUA by following this guide: http://lua-users.org/wiki/BuildingLuaInWindowsForNewbies
I put LUA in Program Files(x86)>lua>5.3.5
If i open up a terminal and type 'lua' it works.
If i create a file called hello.lua with print("Hello, World!") in it, how do i run this file so it comes up in the output window of VSCode?
If i try 'start without debugging' nothing happens'. If i Terminal>Run active file/selected text, the VS terminal window says
'print("hello, world!")
Unable to initialize device PRN'
I've obviously missed something simple but i just don't see a way to run this file to the output window, and an hour hunting through the docs and i'm none the wiser. My only other experience is with VS Community where it's just CTRL+Shift+B to complile and ALt+A to run.
Anyone help?
Thanks.
The Code Runner extension supports Lua, so you can press Ctrl-Alt-N to run the current script file. If it complains about not being able to find the executable, add this to your user settings:
"code-runner.executorMap": {
"lua": "C:\\Program Files (x86)\\lua\\5.3.5\\bin\\lua.exe"
}
Install the extension "Code Runner" in VS Code;
Click the gear icon and open the "Extension Settings";
Search for "Code-runner: Executor Map";
Go into setting.json to update the directory of the installed lua.exe.
"code-runner.executorMap": {
"lua": "\"C:\\Program Files\\Lua\\lua.exe\"",
}
Do not forget to add \" before and end of the directory.

javafx native package error invoking method

I'm developing a desktop application using javafx v8.0.60. I have created an exe package with ant in netbeans 8. When I run exe file in my computer, it is installed and run without any problem.
On the other hand, when I try to install and run it on some other computer, at the end of installation, window dialog pops up:
"Error invoking method"
I click Ok. Another window pop up saying:
"Failed to launch jvm"
Davood, greetings! I had this same problem and I, like you, found no help anywhere.
I submit to you a solution, which miraculously worked for me and helped me make sense of those blasted "Error invoking method." and "Failed to launch JVM" dialogs:
Find your .jar file
It has the same name as your Project and it's in your application's installation directory under AppData\Local\{ApplicationTitle}\app (shortcut: type %appdata% into explorer); if your project was named HelloWorld, there you will find HelloWorld.jar
Navigate to it's directory in command prompt
shift+Right Click any blank spot in the Explorer window and choose "Open command window here" (that's a fancy trick I recently learned; alternatively you would cd to the same directory using the command prompt)
Run your .jar via the command line
type java -jar "HelloWorld.jar" and hit Enter
Tadah! Behold your hidden exceptions (the existence of which "Error invoking method." so vaguely tries to communicate to you). *
If your problem is similar to mine it stems from a file structure difference between the project out folder and the installation directory, and that's why the program compiles just fine in the editor and builds just fine—there isn't a problem until it's built out, and the file structure is a little different.
*If you didn't get anything when you ran it via the command line, look for any errors that could be happening during that initialize() method; that's where your problem likely is. You can expose any exceptions during runtime by using a Popup Exception Dialog like shown in a similar problem, here.

Execute a Script When XCode Runs My App

I have an iOS application that relies on a web server to keep track of information like players and games. Is there some way I can have XCode restart the server every time I start the app in the simulator? I am using Django so starting the server involves one terminal command.
Go to you target settings and add a Build Phase.
You can set an arbitrary script that runs at every build.
Here's an example taken from one of my projects:
Simply click on the Add Build Phase icon on the bottom right and select Add Run Script.
As you can easily find out by yourself, you can specify the shell to run the script into, as well as other handy options.
In your specific case a simple oneliner
python manage.py runserver
would probably do the trick

Blackberry application loading on simulator

while loading my application on BlackBerry simulator its displaying given below an error
Unable to start simulator. Check that the file exists. (java.lang.IllegalArgumentException: Executable name has embedded quote, split the arguments)
I had same issue whilst trying to run the demo application.
I am running Windows 7 Professional,JDK 7u21 and STS 3.2.
This is an issue with the changes made to the decoding of command strings specified to Runtime.exec method.
In summary the path configured for the simulator launch contains spaces.In my case "C:\Program Files (x86)"
To Fix this issue
Copy the simulator Dir and MDS to a new directory that has no spaces.
From the run configuration settings,enable the use of Customized Command line ,Customized Working directory and Customized MDS directory.Update the
entries to point to the new path that has no spaces.
Alternatively you can use windows shortened dir name by typing dir /X in the CMD from the directory that contains the simulator and MDS,this should give you something like PROGRAM~2
In the end ,the issue is not with the IDE or the Simulator,just java and windows not playing nice.
see Oracle JDK 7u21 release note
My solution was:
Go to debugger Configurations, Simulator, Advanced and COPY the "default command line".
Hit debug. When the alert with the error appears:
Open a shell/cmd and paste the text obtained in step 1, hit enter.
It should open the emulator an the debugger should attached without a problem.
This is not an error, this is an "upgrade" of Oracle Java due to security issues, you cannot longer execute commandlines with arguments if theyre not passed as an array..
Hope it helps.
Also:
Here is the error documentated:
http://www.oracle.com/technetwork/java/javase/7u21-relnotes-1932873.html#jruntime
Heres the patch but only for java 17 and earlier:
http://www.oracle.com/technetwork/topics/security/javacpuapr2013-1928497.html
remove the Java 7 and keep only the java 6 and it will work fine
i have the same issue and i solve it with the above solution

Resources