[java] Using Java with Microsoft Visual Studio 2012

I started as a C++ programmer, and Visual studio has worked splendedly for me. However, I recently have wanted to branch out to C# and Java. Visual studio supports C# and I now have some experience with it, but it does not support Java. Does anyone have any tips for me to allow Visual Studio to be used with Java? I was thinking of trying to use the add-in wizard of the Visual Studio SDK to create an extention for Java support, but before I started diving in to something possibly quite complicated, I was wondering if anyone here had attempted this before and might have some advice for me for approaching this problem. After much searching the internet, I found no Java support for visual studio, and the few workarounds I found were quite sub par.

To clarify:

I want to write an add in for Visual studio 2012 that will allow it to work with Java prgramming. I want when I create a project file to have the option of making a .java file, and when I compile, I want it to compile using the javac compiler (I have it downloaded already).

ADDITIONAL DETAILS:

I am aware that there are already Java IDEs out there, such as eclipse, I just wanted to know if it was possible to get it working with visual studio. I greatly enjoy visual studio and have been using it for some time now, and I would love to be able to program in all the languages I know using the same interface.

Yes, C# is a sort of beefed up Java, but there are some things I may need to do that need Java specifically, so I am going to need a way to write those. I can use eclipse or another IDE, but I would prefer visual studio if possible.

This question is related to java visual-studio

The answer is


If you're proficient in C# and Visual Studio, you might try IKVM. It's not exactly what you were asking for, but will certainly help with bridging the gap by allowing you to call into Java libraries from C# and vise versa. You can use it in Visual Studio, but it also has first class support in MonoDevelop.


Java Language Support extension provides basic features for the Java programming language. Current editing features include:

  • Syntax highlighting and brace matching
  • Outlining support for quickly collapsing classes and functions
  • Dropdown bars listing classes, enums, interfaces, fields, and methods within the current document

And if you wish to contribute then the project has been moved to its own GitHub repository



IntegraStudio enables syntax coloring, building, debugging and finding definition and references (F12 and ALT-F12) for Java projects in Visual Studio.


Java doesn't support the Net Framework. Java has its own Framework. Visual Studio used to support at one time J++ and J#, which were meant for Java developers who wanted to develop with the .Net, but since that has become extinct.

Most people when they want to develop java, they just go ahead and start with Netbeans, Eclipse, or something equivalent. They don't go around asking on sites like this if they could develop Java stuff in Visual Studio.

In my honest opinion, Java would not do very well in Visual Studio. Oracle and Microsoft are two separate entities and they need to remain that way. The only mix of Oracle and Microsoft I want to see is Java for Windows and Java development tools for Windows. I do not want to see Java in Visual Studio. It would get too confusing with C# lingering around the corner.


theoretically it could be done by defining a custom build step to the VS project. And you can make a file template to create a new java file, don't know if you could have it throw things in the right package or not, so you may end up writing quite a bit of the stuff a java ide would throw in already. it's not impossible, but from experience (I've used xcode on mac, vs in windows, eclipse, netbeans, code::blocks, and ended up compiling from command line for both java and c++ a lot) it's easier just to learn the new ide.

if you are insistent, i found this: http://improve.dk/compiling-java-in-visual-studio/

i plan on following and trying to modify it to create a general template for java

if possible (meaning if i understand enough of what im doing) im goint to implement a custom wizard for java projects and files.


Using Visual Studio IDE for porting Java to C#:

Currently I am using Visual Studio IDE environment for porting codes from Java to C#. Why? Java has a huge libraries and C# enables the access to the UWP ecosystem.

For supporting editing and debugging as well as examining Java Bytecode (disassembly), you could try:

For supporting Android (Java/C++) development, you could try:


If you want to get started with Java, you will be much happier with a Java IDE. IntelliJ Community Edition, Eclipse, and Netbeans are all free.

I know IntelliJ can be set to use Visual Studio keyboard shortcuts, so even if you are a keyboard junkie like myself, you won't feel out of place in a Java IDE.

The differences in IDEs are minimal, and the time you will save by using a Java IDE for Java development will be huge.

Good luck!