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 3974436
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:34:05+00:00 2026-05-20T04:34:05+00:00

I tried to import my ant script. And it successful. But when i compile

  • 0

I tried to import my ant script. And it successful. But when i compile it. I got this error:

run-selected-file-in-src:
java.io.FileNotFoundException: ..\sounds\voice.wav (The system cannot find the path specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at com.sun.media.sound.WaveFileReader.getAudioInputStream(WaveFileReader.java:205)
        at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1162)
        at SimpleSoundPlayer.<init>(SimpleSoundPlayer.java:35)
        at SimpleSoundPlayer.main(SimpleSoundPlayer.java:12)
Exception in thread "main" java.lang.NullPointerException
        at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:89)
        at SimpleSoundPlayer.main(SimpleSoundPlayer.java:16)
D:\Windows\My Document\Latihan\Java\allsrc\ch04src\nbproject\ide-file-targets.xml:7: Java returned: 1
BUILD FAILED (total time: 0 seconds)

This is my folder structure

root
+-build(all *.class store here)
+-images
+-nbproject(netbeans create it)
+-sounds(voice.wav where i want to load)
+-src(all *.java - When i compile. All *.class will store to "build" folder)
+-build.xml

My question is why the class file(SimpleSoundPlayer.class) didn’t find “..\sounds\voice.wav”. But when i tried it from command-line “java SimpleSoundPlayer” it fine.

Why this happen?

  • 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-20T04:34:05+00:00Added an answer on May 20, 2026 at 4:34 am

    I FIGURE IT OUT!!!
    Special Thx to “JB Nizet”. Because him i know why it didn’t find the wav file. So i just search how to change the default location(this case in root) netbeans to compile(I want netbeans to compile from “build” folder).

    The key is in nbproject/ide-file-target.xml

    root
    +-build(all *.class store here)
    +-images
    +-nbproject(netbeans create it)
    +-sounds(voice.wav where i want to load)
    +-src(all *.java - When i compile. All *.class will store to "build" folder)
    +-build.xml
    
    <?xml version="1.0" encoding="UTF-8"?>
    <project basedir="../build" name="chap04 - Sound Effects and Music-IDE">
        <!-- TODO: edit the following target according to your needs -->
        <!-- (more info: http://www.netbeans.org/kb/41/freeform-config.html#runsingle) -->
        <target name="run-selected-file-in-src">
            <fail unless="run.class">Must set property 'run.class'</fail>
            <java classname="${run.class}" failonerror="true" fork="true">
                <classpath>
                    <pathelement path="build"/>
                    <pathelement location="."/>
                </classpath>
            </java>
        </target>
    

    So i just change on <project basedir=".." to <project basediir="../build" where i want netbeans to compile. With this change netbeans will compile that file in “build” folder. AND… WOWWW… That file run correctly 😀

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've seen some code such as: out.println(print something); I tried import java.lang.System; but it's
I tried to do that, and I found this errors: >>> import re >>>
Tried this: $('.link').click(function(e) { $.getScript('http://www.google.com/uds/api?file=uds.js&amp;v=1.0', function() { $('body').append('<p>GOOGLE API (UDS) is loaded</p>'); }); return
I tried compile apache 2.2, my Visual Studio 2008 returned error on RC. After
I've been trying to invoke D3 within Node.js. I tried firstly to import d3.v2.js
I've tried every combination to import binary data for Mongo and I CANNOT get
I cannot import a maven project with WTP features enabled. I have already tried:
How does string.join resolve? I tried using it as below: import string list_of_str =
I have tried the following code but has no effect: Imports system.Runtime.InteropServices <DllImport(UxTheme.DLL, BestFitMapping:=False,
Tried a bunch of things but I can't get it to work consistently amid

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.