How to debug Haxe using IntelliJ IDEA? - intellij-idea

I'm trying to debug a Haxe application with cpp target using IntelliJ IDEA.
Every time i got same error while trying to run debug on it:
"You can debug only flash or HXCPP targets"
I have a basic HelloWorld project setup with the Haxe compiler and the C++ target (setup).
I'm using latest plugin for Haxe (0.9.10) and hxcpp-debugger with old protocol version (as mentioned in haxe plugin description). Tried this on IDEA14, 15 & 2016.
All guides that I found to make it work looks outdated.

the closest i found is this video https://www.youtube.com/watch?v=6JjgOrEXcQc - it uses openfl, but if you look at the logging window, it outputs a command : haxelib run hxcpp Build.xml haxe -Ddebug -DHXCPP -Dcpp -Ddebug -Ddesktop -Dhaxe_208 -Dhaxe_209 -Dhaxe_210 -Dhxcpp -Dnme -Dnme_install_tool -Dsys -Dtrue -Dwindows. You'd have to make your build run that same command if you're not using openfl to build.
The code must also create a debug socket server somewhere in your main method:
new DebugSocket("127.0.0.1", 65333, true)

Related

Can't get kotlin "hello world" example to Run in intelliJ

I'm following the intelliJ IDEA tutorial titled Create your first Kotlin application
(Last modified: 08 March 2021). Here are the various versions I'm using:
~$ java -version
java version "16" 2021-03-16
Java(TM) SE Runtime Environment (build 16+36-2231)
Java HotSpot(TM) 64-Bit Server VM (build 16+36-2231, mixed mode, sharing)
~$ javac -version
javac 16
Here's my code:
fun main(args: Array<String>) {
println("What is your name?")
val name = readLine()
println("Hello $name")
}
Here's what my project structure looks like:
I notice that it says "Kotlin not configured" above my code, but when I go to Tools > Kotlin > Configure Kotlin in Project, I get
:
In the Event Log pane, I see this:
4/15/21
1:54 PM Download pre-built shared indexes
Reduce the indexing time and CPU load with pre-built JDK shared indexes
Always download
Download once
Don't show again
Configure...
1:54 PM Gradle sync started
1:54 PM Gradle sync failed: Unsupported class file major version 60 (5 s 329 ms)
1:55 PM No IDE or plugin updates available
In the Problems(?) pane, I see this:
Unresolved reference: println
Unresolved reference: readLine
Unresolved reference: println
Parameter 'args' is never used
Package directive doesn't match file location
Any ideas on why the basic functions in my program are not recognized?
Thanks for looking!
Edit: I tried downloading JDK 15 and specifying that in my Project Structure, but I got the same results:
try build>clean project.
As for your unresolved references, you can double-click/left-click > show context options. If that doesn't work then maybe reinstall InteliJ Idea or download Android Studio which has a lot more support on google and yt.
Okay, I got it working. I'll try to figure out what I did.
tldr; I had to switch from JDK 16 to JDK 15 to get my hello world console application to run.
First, when I was setting up the project, I chose the wrong Project Template: I selected JVM - Application rather than JVM - Console Application. This is what I needed to do:
So, I started a new project, chose the right template, and I typed in my code, and I noticed a Build pane at the bottom left displayed:
I tried Build > Build Project, and nothing changed. So, I tried the Run menu item: the first section of the Run menu was grayed out, but there was another Run command in the second section of the Run menu. I selected that Run, and a little window popped up with the following:
Run
0 Edit Configurations
The "0 Edit Configurations" line was highlighted, and I got nowhere trying to figure out how to Run my code.
So, I started yet another new project, and this time I selected a different JDK, version 15:
After clicking Next, then Finish, I typed in my code, and this time the Build pane looked like the following (without me doing anything but typing in my code):
After I finished typing in my code, as the tutorial described, this time there was a little green arrow in the gutter:
When I clicked on the green arrow in the gutter, I could successfully Run my program.
So, it appears that you cannot use JDK 16, and you have to use JDK 15. intelliJ was able to detect all my installed Java versions, so any version you have installed should appear as a choice in the the project settings. You may have to quit intelliJ, then restart intelliJ after you install JDK 15 in order to see it listed as a choice under Project JDK: when you create a project.

Problem building project in IntelliJ 2020.1

I'm trying to build my project but I can't.
I get this error:
Error:Cannot run program "C:\tools\jdk8.0.191\bin\java.exe" (in directory "C:\Users\"my user"\AppData\Local\JetBrains\IntelliJIdea2020.1\compile-server"): Malformed argument has embedded quote: -Djava.endorsed.dirs=\"\"
Do anyone know what to do about this? Iøm trying to build in IntelliJ 2020.1
Best Regards
It might be related to more strict command-line processing in JDK on Windows after JDK-8221858 (private) security patch see this comment for details.
Try following workaround: Help -> Edit Custom VM Options action and add the following line at the bottom of the file: -Djdk.lang.Process.allowAmbiguousCommands=true and restart IDE.

Quasiquotes in Intellij 14?

After installing the newly released IJ14 Community Edition - the quasiquotes (which had been working on IJ13) popped up on the radar.
Is there an IJ setting to enable this?
BTW this is a maven build (and works in 13.1 just fine!). Here is the section of the build related to the quasiquotes. I have not seen any mention of the plugin not working properly in 14, but input here would be appreciated.
<!-- The following plugin is required to use quasiquotes in Scala 2.10 and is used
by Spark SQL for code generation. -->
<compilerPlugins>
<compilerPlugin>
<groupId>org.scalamacros</groupId>
<artifactId>paradise_${scala.version}</artifactId>
<version>${scala.macros.version}</version>
</compilerPlugin>
</compilerPlugins>
UPDATE I just installed the 14.0.1 update from 11/11/14. This time I tried Intellij Ultimate : but Quasiquotes are still not working.
UPDATE I have opened a JIRA with JetBrains. https://youtrack.jetbrains.com/issue/IDEA-133993
I think there is a workaround to get it running:
You have to go to the IntelliJ settings, to the "Scala Compiler" and add a plugin: "/home/YOURUSERNAME/.m2/repository/org/scalamacros/paradise_2.10.4/paradise_2.10.4-2.0.1.jar"
The problem involves the paradise plugin that provides support for quasiquotes with scala 2.10. It is not working in IJ14 presently.
UPDATE The following is new info on the building with Spark page
https://cwiki.apache.org/confluence/display/SPARK/Contributing+to+Spark#ContributingtoSpark-IntelliJ
"Rebuild Project" can fail the first time the project is compiled, because generate source files are not automatically generated. Try clicking the "Generate Sources and Update Folders For All Projects" button in the "Maven Projects" tool window to manually generate these sources.
Compilation may fail with an error like "scalac: bad option: -P:/home/jakub/.m2/repository/org/scalamacros/paradise_2.10.4/2.0.1/paradise_2.10.4-2.0.1.jar". If so, go to Preferences > Build, Execution, Deployment > Scala Compiler and clear the "Additional compiler options" field. It will work then although the option will come back when the project reimports. If you try to build any of the projects using quasiquotes (eg., sql) then you will need to make that jar a compiler plugin (just below "Additional compiler options"). Otherwise you will see errors like:
/Users/irashid/github/spark/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
Error:(147, 9) value q is not a member of StringContext
Note: implicit class Evaluate2 is not applicable here because it comes after the application point and it lacks an explicit result type
q"""
^
It's s not q:
val x = 5.0
println(s"$x.toInt")
I loaded spark up in Intellij 13 and the macro paradise backport of quaisquotes still shows an error, I don't see how intellij would be able to support this syntax as it's a compiler plugin:

NANO-X Microwindows Embedded Linux

Hello I am new to the coding for the Embedded Linux for ARM platform.
I am using the NANO-X microwindopw for the GUI inteface for the Linux server, so i have downloaded the nano-x soruce from (ftp://microwindows.censoft.com/pub/microwindows/)
then i try to compile the demo code for the nano-x. when i try to compile it gives me the error
: undefined reference to `GrOpen',' GrReqShmCmds'...............
I could not successfully build it.
I have included all the header files from the /microwin/src/include/ to the /usr/include.
still i am getting the error.

FDT5 Haxe Compilation Error "Uncaught exception - module.c(124) : Builtin not found : fasthash"

I am a user of FDT5 and getting this very strange Haxe compiler error when using v2.09 of Haxe and v1.8.2 of NekoVM.
"Uncaught exception - module.c(124) : Builtin not found : fasthash"
Can anyone help me resolve this error as can't compile my FDT5 project, as if I compile it directly in Mac OSX Lion. Terminal it does not report any issues.
Any help would be most appreciated.
You may need to setup the path to your Neko installation
FDT 5.5 ships with Neko, but the path to it is not set by default. Because it's not, you may get errors as you mentioned:
To fix this, go to Preferences>Haxe>Neko VM and point to a Neko installation directory.
Custom Installation Directory
You can point to a custom installation. Perhaps if you used the standalone installer from the Haxe website.
Using FDT's Neko Installation
For windows you can just point to FDT5>haxe>neko-1.8.2-osx
For OSX, because FDT is a self contained package, you can't naviagate to Neko via the OSX GUI. Instead type in this path, or copy and paste the path from where your Haxe location is set and paste it into the Neko location. Then just change the last directory name to the name of the Neko folder: haxe-2.09-osx -> neko-1.8.2-osx.