Tux Guitar

Problems

Subject Using Eclipse to build and run TuxGuitar



Author Message
Hartley Mays
Post: Apr 15th 2007 at 9:16 AM

Hello,

I'm trying to build and run TuxGuitar using Eclipse 3.3 on Windows XP. I'm able to build it successfully, but when I run, I get this exception:

java.util.MissingResourceException: Can't find bundle for base name lang.messages, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at org.herac.tuxguitar.gui.system.language.LanguageManager.setLanguage(LanguageManager.java:32)
at org.herac.tuxguitar.gui.TuxGuitar.initLanguage(TuxGuitar.java:137)
at org.herac.tuxguitar.gui.TuxGuitar.displayGUI(TuxGuitar.java:147)
at org.herac.tuxguitar.gui.TuxGuitar.main(TuxGuitar.java:120)
Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-3232 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)
at org.eclipse.swt.internal.win32.OS.(OS.java:18)
at org.eclipse.swt.widgets.Display.(Display.java:125)
at org.herac.tuxguitar.gui.TuxGuitar.displayGUI(TuxGuitar.java:148)
at org.herac.tuxguitar.gui.TuxGuitar.main(TuxGuitar.java:120)

Can you please advise what I need to do to get past this?

Thanks,
Hartley


Back to Top
 
Julian
Post: Apr 15th 2007 at 1:32 PM

Hi, there are 2 exceptions here...

java.util.MissingResourceException:
the app, can't find "share/lang" folder..
"share" must be at classpath. i think you don't have it.

java.lang.UnsatisfiedLinkError:
this is because, SWT can't find native libraries.
SWT needs know where are the native libraries (*.dll under win)
you can set a java property: -Djava.library.path=/where_are_swt_libraries

or you can download the current devel version of SWT, what include the native libraries into the swt.jar. so library path is not needed.


Back to Top
 
Hartley Mays
Post: Apr 15th 2007 at 4:07 PM

Thanks for the quick response, but I'm not clear on what to do in Eclipse to fix the two problems.

My version of Eclipse appears to have SWT built into it; it shows up in the plugin list, the dll's are in Eclipse folders, and I'm launching Tux Guitar as an SWT application. Also, I don't see where to add other files besides jars and source into a project so that the Lang option works properly.

I'm able to run the Windows standlone version with no problems after using the Windows installer, but I would like to get it running in Eclipse to adventure into the source code.

Hartley


Back to Top
 
Julian
Post: Apr 15th 2007 at 6:01 PM

Hi,

to add "share" to the classpath under eclipse, you only should do this:
Right click menu: "Build Path -> Use as source folder"

to add swt library path: open "Project -> properties" menu.
then select "Java Build Path" (at left) and "Libraries" tag.
you should see a tree item "swt.jar".. expand it and click where is "Native Library Location", then push "edit"

Other way, is adding "-Djava.library.path=/path_to_libraries" at "Arguments -> VM Arguments" of eclipse "Run" dialog.


Back to Top
 
Hartley Mays
Post: Apr 15th 2007 at 8:32 PM

Well, we're making progress. The SWT exception is fixed, and the TuxGuitar window opens now. I tried several different things adding the SHARE folder as a new one under SRC and then doing the Build Path. I did this using the Advanced Link option to link to the copy of the Share folder created by the native windows install in Program Files. At this point, I no longer see any console messages on the Eclipse console, and although the Tux window opens, none of the icons are present, just placeholders for them.

So it almost works, but there's still a problem with the Share folder.

Thanks again for the quick responses,
Hartley


Back to Top
 
Julian
Post: Apr 15th 2007 at 8:52 PM

Check your ecplise binary output..
on my config, i have "share" as source folder, but eclipse move only the share content to binary folder.
so i have "bin" folder at classpath, and on that folder "org, lang, scales, bla bla"


Back to Top
 
Hartley Mays
Post: Apr 16th 2007 at 4:03 PM

I tried experimenting more with this yesterday, and will resume on it at homr this evening. In the meantime, let me ask the question this way. The Share folder is not currently included in the source tar file, but is included in the Windows Install. If it was included in the source file structure, what level of the file heirarchy should it be at relative to the src file directory?

Thanks,
Hartley


Back to Top
 
Julian
Post: Apr 16th 2007 at 4:36 PM

>The Share folder is not currently included in the source
>tar file, but is included in the Windows Install
why do you say "share" is not included ?
if you download and uncompres "TuxGuitar-0.9.1-src.tar.gz" you will see "src,doc,share" folders and some build* files.

>what level of the file heirarchy should it be at relative
>to the src file directory?
there is no level. that's why share is at "CLASSPATH", you can move "share" where you want, but the URL of that folder must be at classpath..
take a look to the tuxguitar.bat file of windows version:
"-cp ;TuxGuitar.jar;libswt.jar;libitext-1.4.2.jar;share"
-cp = CLASSPATH
; = CLASSPATH separator.

also you can take a look to "tuxguitar.lap" file (its used to launch the app with tuxguitar.exe under janel project)

can you show me the list of files at your "tuxguitar" project under eclipse ?


Back to Top
 
Hartley Mays
Post: Apr 16th 2007 at 9:31 PM

I must have done something wrong from the beginning in terms of how I created the Eclipse project for this to be so difficult. You are corerct that the Share folder is part of the source tar file. However, whatever I tried in terms of adding it to the project source did not seem to have any affect. There don't appear to be any references to it in the bin directory of the project.

Based on your discussion about how the Share folder is supposed to be on the classpath, I took a look at the run options I had set up. From the run menu item, I selected run..., then the launch configuration I had previously saved to use to execute the project. I went to the classpath tab, and selected the User Entries, then the Advanced button. The lib option there didn't help, but then I tried the Folder option, and selected the Share folder. And it worked...!!!

So thanks again for the help and quick responses. I look forward to using your very interesting project and hopefully contributing to the community participation.

Hartley


Back to Top
 
Sairam Impiger
Post: May 17th 2007 at 10:02 AM

I had the same
Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-3232 in java.library.path

But when I changed the following it worked @!!

Window / Preferences / Plug-in development / Target Platform / Plug-ins list

Here deselect the swt libraries unapplicable for our development environment

Hope it was useful


Back to Top
 
Peter
Post: Jul 3rd 2008 at 8:36 AM

Hola!

I am also trying to build TuxGuitar 1.0 using the latest version of Eclipse in Windows XP. So I created a new java project from all the source codes I have downloaded and extracted.

But there were errors, so I pasted to tuxGuitar/lib the itext.jar and org.eclipse.swt*.jar to that folder (correct me if I have not done it properly), and I did Project->Properties and added these jar files to the build path. So the errors were now gone! But there were still warnings (List, ListArray() and the like), but because they are just warnings, I just neglected them...

So, I tried to run TGMain class as an application using Eclipse, but the images (icons on the buttons) won't show, and I can open files which are only *.tg, and the *.gp# files cannot be opened. There were also no sounds produced as I play and input notes. The console also indicates that there is no sound produced. Other options which are actually found on an installed TuxGuitar program are missing.

I guess it just so happened because I run the program using an IDE. I then tried to export the project (right-click the project folder on the project explorer view ->export to jar. But the exporting won't finish because of some warnings.

Any corrections on the process I did? Thank you.


Back to Top
 
Johnny
Post: Jul 3rd 2008 at 6:43 PM

You need to include "share" folder as Source path (as said in Wiki here), it doesn't see skins, plugins etc.


Back to Top
 
Anonymous
Post: Jul 3rd 2008 at 11:05 PM

> But there were still warnings (List, ListArray() and the like)
This is because "generic types" ( List list = new ArrayList(); )
tuxguitar is using the jre1.4 specification (where anotations don't exist. so if you want hide the warnings you should tell eclipse build tuxguitar with 1.4 class version.
Or, just edit Errors/Warnings and tell eclipse ingnore generic types.

As Johnny told, you need to add "share" to classpath.
note that plugins (sound, fileformat, etc) are located on share/plugins And then tuxguitar dynamically load them.

But if you installed the sources without prebuilded plugins, you'll need to build all plugins yourself:
e.g: TuxGuitar-gtp(is the gtp, gp3,gp4,gp5 fileformat plugin) classes or jar should be at share/plugins ( or at classpath ) with the META-INF/services/plugin_package.PluginInterace file.


Back to Top
 
Peter
Post: Jul 4th 2008 at 12:12 AM

Thank you guys for the replies, but I don't know how to do them. Can you tell me the processes?

>You need to include "share" folder as Source path (as said in Wiki here), it doesn't see skins, plugins etc.
How can I include that folder as a source path?


Back to Top
 
Johnny
Post: Jul 4th 2008 at 10:03 AM

http://tuxguitar.com.ar/tgwiki/doku.php?id=doc:eclipse_import

You should really read help, especially when instructed to.

About /share/plugins folder, don't bother to compile them, just copy from your TuxGuitar installation.


Back to Top
 
Peter
Post: Jul 15th 2008 at 10:40 AM

Hi. Thank you for that response.
I already have the icons present. But sounds are still missing. I tried to look for sound options in the tools menu but there is none listed on the Midi port.
I also could not open guitar pro files even if Tuxguitar-gtp folder is already listed on the Project Explorer.

How can I correct these? Thank you.


Back to Top
 
Johnny
Post: Jul 15th 2008 at 11:06 AM

I guess you added ./share folder to Build path. When loading, tuxguitar looks for jar files in share/plugins folder and loads them.

So you maybe don't have those jar files (you need tuxguitar-alsa.jar and tuxguitar-gtp.jar for your current problems), you didn't add share folder properly, or your share folder isn't complete.


Back to Top
 
Peter
Post: Jul 15th 2008 at 12:05 PM

>So you maybe don't have those jar files (you need tuxguitar-alsa.jar and tuxguitar-gtp.jar for your current problems),

Isn't alsa - Advanced Linux Sound Architecture? I am using windows... I'm confused.
----------------------------------------------------------
> you didn't add share folder properly, or your share folder isn't complete.

I actually used "share" as a source folder. So, with this current problem, I think my share folder isn't complete...
But the source codes I have downloaded is TuxGuitar 1.0. Isn't this release of source codes complete with all the necessary files?

=)

Thanks by the way for the quick reply.


Back to Top
 
Julian
Post: Jul 15th 2008 at 1:03 PM

if you are under windows, make sure
tuxguitar-jsa.jar (java sound api) is at plugins folder

> Isn't this release of source codes complete with all the necessary files?
TuxGuitar + All plugins are at downloadable source package.


Back to Top
 
Peter
Post: Jul 17th 2008 at 11:19 AM

>if you are under windows, make sure
tuxguitar-jsa.jar (java sound api) is at plugins folder

I cannot find *.jar files from my extracted download on tuxguitar1.0-src.tar.gz...

Do I have to export tuxguitar-jsa(source code folder which is included in the .tar.gz) to a jar file?

thanks =)


Back to Top
 
Julian
Post: Jul 17th 2008 at 11:39 AM

tuxguitar1.0-src.tar.gz is a source package. so no prebuilded plugins ( tuxguitar-*.jar ) are available.

to get "tuxguitar-jsa.jar" you'll need first build that plugin.
On tuxguitar-1.0-src/TuxGuitar-jsa/ there are the sources of that plugin.

So go to that folder, make sure build.properties is configured right, and exec ant.
then tuxguitar-jsa.jar will be generated and you'll able to install it as plugin.

Note that "ant" build the classes, but also generate a "META-INF/services/org.herac.tuxguitar.gui.system.plugins.TGPlugin" file needed by tuxguitar.
so if you'll build it without "ant" you should manually make that file (text/plain) and add this line:
org.herac.tuxguitar.player.impl.jsa.MidiPluginList

It tells tuxguitar that "org.herac.tuxguitar.player.impl.jsa.MidiPluginList" class implements the "org.herac.tuxguitar.gui.system.plugins.TGPlugin" interface.

Without that the plugin will not work.


Back to Top