There is java package which I want to import in my powershell script and use the classes available in the package. Can someone help me achieving this?
Asked
Active
Viewed 761 times
1 Answers
3
PowerShell is based on the .NET runtime. (See the Wikipedia article.) You cannot use Java classes in it. You may, however, use .NET classes. They can be loaded as described here.
Your options are basically:
- Find a .NET equivalent. There is often one available, actually.
- Write a Java program and execute it using the Java runtime. (
java.exe MyClass
or whatever command would be used to run it.)