""Java"" is not recognized as an internal or external command, program or batch file. in Kotlin - kotlin

I'm starting with kotlin on windows, I'm following the steps of
Working with the Command Line Compiler
And I get the following error after trying to compile(and add the bin directory in the path of my system):
Comand compile:
$ kotlinc hello.kt -include-runtime -d hello.jar
Error:
""Java"" is not recognized as an internal or external command, program or batch file
in my windows CMD.
I need to have java installed on my pc. To start with kotlin?

Install Java 8 JDK (not JRE) on your development machine as it is a prerequisite for running the Kotlin compiler, and also for any Java or Kotlin application. You can use either the Oracle JDK for most platforms or OpenJDK for Linux platforms.

Related

libgcc_s_dw2-1.dll is missing when compiling with "-static-libgcc -static-libstdc++"

I'm compiling a program using the following commands on Linux Debian based:
i686-w64-mingw32-g++ -c my_program.cpp
i686-w64-mingw32-g++ -static-libgcc -static-libstdc++ my_program.o
But when I try to run the program inside my Windows 7 VirtualBox I get the following error:
libgcc_s_dw2-1.dll is missing
Why it doesn't static import the dll on compilation time?
Thank you

Kotlin native; compilation failed: cannot run msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1/bin/clang++

I use Windows 7 and followed Get started with Kotlin/Native using the command-line compiler, downloaded kotlin-native-windows-1.5.10.zip and added its bin to the PATH of system. But when I try kotlinc-native hello.kt -o hello, get this error:
error: compilation failed: Cannot run program "C:\Users\<user-name>\.konan\dependencies\msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1/bin/clang++": CreateProcess error=193, %1 is not a valid Win32 application
What is the problem and how I can solve that?
Edit:
It seems the problem is caused by clang++.exewhich is in
C:\Users\<user-name>\.konan\dependencies\msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1/bin/
because when I try to run it, I get this error:
clang++ is not a valid Win32 application

How to debug the openjdk9 by netbeans8.2 in win10?

When I tried to debug the openjdk9 by netbeans8.2 in win10, I got the following error:
"\"D:/jdk9/jdk9/build/windows-x86_64-normal-server-fastdebug/jdk/bin/java.exe\":
not in executable format: File format not recognized"
How can I fix it?
I build the source code by command "./configure -with-freetype=/cygdrive/c/freetype -enable-debug -with-target-bits=64", then run make all, I also tried slowdebug, however, that also failed.
If I "run" the project instead of "debug", it runs successfully like below, so there is no issue for the file windows-x86_64-normal-server-fastdebug/jdk/bin/java.exe, it seems the gdb doesn't recognize the java.exe file.
Also I opened the openjdk source code from the location D:/jdk9/jdk/common/nb_native by netbeans, see below:
And tried to build it by netbeans, however, it produces the following error:
cd 'D:\jdk9\jdk\common'
sh ../configure --with-freetype=/cygdrive/c/freetype --with-debug-level=slowdebug --with-target-bits=64
/cygdrive/d/jdk9/jdk/configure: /cygdrive/d/jdk9/jdk/common/autoconf/configure: No such file or directory
PRE-BUILD FAILED (exit value 1, total time: 743ms)
I know that both paths /cygdrive/d/jdk9/jdk/configure and /cygdrive/d/jdk9/jdk/common/autoconf/configure exist.
This is how I configured the pre-built commands:
If you build the openjdk -with-target-bits = 64, then make sure that you installed a 64-bit gdb, or build the openjdk in 32-bit mode.
Your steps to import the nbproject looks correct.
Change Build => Pre-Build properties:
Set "Working Directory" to ../..
Set "Command Line" to sh ./configure ...

Mkbundle doesn't work for simple program

What am I missing here...?
I'm running some sanity tests after installing mono on an Ubuntu server (14.04.3 LTS), and hitting some problems when trying to mkbundle a simple test app that I got from the mono site.
The test app looks like this:
using System;
public class HelloWorld
{
static public void Main ()
{
Console.WriteLine ("Hello Mono World");
}
}
It compiles into hello.exe fine when I use mcs.
However, when I subsequently run mkbundle -o hello hello.exe --deps, this step fails. The resulting message reads:
OS is: Linux
Sources: 1 Auto-dependencies: True
embedding: /home/admin64/mono-test/hello.exe
embedding: /usr/lib/mono/4.5/mscorlib.dll
Compiling:
as -o temp.o temp.s
sh: 1: as: not found
ERROR: [Fail]
This is my first time working with mkbundle so I wouldn't be surprised if I missed some critical step. Does anyone have any ideas to this puzzler?
I'm running with the mono-complete package installed.
sh: 1: as: not found
mkbundle is trying to invoke the GNU assembler (as) on generated assembly code, after that it will invoke cc on generated C code and thus expect to find GCC installed and in your path. I assume you have not installed any other devel packages on that server, otherwise you would have those dependancies installed.
I believe just installing the gcc package will give you everything that it needs.
mkbundle env vars:
AS Assembler command. The default is "as".
CC C compiler command. The default is "cc" under Linux and "gcc" under
Windows.

Merging Mono Runtime 3.0.4 with MonoDevelop 3.x fails

I'm trying to merge the Mono Runtime (v 3.0.4) with a MonoMac application, but since the upgrade to 3.0.4 (from 2.10.11) this fails with the following error:
Merging Mono Runtime into app bundle
/Applications/MonoDevelop-old.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/mmp
-nolink "-minos=10.6.6"
-o "/Users/ted/Documents/XCode/Mac/StageTimer/StageTimer/bin/Release"
-n "StageTimer"
-a "/Library/Frameworks/Mono.framework/Versions/3.0.4/lib/mono/4.0/System.dll"
-a "/Library/Frameworks/Mono.framework/Versions/3.0.4/lib/mono/4.0/System.Xml.dll"
-a "/Library/Frameworks/Mono.framework/Versions/3.0.4/lib/mono/4.0/System.Core.dll"
-a "/Library/Frameworks/Mono.framework/Versions/3.0.4/lib/mono/4.0/System.Xml.Linq.dll"
-a "/Library/Frameworks/Mono.framework/Versions/3.0.4/lib/mono/4.0/System.Drawing.dll"
-a "/Applications/MonoDevelop-old.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/MonoMac.dll"
"/Users/ted/Documents/XCode/Mac/StageTimer/StageTimer/bin/Release/StageTimer.exe"
Process exited with code 1, command:
pkg-config --variable=prefix mono-2
Unhandled Exception: System.IO.DirectoryNotFoundException: Directory '/lib/mono/4.0' not found.
Even if I configure MonoDevelop to use Mono 2.10.11 instead of 3.0.4 it fails with the same error (and path: '/lib/mono/4.0'). Next I also tried modifying the symlink in /Library/Frameworks/Mono.framework/Versions/Current to point to 2.10.11 but still the same error & path.
Anyone with mono & pkg-config skills that knows how to configure this?
Similar issue happened to F# compiler when one tried to run it alongside Mono 3.0.4 (instead of 3.0.3). The issue boils down to a bugfix in Mono that prevents conflicting the homebrew pkg-config set up. The workaround that was adopted in F# sources was to hardcode the path to Mono's pkg-config.
You could probably get the same result as this by just overriding the environment variable PKG_CONFIG_PATH when launching MonoDevelop, this way:
PKG_CONFIG_PATH=/path/were/mono/pc/files/are/in/Mac:$PKG_CONFIG_PATH monodevelop
The exact path must be somewhere underneath /Library/Frameworks/Mono.framework/Versions/Current/ , just look out for files with .pc extension.