Dart Editor: It didnt work? - dart

I launched Dart Editor yesterday but it didn't work giving the error:
("A Java Runtime(jre) or Java Development Kit(jdk) must be avaible in
order to run DartEditor. No Java virtual machine was found after
searching the following loacations:
C:\Users\name\Donwloads\darteditor-windows-x64\dart\jre\bin\javaw.exe
jawaw.exe in your current PATH ")
Do you think how i going to fix this error ?
Thanks

Checkout this link:
https://www.dartlang.org/tools/editor/troubleshoot.html
"Launching Dart Editor"
Your Java version should have the same bit width as your Dart Editor version. For example, if you're using a 64-bit Dart Editor, then you should use 64-bit Java. Otherwise, you might see a message like this when you try to launch Dart Editor:
Failed to load the JNI shared library "C:\Program Files(x86)\Java\jre6\\bin\client\jvm.dll
To determine which version of Java you are running, do one of the following:
1-Go to CMD type java -version.
2-Go to Start -> Programs and Features.
Specifying the Java runtime
If necessary, you can specify the Java runtime that Dart Editor uses. Go to your Dart installation directory and add the following two lines to DartEditor.ini immediately before the existing ‑vmargs line:
-vm
/full/path/to/java
Important: On Windows, use double backslashes (\) as the directory separator:
-vm
c:\\bin\\java_jdk1.7.0\\bin\\javaw.exe
For example, DartEditor.ini might have:
-vm
/usr/local/buildtools/java/jdk-64/bin/java
-vmargs

You just need to download the Java Development SDK and your Java version should have the same bit width as your Dart Editor version. For example, if you're using a 64-bit Dart Editor, then you should use 64-bit Java. Otherwise, you might see a message like this when you try to launch Dart Editor:
You can download it here:
http://www.oracle.com/technetwork/java/javase/downloads/index.html?ssSourceSiteId=otnjp
and specify the java/bin directory in the darteditor.ini file.you can specify the Java SDK that Dart Editor uses. Go to your Dart installation directory and add the following two lines to DartEditor.ini immediately before the existing ‑vmargs line:
-vm
/full/path/to/java
Important: On Windows, use double backslashes () as the directory separator:
-vm
c:\\bin\\java_jdk1.7.0\\bin\\javaw.exe
For example, DartEditor.ini might have:
-vm
/usr/local/buildtools/java/jdk-64/bin/java
-vmargs
If it still doesn't work then you can follow this:
https://www.dartlang.org/tools/editor/troubleshoot.html

I made jre folder in my dart program folder.
And loaded there latest JRE. (Java runtime environment)
It stays in every new darteditor installation.
Better / right way would maybe be using path clause...
I dont know how to.. / dont want to use it.
My choise might need to load new version of jre now and then.
Hope this helps you...

Related

How to transpiling dart to javascript in Phpstorm

I installed dart-sdk and downloaded dart plugin to Phpstorm 8.0.3, but I cant figure out how to transpile dart to js. When I am trying to make file watcher I dont have any Dart2Js predefined template in settings.
Thank you
I know only WebStorm 9 and 10. Maybe you can still derive how it might work in PHPStorm.
Usually you don't want to build to JavaScript on each file change because this would slow your machine down.
During development you use pub serve which is automatically launched by WS 9 and 10 and which transpiles Dart files to JavaScript only on demand (when requested by a browser) and only compiles what it didn't compile previously.
For deployment WebStorm can use the Pub: build ... context menu of the pubspec.yaml file in the project view.
See #Günter Zöchbauer answer.
Using dart2js is not the recommended approach, as it runs on file level instead of project, creates output in the src folder, etc. - but the main reason is that it is not clear when/why to use it. If you need to build your project, use 'pub build' (available in pubspec.yaml right-click menu). When debugging in browser, 'pub serve' is always used implicitly - it performs all needed transformations...
But, if you still need this watcher, you can easily configure it yourself by adding a watcher of 'custom' type.
Program: path/to/dart2js
Arguments: --out=$FilePath$.js $FilePath$
Working directory: $FileDir$
Output paths: $FileName$.js:$FileName$.js.map:$FileName$.js.deps

How to change the version of python that pyscripter uses

I am a newb with python and just learning what to do.
I am using pyscripter and have been for a while whilst learning.
I am now going through an online course which is taught in 2.6, yet my pyscripter uses the latest.
I need to know how to change it to use an older version, I have seen replies about changing the PATH variable but not where it is or how to do it.
I have 3 versions of python on my machine, 25,26 and 33.
I don't know if this is the best way to do it, but those are the two ways I did it:
WAY 1 (The best of two)
Go to PyScripter>>Tools>>Options...>>Custom Parameters... and add the following values
1. PythonDir = C:\Program Files\CustomPythonInstallation
2. PythonExe = C:\Program Files\CustomPythonInstallation\python.exe
3. PythonVer = 3.3.3
Note: Adapt the Name = Value pairs above to your case.
And close the window with OK button.
Now select PyScripter>>Run>>Python Engine>>Remote and your are ready to go.
WAY 2 (The more temporary solution)
Go to PyScripter>>Run>>Configure External Run...
set the "Application:" field to your python.exe file
Close the window with OK button.
Make sure you run your scripts with PyScripter>>Run>>External Run (Alt+F9)
I hope this helped, good luck.
The easiest way I know (on Windows) is, having used the installer executable, I select from the Start menu's PyScripter folder whichever version of Python I want to run.
You can modify the PYTHONPATH (under Pyscripter>>Tools, for instance)
You can modify your External Python Interpreter with Pyscripter>>Modify Tools>>Python &Interpreter>>Modify
You can modify the default Python engine used with Pyscripter>>Options>>IDE Options>>Python Interpreter>>Python Engine Type
You can simply redirect Pyscripter to see the environment of a different Python distribution.
In Windows, do this by assigning PYTHONDLLPATH in the Pyscripter shortcut. You can r-click on the shortcut, access its properties and then set the target to:
[Pyscripter executable dir] --PYTHONDLLPATH [Python distribution dir]
See this image to help you out:
setting a shortcut target
For example, in my Win10 64-bit computer I have a Python 2.7.8 installation back from when I installed ArcGIS, which is automatically recognized by my 32-bit Pyscripter installation.
In the same computer, I also have Anaconda installed with two environments that feature two 64-bit Python distributions:
2.7.14 in "C:\ProgramData\Anaconda2"
3.6 in "C:\Users\bouzi\AppData\Local\conda\conda\envs\py3"
When I installed a 64-bit version of Pyscripter, that Pyscripter version couldn't even open, as it couldn't find the conda distributions. I had to point them to it by replacing the shortcut target to:
"C:\Program Files\PyScripterx64\PyScripter.exe" --PYTHONDLLPATH "C:\ProgramData\Anaconda2"
You can create three Pyscripter shortcuts that point to these different installations of Python within your system. It's probably not the optimal way to deal with this but it works, and allows you to combine Anaconda environments with Pyscripter.
You can also read more on opening non-standard python distributions with PyScripter from this link.
Run->Python Versions -> setup Python Versions -> Add... select folder
p.s.
python 3.7.3 - ok,
still python 3.10.5 could not be identified by PyScripter in such a way (actually works with WAY_1 Solution in this thread but pip install under such env. not succeed afterwards)

JNA UnsatisfiedLinkError, but jna.library.path is set

I'm using the following code to load a dll in JNA (irrelevant code is left out):
public class JNAMain {
public interface PointShapeBuffer extends Library { ... }
public static void main(String[] args){
System.setProperty("jna.library.path", "c:\\jnadll");
System.setProperty("java.library.path", "c:\\jnadll");
PointShapeBuffer jna = (PointShapeBuffer) Native.loadLibrary("FileGDBAPI", PointShapeBuffer.class);
}
}
And I get the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'FileGDBAPI': The specified module could not be found.
I've also tried setting the VM args. Any suggestions would be great.
Edit: For reference, I am using a publicly available library found here (registration is required).
In my experience you usally see this error when calling 32bit native dlls from a 64bit jvm on 64bit Win7. Win7 works differently for 64bit and 32bit applications.
On 64bit Win7 you can call functions in native 32bit dll's, but you need to use a 32bit JVM.
Download and install 32bit Java Runtime Environment (JRE). You can install a 32bit and 64bit jvm on the same machine, just make sure they are installed in seperate directories.
Ensure you run the 32bit JRE instead of the default 64bit JVM when you execute your program. Either A) change your CLASSPATH and JAVA_HOME environment variables to point to the 32bit jvm, or write a script to set the CLASSPATH and JAVA_HOME and launch you application.
The reason for this is 32bit dll's are incompatible with 64bit applications, and 64bit Win7 uses a 32bit emulator to run 32bit applications. Although Windows Libraries might be called named xxxx32.dll (e.g. user32.dll) the libraries in the System32 folder on a 64bit Win7 are 64bit libraries, not 32bit, and the libraries in SysWOW64 are 32bit libraries, confusing right?!?
You can also place the library in the 32bit system folder (SysWOW64) and make the JNI call from within a 32bit JVM.
Check out the following link for a full explanantion as how 64bit Win7 handles libraries;
http://www.samlogic.net/articles/32-64-bit-windows-folder-x86-syswow64.htm
And if you really want to help yourself get to sleep, trying starting on this ;)
http://msdn.microsoft.com/en-us/windows/hardware/gg463051.aspx
Change your:
Native.loadLibrary("FileGDBAPI", PointShapeBuffer.class);
to:
Native.loadLibrary("C:\\jnadll\\FileGDBAPI.dll", PointShapeBuffer.class);
If you dive into the jna source code enough you will find a nice little hook in the NativeLibrary class:
/** Use standard library search paths to find the library. */
private static String findLibraryPath(String libName, List searchPath) {
//
// If a full path to the library was specified, don't search for it
//
if (new File(libName).isAbsolute()) {
return libName;
}
...
So it will catch if you just passed an absolute path and not even use the searchPath. This was why you dont have to worry about jna.library.lib.
You need to specify the folder containing your DLL, not the DLL's actual path.
e.g. for baz.dll at c:\foo\bar\baz.dll, the path should be set to c:\\foo\\bar. (note in Java if you're using backspaces you'll have to escape them with backslashes)
You might want to download the latest version with jna.jar and platform.jar and just include those. No need to set the path then.
Like it was already mentioned in some comments: checks your Dependencies of your DLL/Library. Best Tool for this is Dependency Walker (http://www.dependencywalker.com/). Only if all your Dependencies are fulfilled, jna finds your DLL.... took me quite long to figure this out
it is may be because there is the conflation into the lebweb kit. I am not sure but that has to be that only now u can do one thing try this.
$ dpkg -l | grep -i jna
try this command and if u getting this output
ii libjna-java 3.2.7-4 Dynamic access of native libraries from Java without JNI
or any other output then this u need to remove then that jna from the system because if program itself have jna jar with that then there is no need of system jna for the same. so do something like this.
sudo apt-get autoremove libjna-java
and try for restart that application again. it will run and it is not running then try to install new version of libwebkit-gtk.
hope this will help. this helped me.

SharpDevelop: "Could not find fsi.exe" even when f# is installed

I installed a copy of f# on my machine (on a secondary drive), and when i try to start the F# interactive prompt, it says it could not find fsi.exe. Do i need to copy some files somewhere or something?
You could try to look here:
"%ProgramFiles(x86)%\Microsoft SDKs\F#\<fsharp_version>\Framework\<dotnet_version>\Fsi.exe"
With the VS 15.8 update it appears to have been moved. I found it in:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp\fsi.exe
Could you be more specific with your repro steps? I assume you are using the latest, May 2009 CTP? Also, when you say 'start the F# Interactive prompt' are you talking about launching it from the start menu?
On most machines it will be exactly:
"C:\Program Files (x86)\FSharp-1.9.7.4\bin\fsi.exe"
If you did something non-standard it could just be a bug in the installer. E.g., did you override the Program Files folder for your F# installation by passing in a command line parameter to msiexec?
Do a quick search for fsi.exe on your machine (the console F# interactive window) and point your shortcut there.

Delphi 2009 command line compiler using dcc32.cfg?

In Delphi 2009, how can I build a project using command line. I tried using the command line compiler and supplying -a -u -i -r in dcc32.cfg file. But compiler is not recognizing the paths and throwing the error required package xyzPack is not found.
-aWinTypes=Windows;WinProcs=Windows;DbiProcs=BDE;DbiTypes=BDE;DbiErrs=BDE
-u"C:\MyProj\Output\DCP"
-i"C:\MyProj\Output\DCP"
-r"C:\MyProj\Output\DCP"
and on command line i execute the command :
dcc32 "C:\MyProj\MyProject.dpr" -B -E"c:\MyProj\Output\EXE"
What am I doing wrong here?
Thanks & Regards,
Pavan.
Instead of invoking the compiler directly, consider using MSBuild on your .dproj, since that's what the IDE uses. Delphi MSBuild Build Configurations From Command Line might help you with that.
From the related answer (as shown below) ie:
Compiling with Delphi 2009 from a command line under Windows Vista 64-bit
I notice that you should be able to build a single package from the command line this way. I have used batch files (buildall.cmd) to launch dcc32, and have not yet used msbuild.
I have ultimately found both approaches frustrating, and have instead decided to opt for building a little GUI shell (a lite version of Final Builder, if you like) that basically works as a semi-graphical semi-command-line way of automating my builds and filtering the compiler output to produce results. I would be highly interested in anyone else's experiences with "tinder box" (daily or even continuous build) operations with Delphi.
You may end up where I'm heading... just buy Final Builder. :-)

Resources