I am using IntelliJ IDEA 2017.1.4 as my IDE. Recently I have found a plugin called ASM Bytecode Outline which is actually what I've dreamed of. I need such plugin so that I can convert Java code to ASM code or to bytecode easily.
I have installed the following plugin and restarted my IDE. Then I was expecting to be happy, however I was disappointed because the plugin seems not working:
Simply nothing.
I have tried the following:
Recompile and rebuild the project.
Restart IntelliJ.
Reinstall the plugin.
Restart my PC.
However, as you see me asking here now, you can guess that none from what I tried has worked, sadly. I clearly understand that the plugin might be pretty old and was not updated for years, but I still need at least something similar that can convert Java code to ASM-ready code, like:
.
Is there a way I can solve this, or is there any other similar solution (not required to be an IntelliJ plugin) for what I want?
I updated the plugin and now it works fine with newer versions of Intellij IDEA.
You can download it from here: https://plugins.jetbrains.com/plugin/10302-asm-bytecode-viewer
The source code can be found in here: https://github.com/elitegit/asm-intellij-plugin
It includes the latest version of ASM library as well.
You can use the plugin in 3 different ways:
Right click somewhere inside the code editor and choose "Show
Bytecode Viewer"
In the "Code" menu, choose "Show Bytecode
Viewer"
Right click on the java file in the Project window and
choose "Show Bytecode Viewer"
You can find the setting inside Settings => Tools => "Show Bytecode Viewer"
ASM Bytecode Outline isn't compatible with IntelliJ 2017.1.4. The last time this plugin was updated was September 2015. Here's a link to the plugin page on JetBrains' website: you can see that it stopped being compatible in IntelliJ 14.
Alternative
A built-in bytecode viewer has been available in IntelliJ for a while. Use the menu View -> Show Bytecode to view the bytecode for one of your classes. See this link for more details.
Related
I'm currently following this tutorial: https://openjfx.io/openjfx-docs/ (JavaFX and IntelliJ IDEA). I use Intellij 2021.3.2.
I have created a project (1. Create a JavaFX project), which worked out great and didn't need to 2. Set JDK 16 because it was already set to 17 (which I guess is fine).
But here begin the weird stuff (and I'm very new to programming so I'm sorry if it sounds silly). "You can also set the language level to 11 or greater." I don't have this option. Because it's "can" I felt like it wasn't a big deal but if someone can explain what this is all about? Just out of curiosity, because I'm at the very beginning of the tutorial and I kinda only understand half of it.
Then 3. Create a library, and I don't have what they have, and my stuff is red:
So when they said "add the JavaFX 17 SDK as a library to the project" I didn't know what to do. I also didn't know what to do to fix the red stuff.
And finally, they say "Warning: If you run now the project it will compile but you will get this error: ..." but if I click on this button
everything works! which you know i'm not complaining about but I would like to understand a bit more what is happening.
And then they suggest I should 4. Add VM options to fix the problem that I don't have. So I figured maybe my computer set the VM options correctly without me knowing it but there is currently no VM option (and it works). Should I add them nonetheless?
Thank you for your help, I'm very lost and feel like I don't really understand anything.
The current documentation in the openjfx tutorial for getting started with JavaFX using Idea is incorrect, at least for recent Idea releases (2021.3 +).
The tutorial is written as though a new Java project was created, rather than a new JavaFX project. Once a new JavaFX project has been created, most of the rest of the steps in the tutorial are either redundant or wrong.
Step 1, “Create a JavaFX project", does a lot more than just “Create a Java project”, which is why everything else is different from the tutorial.
A better tutorial for getting started with JavaFX with Idea, is the official Idea documentation:
Create a new JavaFX project.
Differences between creating a new Java project and creating a new JavaFX project
The new JavaFX project:
Provides a build script for Maven (pom.xml) or Gradle (build.gradle).
Adds the appropriate dependencies for JavaFX base, graphics, controls and fxml.
Provides an example application and controller code that you can run immediately.
The example project is modular and provides a module-info.java
Because the program is modular and dependencies are downloaded via maven and recognized by the IDE, you don’t need to manually configure VM runtime options for the module path and adding modules.
Idea will recognize the Maven or Gradle projects and automatically synchronize the initial transitive dependent libraries with the Idea project.
There are options in the Idea Maven tool window which will allow you to synchronize further changes to dependent libraries or javadoc and source code in libraries.
Selects a JDK and attaches it to the project, automatically downloading the selected JDK version if not already present.
Sets an appropriate language level for the project.
When you just use the create new Java Project option, it doesn’t do any of those things, so you need to do things manually instead, which is what the rest of that tutorial is about:
Manually download the JDK and configure it in the SDK.
Manually download the JavaFX SDK and add the libraries from it to your project.
Manually configure VM modular arguments.
Manually maintain any other dependencies.
Manually associate javadoc and source code.
Manually write the code for a basic application.
Manually set the project language level.
Doing all this stuff manually is more work and more error prone. The manual work usually leads to a worse outcome and a project that is more difficult to maintain for many people getting started with JavaFX, so I do not recommend it.
Versions
In terms of the versions to use, I recommend using the most recent stable (non-beta) releases of both JDK and JavaFX, regardless of what versions may be referenced in any tutorials you may be using.
You can set JavaFX versions in the Maven file generated by the new JavaFX project wizard, then press the button in the Maven Tool window to synchronize the Maven project with the Idea project.
Language level settings
These are important later on, but pretty irrelevant when just getting started.
The language level settings:
Tell the compiler what version of the java byte code to compile the application to.
Tell the IDE what language syntax rules to enforce and provide help with.
If you use Java 17 only features, the app won’t run on a Java 11 VM.
You can define the settings in Idea manually:
language setting level.
But it is better to set them in the compiler section of the maven project and synchronize the project with Idea, which will also configure the settings in the IDE.
IMO, set it to the most recent stable version and have a requirement that your application be run with that Java version as a minimum (you can enforce that by using jlink or jpackage to bundle the JRE version you choose with your packaged app).
The following message pops up when I try to use the content assist command (Ctrl+Space) after I installed the WindowBuilder plug-in :
"The 'API Tools Javadoc Proposals' proposal from computer from the 'org.eclipse.pde.api.tools.ui' plug-in did not complete normally..."
I already tried to de-select the API Tools Javadoc Proposals on Content Assist, as the program sugests, but still did not work. I also tried to select all the Java Proposals, tried to change the Key and nothing worked. I need to use this plug-in for a important project. Does anybody know what can I do?
PS: I never had this problem with Eclipse before, I uninstalled and installed the Window Builder plug-in to see what would happen, and the problem is definitely related to Window Builder.
Installing an older version of Eclipse could work, and indeed it does.
I've installed Eclipse 2018-12 and the latest official (NOT prerelease) Window Builder version from the Eclipse Marketplace. Now the content assistant works fine.
IMPORTANT: You can have more than one Eclipse installation at the same time on your computer, as long as it is in a different folder. That's how I did it at least. Bad thing is, that you'll probably need another workspace separate from your everyday workspace, just for the Eclipse 2018-12 installation.
I'm new member for IntelliJ. I am trying to install a plugin for Cucumber in IntelliJ IDE.
Following are the steps which I am trying:
File > Settings (Ctrl+Alt+S)
From left hand pane, landing on Plugins tab.
In Search box, I am trying to search "Cucumber for Java".
But no result is displaying for same.
Can anyone help me on this ?
On search I am not able to see the option Cucumber for java, which is visible here in given stack.
Please see the documentation.
Use the Browse Repositories button.
Cucumber for Java plug-in is available out of the box in IntelliJ IDEA Ultimate.
For IntelliJ IDEA Community edition it's available as a free plug-in that you need to install:
In case IDE doesn't see the plugins list, please check the proxy settings. Disabling this option may also help.
It's also possible to download install plugins manually from disk. Make sure to get the version which is compatible with your IntelliJ IDEA build.
Cucumber for Java can be downloaded here.
The version compatible with IntelliJ IDEA 2018.1.x is available by this link.
Please also note that there is no Cucumber for Java plug-in version that is compatible with IntelliJ IDEA 2018.2 EAP builds at the moment. If you need this plug-in, please use 2018.1.4 release version.
I've installed the version 2018.1 of IntelliJ IDEA (COMMUNITY EDITION), which added support for Java 10.
When I tried to use new "var" to type local variable, the IDE highlights it with red colour and the lovely phrase: "Cannot resolve the type "var". Please see attachment
varRed
I've read another post that happens exactly the same issue in which a member gave a possible solution https://stackoverflow.com/a/49719734/9478809
I've done that as well, I've created a live template for that type for Java statement but it still doesn't work.
Some of you got any suggestion for that?
I will appreciate your help
Thanks in advance.
To expand on nullpointer's comment, there are a few things you need to verify:
Make sure you've downloaded an updated SDK (version 10 or higher). I recommend using sdkman to install the SDK because it helps manage multiple versions. SDKMAN
Hit cmd; to open Project Structure
For Project SDK, select your updated java SDK
For Project language level, select the corresponding level
Now navigate to Modules, and make sure the correct language level is selected here too. I recommend selecting "Project default" to avoid future confusion.
As a troubleshooting step, it's also helpful to compile on the command line with maven or gradle to make sure it is an IDE configuration issue.
I've been looking into scala lately and from the conciseness and language features I'm completely thrilled.
I have netbeans 8.0 running on ubuntu 12.04 and downloaded scala, edited netbeans.conf (netbeans_default_options="-J-Dscala.home=...), installed plugins from plugin manager inside netbeans (ALL OF THEM). Then, I created scala project (not maven one) and tried out autocomplete. It works, compiles, runs, however, it shows no document found in autocompletion.
This is how I added javadocs Tools > Scala platforms > javadoc tab
I tried adding following ways:
added the entire scala api doc zip from http://downloads.typesafe.com/scala/2.11.2/scala-docs-2.11.2.zip
extracted the previous zip to scala-home folder under $SCALA_HOME/docs/javadocs/scala-docs-2.11.2 and added that
same as 2 but added $SCALA_HOME/docs/javadocs/scala-docs-2.11.2/api in netbeans
None of these pick up documentation! Of course, I could live without it, but it's such a killer for such a concise language where I could just find out stuff instantly from autocompletion. Also, I don't want to use eclipse special ide for scala because I don't want to throw out all the experience with netbeans out of the window and learn new IDE.
P.S. - Netbeans navigator also seem not to work in scala.
And I wonder why there's so little content on google for such a wonderful language?
There is no need to change to IntelliJ. Use the right build tool -sbt or Maven- and everything works fine.
In Netbeans you can use e.g. free Application Servers.
Netbeans support for scala seems pathetic so I just decided to jump to IntelliJ IDEA. It was little bit of learning curve but I'm glad I did because now everything was working (autocomplete, documentation, awesome SBT support etc. etc.)