-
-
Save kant2002/df0972d7fc83e29324513e71a36c919f to your computer and use it in GitHub Desktop.
Solution for the task "Run the Java Hello World example via both dotnet run and javac"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net6.0</TargetFramework> | |
<EnableDefaultCompileItems>false</EnableDefaultCompileItems> | |
<ImplicitUsings>enable</ImplicitUsings> | |
</PropertyGroup> | |
<ItemGroup> | |
<Compile Include="Program.java" /> | |
</ItemGroup> | |
<Target Name="GenerateCsharp" BeforeTargets="BeforeBuild" KeepDuplicateOutputs="true"> | |
<WriteLinesToFile File="$(IntermediateOutputPath)augmentation.cs" Overwrite="true" Encoding="Unicode" | |
Lines="namespace System { | |
class err { | |
public static void println(string message) { | |
Console.WriteLine(message)%3B | |
} | |
} | |
} | |
" /> | |
<ItemGroup> | |
<Compile Include="$(IntermediateOutputPath)augmentation.cs" /> | |
</ItemGroup> | |
</Target> | |
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program { | |
public static void main(String[] args) { | |
System.err.println("Hello, World!"); | |
} | |
public static void Main(String[] args) { | |
main(args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Other variant where we run java )