Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Executable JAR with reource structure.(Java Executable JAR)
Executable JAR with reource structure. [message #1171551] Tue, 05 November 2013 10:01 Go to next message
Ricardo Wagemaker is currently offline Ricardo WagemakerFriend
Messages: 1
Registered: November 2013
Junior Member
Hello,

I was wondering if someone can help as I am going around in circles.

I have my project folder with working appllication it includes 2 resources folders /res - (images)
/audio - (audio files)

The application works perfectly inside Eclipse, I can also run it from command line without any problem.

When I create a executable jar file, I notice 2 things.

1) the structure inside the jar no longer exist it has put everything in / (classes, images & audio files)
2) the audio files can not be found, I tested with println(); and added the audio files call() every way I know calling it in /file.wav, /audio/file.wav, audio/file.wav, file.wav

The problem is it always say (file not found) but it runs fine in eclipse and command line calling the class.

How can I create a executable jar that maintain the structure and it works.

Many Thanks
Re: Executable JAR with reource structure. [message #1226849 is a reply to message #1171551] Thu, 02 January 2014 22:24 Go to previous message
Rene Bajarias is currently offline Rene BajariasFriend
Messages: 1
Registered: January 2014
Location: Cleveland
Junior Member
Ricardo,

I don't think you provided any code snippets, so I would presume you are using Sun's AudioPlayer and AudioStream classes to play a WAV file. I would suggest using a different (and shorter) method of playing a WAV file. The Applet class has a static method called newAudioClip() that takes a URL as its argument which can then be played, like so:

Applet.newAudioClip(this.getClass().getResource("RicardoWaveFile.wav")).play();

The above line is all you should need to play a WAV file.

Thanks.


Rene Bajarias
Previous Topic:How does Eclipse load /usr/lib64/IcedTeaPlugin.so ?
Next Topic:Log4j calls
Goto Forum:
  


Current Time: Fri Apr 19 14:21:43 GMT 2024

Powered by FUDForum. Page generated in 0.02946 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top