Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7652123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:41:09+00:00 2026-05-31T11:41:09+00:00

I currently have a Maven application within Netbeans. Since I need to use regular

  • 0

I currently have a Maven application within Netbeans. Since I need to use regular expressions within my project, I added the following class to one of my packages : http://docs.oracle.com/javase/tutorial/essential/regex/test_harness.html

I changed all the Input/Output statements to use System.out and BufferedReader. When I run this class from a fresh project, the class works as expected. But when I add it to my Maven project, I can see no output after :

NetBeans: Executing ‘/usr/share/maven2/bin/mvn -Dexec.classpathScope=runtime -Dexec.args=-classpath %classpath MySource.RegexTestHarness -Dexec.executable=/home/gowri/jdk1.6.0_20/bin/java -Dnetbeans.execution=true process-classes org.codehaus.mojo:exec-maven-plugin:1.1.1:exec’
NetBeans: JAVA_HOME=/home/gowri/jdk1.6.0_20

Scanning for projects…


Building crawler4j
task-segment: [process-classes, org.codehaus.mojo:exec-maven-plugin:1.1.1:exec]


[enforcer:enforce]

[resources:resources]

Using ‘UTF-8’ encoding to copy filtered resources.

Copying 2 resources

[compiler:compile]

Compiling 1 source file to /home/gowri/WORKSPACE/yasserg-crawler4j-7b8bf91/target/classes

[exec:exec]

Could anyone please tell me why this is happening ? I made sure that this class is the only one with a main() function in it, and I click on “Run file” and not on “Run Project”.

Thank you 🙂

EDIT : I just realized something, when I convert all the System.out.print() statements to System.out.println(), only then can I see the correct output. Any ideas why ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:41:11+00:00Added an answer on May 31, 2026 at 11:41 am

    The problem seems to be the detached System.in or System.out from the Output window while using maven in Netbeans as pointed out in this issue. Try updating the exec-maven-plugin to 1.2 in the nbactions.xml file in your current Project directory, this bug has been solved in this newer version.

    To do that with UI, go to Project->Properties->Actions->
    In the action:
    Run File via main(),
    Change the excecute goals to something like this:
    “process-classes org.codehaus.mojo:exec-maven-plugin:1.2:exec”

    After doing so, your nbactions.xml should have an action tag which would look like:

        <action>
            <actionName>run.single.main</actionName>
            <goals>
                <goal>process-classes</goal>
                <goal>org.codehaus.mojo:exec-maven-plugin:1.2:exec</goal>
            </goals>
            <properties>
                <exec.classpathScope>${classPathScope}</exec.classpathScope>                
                <exec.args>-Djava.library.path="${project.build.directory}/lib" -classpath %classpath ${packageClassName}</exec.args>
                <exec.executable>java</exec.executable>
            </properties>
        </action>
        <action>
            <actionName>debug.single.main</actionName>
            <goals>
                <goal>process-classes</goal>
                <goal>org.codehaus.mojo:exec-maven-plugin:1.2:exec</goal>
            </goals>
            <properties>
                <exec.classpathScope>${classPathScope}</exec.classpathScope>
                <exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath ${packageClassName}</exec.args>
                <jpda.listen>true</jpda.listen>
                <jpda.stopclass>${packageClassName}</jpda.stopclass>
                <exec.executable>java</exec.executable>
            </properties>
        </action>  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently, I have a Maven project which inherits from a parent pom defining two
We currently have a big Maven 2 project that is rather a collection of
I have an application with many sub projects, currently I use maven2 to compile
I have a Flex/Java web application that uses Maven as a build tool. Currently,
I have a simple application using netbeans for developing and maven for building et
I am using Maven (3.x) to build an Android application within Hudson. I use
I am using Maven (3.x) to build an Android application within Hudson. I use
All, currently I have following maven projects all stored in svn: Common-Test v1.0                               ->
We have the following scenario with our project: A core web application packaged as
I currently have an MS Access application that connects to a PostgreSQL database via

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.