Orange text in VS code when writing in Java - java

I have recently set up my VS code to be able to run Java. I downloaded the extension pack for java and then downloaded Azul Zulu jdk to run java programs. So far it runs fine, but for certain snippets of code orange blocks of text will appear. They cannot be deleted or modified in any way, and I haven't changed any settings besides changing VS code to use the Zulu jdk as my default jdk.
Example of the orange blocks I'm getting
I have tried going through my setting related to Java in my VS code, but I can't find anything that would cause this. I haven't done anything besides set up my default jdk and installing the extension for java.
Any help with getting rid of these orange blocks would be appreciated.
Edit:
Java> Inlay Hints > parameter names: Enabled, was the setting that was causing it. Setting this to none fixed the issue. I was confused as the guide I was following did not mention this, nor did it show up on their visual examples when writing code, even though our methods from installing to writing java would have been the same.

Related

Issues with Java code formatting in Visual Studio Code

I develop Java in vscode + some java extensions (one of them is Red Hat's Java support).
When I last checked in the code, I believe that Red Hat's ext attempted to format the code in some files, which made my boss furious.
If I set the java.format.enabled to off, it should not happen again, should it? I want to be able to preserve the code in whichever shape and style it was there prior to my changes.
I otherwise love working with vscode, but don't want to get into trouble.
yea, it can be.
"java.format.enabled": false,
can do it.

How to get Apple Java Extensions (com.apple.eawt) work on JDK 7 and higher?

TL;DR: Apple has dropped native feature support in Java. Especially touchpad gestures are not working any longer. I wrote a library that does the job using JNI. Take a look at my answer below.
I'm searching for about hours to make the Apple Java Extensions work on JDK 7 or 8. I have been trying all I can think of. All threads on the internet about this simply blame the JDK for this. I think this should be solvable, because it worked in JDK 6. For clarity: I can make it work in JDK 6, but I don't want this legacy dependency, because not everybody that will use my application has JDK 6 or knows how to install it, let's say. The goal is to make a double-clickable JAR file that will run as expected with the OS X features (menu bar, gestures, about handler, etc...) with every version of Java installed (greater than JDK 6).
Since the developer preview release of OS X El Capitan, it became impossible for 99% of average computer users to install Java 6, so this was no longer an option for me. I finally decided to write a native library that will inform Java about gestures through JNI. The project works great and is hosted on GitHub.
Take a look at it here:
https://github.com/mcourteaux/MultiTouch-Gestures-Java
I just happened to run across your question and noted that it has not been answered yet. I have a Java program that I have been developing on the Mac, and noted that when I ran it under Java 7, the menu bar, Preferences, Quit and About all worked fine using rt. jar in the program's libraries folder and using a MacAppMenuHandler class that I wrote to provide functionality for those items.
However, when I switched to Java 8, they no longer worked. I'm not sure what the issue is though reading other web sites today suggest a "permissions" issue in Java 8 regarding these files.
However, I solved the problem by copying the rt. jar from Java 7 into the program's libraries, and it has continued to work for me while continuing to develop under Java 8.
I suggest this as one possible solution to the problem.
Hope this helps.
Go on your project Properties and select the Java Build Path Libraries, your JRE System Library should have an Access rules field like the one displayed in the image
Hit the Edit button and add an access rule to allow access to the com.apple.eawt package.
I had the same problem with "pinch to zoom" - it works in java 6 but not 7 or 8. I came across this bug in the jdk which seems to be responsible. It says it is fixed in Java 9.

Java UI on macOS X Lion

I'm having a strange bug wich i suspect to be specific to either MacOS X Lion and/or Java VM implementation on this OS.
When a java app summons a secondary window like a dialog box, i'm often unable to interact with its content ie. click, use menus, etc.
At first i though my app was buggy but since i had developped it on windows (where it worked fine) and switched to mac. I though some weird swing setting was to blame and i had noticed on the console that a compatibility mode with cocoa was enabled when i launched my app.
But i encountered the same bug with eclipse itself (a well known java based ide) tough it does not always happen in it while it's all the time with my app.
I have browsed for this issue but found nothing. Meanwhile i found that there is an issue between oracle and apple about java. I downladed a java update specific to Lion but the bug is still here
My question is : have you encountered the same bug ? is it macos lion specific ? have you found a workaround ??
Thanks
Made some research. Eclipse seems to be the cause of the bug. More precisely SWT support in eclipse under MacOS environnement.
The bug is not present with netbeans.

Are debug enabled/compiled versions of the java class libraries still available

Background:
I'm trying to debug a problem with a swing application where I get a class cast exception in the standard boolean table renderer of JTable. I have the source code attached but don't see any of the values for the local variables or parameters. I assume this is because I'm not java libraries compiled with debug information turned on. I'm using eclipse on windows vista.
Things I've tried:
I've searched via google and on the oracle download site. There doesn't appear to be any obvious link to download a debug version of the libraries. There is one question on this site which links to an old java download site but this just redirects to the standard oracle one now.
Thanks
I have looked into this problem before. There are lots of debates about it but no real answer. You will find some stale links to some early-access beta versions of JDK6 that supposedly contain a DEBUG bundle with rt.jar compiled with local variables enabled, but I have never actually found anything.
Sorry, but re-compiling it yourself seems the only option for now.
Edit: There appears to be some progress on this. As this answer suggest, you can download the latest snapshot release which should have all jars compiled with relevant debugging info.

Netbeans IDE problem on MacOSX

I installed Netbeans IDE on Mac OS X few weeks ago. In the code-completion window while writing Java code, I always get the proper full list of possible code completions but in the window that pops-up which is supposed to display JDK documentation entry (all details) for each possible completion, it always say that JDK documentation was not found! It never happened to me when I worked on Windows.
I even downloaded and explicitly added JDK docs library to Netbeans library but to no use. Has anybody faced such problem? Please help! Thanks a lot in advance.
Well since nobody else answered and I had the same issue, but wasn't motivated enough to figure it out, I tracked down the way to do it... look here.
The only changes I did was to use the latest JavaDoc instead of the 1.5 one and to use Java Platforms in step 3 (I am using Netbeans 6.5, I guess the menu structure changed from when he did it).

Categories

Resources