#IntelliJ and Terminal
33 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @frank mango! Please use
/closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 720 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
step 1: go to edit configuration
Step 2: click on + icon and add new shell script
step 3: configure it to your needs and select apply.
if you are using windows and need to open cmd you can use
Start-Process cmd.exe -ArgumentList "/k (your command) in script text.
and if its default maven project just add Start-Process cmd.exe -ArgumentList "/k mvn clean install -Dskip to your script text.
NOTE:
This command will be executed in IntelliJ terminal and the command will open cmd to run you script.
Oh thanks, shouldn't I have java MyMainClass.java in the script text or what
depends on your project
are you using maven, gradel or default java?
Gradle
i haven't use gradel so i am not 100% sure buti think this should work
Start-Process cmd.exe -ArgumentList "/k gradel run"
Just a quick question, when I did java MainClass.java manually in the terminal, it compiled instantly and the project started as fast as python's startup. But when I run it in IntelliJ, it takes way longer
Why is IntelliJ taking way too long
Is it the Build Process?
when you use intellij it compiles all you classes
using Java MainClass will NOT compile your class
But I think I can run the class directly, doesn't matter gradle or not
can you share your project structure?
java path/to/MainClass.java
What structure specifically
like the whole project directory.
Okay wait
It's not a production project, just a project that I do fun projects on like AI projects, algorithm visualizers, etc. so I will just show you the class that I want to run in the terminal
if java path/to/MainClass.java works for you its okay but to be sure this will not compile your code it will run your already compiled code.
and i am also not sure if you can use java with a .java file
It ran with the changes when I did java MainClass.java
Tho I want gradle to run for the dependencies
so replace the command with your gradel command.
It keeps saying Build Failed
so maybe there is problem with your gradel/project