I have updated my Java recently and since then i can not press "run" (the green arrow) anymore.
I tried to reinstall Intellij but it did not work.
Try right-clicking within the file that contains a main method, and click "Run CLASSNAME.main()". That should generate a run configuration for the file that will let you use the green play button.
Related
I was programming a fabric minecraft mod in intellij and when I ran the code it said :
Could not find or load main class net.fabricmc.devlaunchinjector.Main
When I compiled the code and tried it in minecraft it worked, but in intellij i couldn't run it.
I was messing around with the files, to see if I can fix it and I found a solution :
Go to "Run Configuration", press the arrow to see the options and tap "Edit
Configurations"
Go to "Minecraft Client" and press the button next to
"net.fabricmc.devlaunchinjector.Main"
search trough your external libraries and find "net.fabricmc.devlauncherinjector.Main"
(it must be right under net.fabricmc-api...) select it, and after that you should see
the "Edit Configurations" window. Press "OK"
If this doesn't work, right click the file and select "Copy Full Path". Then go to
"Edit Configurations" window and paste it where it says
"net.fabricmc.devlauncherinjector.Main"
If the 2 option doesn't work either, close the project, copy the mod folder, and paste
it somewhere else(eg. Desktop, New Folder). And then open your IDE, go to open project
and select the copied folder. Press the "Build.gradle" file and select open as project
and "Trust" .It should now work. If it doesn't , unfortunately I don't know how to fix
it.
thecoopsyt's answer worked for me.
Go to Gradle tab > Reload All Gradle Projects
Wait a few mins for it to check and update your dependencies.
After this I was able to return to testing my project in Intellij... had to fully compile and test before this fix.
In Intellij gradle if
this doesn't work you can put
downloadAssets runClient into a gradle config and it will start a client and download the net.fabricmc.devlauncherinjector.Main
this allows you to use gradles built in Minecraft Client
After I have run a program usually I can run it again by clicking on the big icon. But not on one certain workspace I have. (When I open the tooltip the name of the program is displayed too but again not here). Does anyone know what happened to this workspace?
After clicking the icon this window just opens
Go into the preference window. Then go into Run/Debug -> Launching and check "Always launch the previously launched application"
I wrote some java code in Eclipse. When I run it, I see the output of another project (that I wrote before) in the console. How can I see the output of my new code?
Trying to guess your problem: When you press the Run as button (White arrow in green circle), Eclipse doesn't run the program you're editing. Instead, it runs again the last program you executed. That's the reason why you see the output of another project: You're telling Eclipse to repeat its execution.
So, to run your new app, right click over the code and select Run as/Java application.
Right click your project in the project explorer. And then this menu will pop up:
Click Run As > Java Application
I have installed the CodePro AnalytiX 3.7 plugin in my Eclipse Juno.
From then in any of the Java TestCase classes the keyboard shortcuts of the cut/copy/paste are not working.
Also the delete is not happening when I press the "delete" button on the keyboard.
The same works fine if I right click and select the operation from the menu.
In normal Java classes it works fine.
Please help.
I have faced the same problem, as #Pragnani said the reason behind this is because of notepad. my notepad becomes not responding that's why copy paste not worked for me....when I restart my system. every thing goes well..
SDK and ADT are installed and working, but when I run some android code, the "Run As" panel is empty. I need to go to Run configuration, click on Android application, make a copy, put the name of my project on the copy and the run it. Then it run properly on the emulator. How can I add the "android application" item menu inside the run as menu?
You could Right Mouse Button Click(on activity class) > Run As > Run Configurations. Next is Right Mouse Button Click on Android Application > New. Now you should add your virtual emulator in Target. It works in my version of IDE.
Now you can use this run configurations with your own settings.
"Run as Android application" is available if u run the project (right click project name and u have that option) , and not a specific activity file ..
Just select Run > Run in eclipse and select android application.The Eclipse plugin automatically creates a new run configuration for your project and then launches the Android Emulator.
Maybe this is a bit late to be answering this, but I think my answer is better. The right click is all fine and well, but it is a bit more effort each time than my suggestion.
Right click on the toolbar and click "Customise Perspective..."
On the toolbar structure that pops up find "Launch" (On mine it's the 5th item down - it might vary)
Then you need to tick the "Run " box
After you click "OK" it should be back in the toolbar and in the menu