COMMUNITY

IDEA error - Haxe SDK has no valid root. Set up or change SDK

ide
intellij

(Дмитрий Маликов) #1

so autocomplete and navigation for std haxe classes not work
how to fix it?


(Valentin Lemière) #2

Strange place to have haxe installed, what os is that?

I think the “haxe toolkit home path” should be the path were there is the haxe std folder.


(Дмитрий Маликов) #3

this path i got from

which haxe

my os is ArchLinux

how i can find haxe std lib folder then?


(Valentin Lemière) #4

If you installed https://www.archlinux.org/packages/community/x86_64/haxe/ then the path should be /usr/share/haxe/ or maybe /usr/share/haxe/std/ not sure which one is expected.


(david mouton) #5

Just install IDEA and got the same error.
Add /usr/share/haxe/std to SRC and class path fix it
Use locate command to find haxe sdk


(Eric Bishton) #6

David has the right solution, though /usr/share/haxe/std may not the be place that the std library is installed on your computer. Once you have the right path, add it to both the Class Path and Source path tabs on the SDK configuration screen you show above. Also, it must be the only entry in both the class and source paths.

You will also need to find the neko executable and fill out that field, because haxelib relies upon it, and the plugin relies upon haxelib.


(Дмитрий Маликов) #7

it works.
thanks


(Дмитрий Маликов) #8

have error for this imports - UNresolved symbols

import php.Global;
import php.SuperGlobal;
import php.Syntax;

but

import php.NativeArray;
import php.Lib;

is ok


(Valentin Lemière) #9

You need the -D php7 define to use the new php target with haxe 3 (it is the default and only one on haxe 4).
There should be some project parameter window were you can add this.


(Дмитрий Маликов) #10

didn’t found this parameter in IDEA settings


(Valentin Lemière) #11

Maybe adding it to your hxml would be enough, not sure how idea gets its project parameters.


(Дмитрий Маликов) #12

have this file

build.hxml

-main Main
-php bin
-D php7
–php-prefix ModuleName1


(Eric Bishton) #13

Putting the define into the hxml is the right way to do it. Be sure that your module settings (File->Project Structure->Module->Haxe) are set to use the correct hxml file.

If IDEA isn’t finding the symbols, browsing, or highlighting correctly, you will also have to add php7 to the ‘macros’ setting in the module settings page (they are project-wide, actually).


(Дмитрий Маликов) #15

found it
when recreated project and installed EAP edition IDEA


(Дмитрий Маликов) #16

made this configuration
but its not work 002


(Eric Bishton) #17

You don’t have to add the -D in the project macros. When the compiler is called, -D is added already. So, you are probably getting (possibly hidden) errors of the type: “-D -D” Invalid command line argument. That will mess up compiler completions and compilation requests. It won’t affect the unresolved symbol name, though.

If imports for NativeArray and Lib are working and Global, SuperGlobal, and Syntax are not, then you have a pre-4.0 Haxe SDK (or std library) installed. You should see Global.hx, SuperGlobal.hx, and Syntax.hx in your directory listing under /usr/share/haxe/std/php.

This is what the 3.4.2 directory listing looks like:


06/29/2017  10:25 AM    <DIR>          .
06/29/2017  10:25 AM    <DIR>          ..
06/29/2017  10:25 AM            25,005 Boot.hx
06/29/2017  10:25 AM             2,996 BytesData.hx
06/29/2017  10:25 AM    <DIR>          db
06/29/2017  10:25 AM             1,848 Exception.hx
06/29/2017  10:25 AM             1,421 HException.hx
06/29/2017  10:25 AM             1,394 IteratorAggregate.hx
06/29/2017  10:25 AM             6,462 Lib.hx
06/29/2017  10:25 AM             1,199 NativeArray.hx
06/29/2017  10:25 AM             1,199 NativeString.hx
06/29/2017  10:25 AM            10,719 NativeXml.hx
06/29/2017  10:25 AM    <DIR>          net
06/29/2017  10:25 AM             5,585 Session.hx
06/29/2017  10:25 AM            14,053 Web.hx
06/29/2017  10:25 AM    <DIR>          _std
              11 File(s)         71,881 bytes
               5 Dir(s)  1,024,650,338,304 bytes free

And, this is the 4.0 version:


07/16/2018  02:42 PM    <DIR>          .
07/16/2018  02:42 PM    <DIR>          ..
07/16/2018  02:42 PM               330 ArrayAccess.hx
07/16/2018  02:42 PM            24,555 Boot.hx
07/16/2018  02:42 PM               296 Closure.hx
07/16/2018  02:42 PM            11,083 Const.hx
07/16/2018  02:42 PM    <DIR>          db
07/16/2018  02:42 PM             1,956 Error.hx
07/16/2018  02:42 PM             2,075 ErrorException.hx
07/16/2018  02:42 PM             1,989 Exception.hx
07/16/2018  02:42 PM            38,863 Global.hx
07/16/2018  02:42 PM             1,424 IteratorAggregate.hx
07/16/2018  02:42 PM             5,740 Lib.hx
07/16/2018  02:42 PM             2,294 NativeArray.hx
07/16/2018  02:42 PM             1,575 NativeAssocArray.hx
07/16/2018  02:42 PM             1,719 NativeIndexedArray.hx
07/16/2018  02:42 PM             1,342 NativeString.hx
07/16/2018  02:42 PM             1,742 NativeStructArray.hx
07/16/2018  02:42 PM    <DIR>          net
07/16/2018  02:42 PM               153 Ref.hx
07/16/2018  02:42 PM    <DIR>          reflection
07/16/2018  02:42 PM               141 Resource.hx
07/16/2018  02:42 PM                93 RuntimeException.hx
07/16/2018  02:42 PM               224 Scalar.hx
07/16/2018  02:42 PM             5,049 Session.hx
07/16/2018  02:42 PM               456 SessionHandlerInterface.hx
07/16/2018  02:42 PM               122 StdClass.hx
07/16/2018  02:42 PM             2,051 SuperGlobal.hx
07/16/2018  02:42 PM             8,366 Syntax.hx
07/16/2018  02:42 PM               711 Throwable.hx
07/16/2018  02:42 PM               133 Traversable.hx
07/16/2018  02:42 PM            13,332 Web.hx
07/16/2018  02:42 PM               382 _polyfills.php
07/16/2018  02:42 PM    <DIR>          _std
              28 File(s)        128,196 bytes
               6 Dir(s)  1,024,650,338,304 bytes free

If the new classes aren’t in your …/std/php directory, then IDEA can’t find them.