Java Question error compiling

gorelshv

Member
Licensed User
Longtime User
this is my first try at building a library for b4a. it is a little code snippet that's suppose to set the volume of speakers to max.
when i tried to compile, it gave me an error about a symbol like in filippo's case here. so i made a package and now i get this massage:

B4X:
javac 1.6.0_21
src\com\SC2M\BennyG\main.java:193: package com.BennyG.BGaudio does not exist
public static com.BennyG.BGaudio.BGAudio _bgaudio = null;
                                ^
1 error
what am i doing wrong?
maybe it has something to do with the way i build the jar file. basically what i do is "jar cf bgaudio.jar bgaudio.java".
i've attached the library sources.
thanks.

EDIT: i was right. it was the way i build my jar file. what i did to fix it was to manually edit the file with the correct folders and files.
what is the right way to build a jar file? it is not described in the tutorial.
 
Last edited:

agraham

Expert
Licensed User
Longtime User
In Eclipse I select the package in the Package Explorer then do File -> Export ->Java -> Jar File -> Next and enter the "Export destination Jar file". You only need to do Next and edit the destination the first time for a package. The destination is remembered and you can then just do Finish instead of Next from then on until you change the package you are working on.

I think Erel does it differently using a batch file to zip the bin folder, save it as a jar and copy it to where he wants but I find the above just as simple.
 
Top