Actually, I am working on project and specifications are :

  • using windows 7 ultimate
  • using Java language to develop project
  • using IntelliJ IDE for project

now, When i run my project it give me output in the section at the bottom in the IDE itself. But, i want my output in the text file. I don't know how to run that project from cmd of windows. I have asked in the chat also and searched google a lot. but me not getting answers. I have my project in C drive then i have folder "project1" then i have folders .idea, target, src and a xml file named as pom.xml. and also cbf-filter.iml file.

So, can you help me now that how can run my project from cmd so that i can get my output in a text file ? thanks in advance.

whether or not to get your output in a text file, has nothing to do with running your application from an IDE or from a command prompt.

the information you provide, has actually nothing to do with what you are asking for. you need to go over this. as the link 'll tell you, this is quite 'exxential' knowledge.

actually, instructions which course instructor has provided on website are :

*You can invoke the program using your IDE, or by running the script produced by mvn package. In most shells, you can redirect the output of the program into a text file:

/bin/sh target/bin/run-cbf U1 U2 U3 >unweighted.txt
This works on Windows as well; just run target\bin\run-cbf.bat. Redirecting your output in this fashion will just capture the program output; the logging output should still be displayed in your terminal.*

so, can you please tell what is he trying to say ? and how ? I am stucked on this from last 3 days. thanks if you can help me sir.

What's in run-cbf.bat? I don't recognise that as a standard Java JRE-installed file...

What people normally do is to export their project as a runnable jar (details for that vary from one IDE to another) then run that with java.exe (not javaw.exe which supresses the console output). java.exe sends your console output to the console window, but that can be redirected elsewhere with a >

@james sir , Can you elaborate more ? I am just a beginner in JAVA. am not much expert to understand that things easily. thanks.

I don't use IntelliJ, so I can't tell you how to do this in that particular IDE - you must look for some kind of "build" or "export" option that creates a "runnable jar". That's step 1.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.