Introduction
Visual J++—Microsoft’s forgotten attempt at making Java their own.
Back in the late 90s, Microsoft saw the growing popularity of Java and thought, “Hey, what if we made our own version of it, deeply integrated into Windows?” That’s exactly what Visual J++ was.
Spoiler alert: Sun Microsystems sued Microsoft over it, and Visual J++ was eventually buried. But its legacy still echoes in modern .NET languages like C# and Visual J#.
The History of Visual J++
Visual J++ was released in 1996 as part of Microsoft’s Visual Studio. It was meant to be a Java-based language, but with deep integration into Windows through Microsoft’s Windows Foundation Classes (WFC).
Why Was Visual J++ Created?
- Microsoft saw Java gaining traction and wanted to bring it into Windows development.
- Traditional Java was cross-platform, but Microsoft wanted a Windows-centric version.
- By adding Windows APIs, Microsoft aimed to make J++ the go-to Java variant for Windows developers.
The Lawsuit That Killed Visual J++
🚨 BIG PROBLEM: Sun Microsystems, the creators of Java, sued Microsoft for breaking Java’s cross-platform promise.
- Microsoft added Windows-specific features that made Visual J++ incompatible with standard Java.
- Sun argued that Microsoft violated their licensing agreement.
- In 2001, Microsoft lost the lawsuit and was forced to discontinue Visual J++.
Key Innovations of Visual J++
✅ Windows Integration → Allowed Java-like development with direct Windows API access.
✅ Windows Foundation Classes (WFC) → A Microsoft-built replacement for Java’s Swing and AWT.
✅ Early Influence on .NET → Many concepts from Visual J++ inspired C# and the .NET framework.
Further Reading:
Visual J++’s Influence on Modern Languages
Feature | Visual J++ | Modern Equivalent |
---|
Java-Like Syntax | ✅ Yes | ✅ Java, C# |
Windows-Specific Features | ✅ Yes | ✅ C#, WinForms |
Object-Oriented Programming | ✅ Yes | ✅ Java, C#, Kotlin |
WFC (Windows Foundation Classes) | ✅ Yes | ❌ Replaced by .NET (WinForms, WPF) |
JVM Compatibility | ❌ No | ✅ Java, Kotlin |
💡 Verdict: Visual J++ was a stepping stone towards C# and the .NET ecosystem.
Visual J++ Syntax Table
Concept | Visual J++ Code | Equivalent in Java / C# |
---|
Hello World | System.out.println("Hello, World!"); | System.out.println("Hello, World!"); / Console.WriteLine("Hello, World!"); |
Variables | int x = 42; | int x = 42; |
Loops | for(int i = 1; i <= 10; i++) | for(int i = 1; i <= 10; i++) |
Conditionals | if(x > 5) System.out.println("High"); | if (x > 5) { System.out.println("High"); } |
Functions | int square(int x) { return x * x; } | int square(int x) { return x * x; } |
Classes | class Person { } | class Person { } |
10 Visual J++ Code Examples
1. Hello, World!
1
| System.out.println("Hello, World!");
|
2. Declaring Variables
3. If-Else Statement
1
2
3
4
5
| if (x > 10) {
System.out.println("X is greater than 10");
} else {
System.out.println("X is 10 or less");
}
|
4. For Loop
1
2
3
| for (int i = 1; i <= 5; i++) {
System.out.println("Iteration: " + i);
}
|
5. Function Definition
1
2
3
| int square(int x) {
return x * x;
}
|
6. Arrays
1
| int[] A = {1, 2, 3, 4, 5};
|
7. Using Windows APIs (WFC Example)
1
2
3
4
5
6
7
| import com.ms.wfc.ui.*;
public class MyApp extends Form {
public MyApp() {
Button btn = new Button(this, "Click Me!");
}
}
|
8. Exception Handling
1
2
3
4
5
| try {
int result = 10 / 0;
} catch (ArithmeticException e) {
System.out.println("Division by zero error!");
}
|
1
2
3
4
5
6
| import java.util.Scanner;
Scanner scanner = new Scanner(System.in);
System.out.println("Enter your name:");
String name = scanner.nextLine();
System.out.println("Hello, " + name + "!");
|
10. Basic File Writing
1
2
3
4
5
| import java.io.FileWriter;
FileWriter writer = new FileWriter("output.txt");
writer.write("Hello, file!");
writer.close();
|
Why Did Visual J++ Fail?
❌ Legal Issues → The Sun vs. Microsoft lawsuit forced Microsoft to kill J++.
❌ Vendor Lock-In → It broke Java’s cross-platform compatibility, alienating developers.
✅ But It Paved the Way for C# and .NET!
💡 If you liked Visual J++, you’d probably enjoy C#—which is what Microsoft wanted all along.
Key Takeaways
- Visual J++ was Microsoft’s attempt at making Java more Windows-friendly.
- It introduced Windows-specific features but violated Java’s licensing.
- After its lawsuit, Microsoft pivoted towards C# and .NET.
References
- Visual J++ Wikipedia
- Microsoft-Sun Lawsuit
- History of Visual J++