9 Replies - 1933 Views - Last Post: 14 March 2009 - 07:49 PM Rate Topic: -----

#1 cs@cuboulder  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 11-March 09

Ourtunes Source Code Compiling Problems

Post icon  Posted 11 March 2009 - 11:27 AM

Hello:

I wanted to download and compile Ourtunes Source

I have downloaded the file opened it and added the code to a "new project" in Netbeans. However, on running a compile with the "GUI.class" I receive numerous errors to the effect of "cannot find symbol" within one of the library's'

If anyone has worked with this source code before, or something similar. I am getting reacquainted to Java and wanted to look through this code to discover how it works with various features but I'm kind of discouraged not being able to compile and run it at least once and practice modifying things.

The read me file refers to "GUI.class" as the default class, and I selected this in Netbeans when I went to compile but it didn't not seem to find the JmDNS that is located in the file as well... Any further explanation would be helpful!

Thanks in advance--

*Edited so I can remove my sun glasses

This post has been edited by pbl: 11 March 2009 - 06:00 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Ourtunes Source Code Compiling Problems

#2 Locke  Icon User is offline

  • Sarcasm Extraordinaire!
  • member icon

Reputation: 520
  • View blog
  • Posts: 5,596
  • Joined: 20-March 08

Re: Ourtunes Source Code Compiling Problems

Posted 11 March 2009 - 11:29 AM

You did import the specific packages/classes you needed right? (the only reason I ask is because I've forgotten this many times -_-)

This post has been edited by Locke: 11 March 2009 - 11:30 AM

Was This Post Helpful? 0
  • +
  • -

#3 cs@cuboulder  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 11-March 09

Re: Ourtunes Source Code Compiling Problems

Posted 11 March 2009 - 11:53 AM

View PostLocke, on 11 Mar, 2009 - 10:29 AM, said:

You did import the specific packages/classes you needed right? (the only reason I ask is because I've forgotten this many times -_-)



Hi lock--

Ok, this might be my issue, I'm much more used to using say C/C++ where the #includes perform most of the library importing. I created the new project in Netbeans (which I'm also new at...), I dragged and dropped all of the files from the .jar file I downloaded into the "source" folder for the project.

At the top of the "GUI.java" file I have:

package ourtunes.gui;

import javax.swing.*;
import javax.swing.border.*;
import javax.jmdns.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Properties;

import ourtunes.net.*;
import ourtunes.Shared;
import ourtunes.os.OS;

which I believed was all the library imports I need, although I see jmdns as a "sub-scope" of sorts, in the source folder it is also a .java file that isn't inside a subdirectory. This "JmDNS" is the source of most of my "cannot find..." errors is it not being/not being correctly imported here?

Does Netbeans have a function to manually add the library I need to this project other than the "drag-and-drop" way I just described, or should I add some sort of "import" call here?

Thanks!

This post has been edited by pbl: 12 March 2009 - 05:07 PM

Was This Post Helpful? 0
  • +
  • -

#4 cs@cuboulder  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 11-March 09

Re: Ourtunes Source Code Compiling Problems

Posted 11 March 2009 - 12:00 PM

Ok, I found the JmDNS.java, it was placed in a "<default package>" folder under Source Packages in Netbeans. This was probably because it was located in the root-folder of the files I dragged and dropped into my project. Still, the compiler is not finding it though ... :angry:

This post has been edited by cs@cuboulder: 11 March 2009 - 12:01 PM

Was This Post Helpful? 0
  • +
  • -

#5 BigAnt  Icon User is offline

  • May Your Swords Stay Sharp
  • member icon

Reputation: 101
  • View blog
  • Posts: 2,392
  • Joined: 16-August 08

Re: Ourtunes Source Code Compiling Problems

Posted 11 March 2009 - 12:02 PM

Quote

I dragged and dropped all of the files from the .jar file I downloaded into the "source" folder for the project.


Why did you do this, just add the jar file to your build path and you can use it that way, no unzipping, removing files from jar or anything, which can screw up the package structures easily.
Was This Post Helpful? 0
  • +
  • -

#6 Locke  Icon User is offline

  • Sarcasm Extraordinaire!
  • member icon

Reputation: 520
  • View blog
  • Posts: 5,596
  • Joined: 20-March 08

Re: Ourtunes Source Code Compiling Problems

Posted 11 March 2009 - 12:04 PM

Please don't post in outrageously large fonts. It gets difficult to read.

With my vast (not really) knowledge of NetBeans, I don't know how to add a jar file to the project.

I do know how to do it in Eclipse. :)
Was This Post Helpful? 0
  • +
  • -

#7 cs@cuboulder  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 11-March 09

Re: Ourtunes Source Code Compiling Problems

Posted 11 March 2009 - 12:52 PM

View PostBigAnt, on 11 Mar, 2009 - 11:02 AM, said:

Quote

I dragged and dropped all of the files from the .jar file I downloaded into the "source" folder for the project.


Why did you do this, just add the jar file to your build path and you can use it that way, no unzipping, removing files from jar or anything, which can screw up the package structures easily.


Sorry about the font.

Ok, BigAnt, I see what your talking about -- Ill give this a shot in Netbeans. This would make sense why they packaged it this way.

If I can't figure out how to "add to build path" and get a compiled running version, Ill post again...!

Thanks!
Was This Post Helpful? 0
  • +
  • -

#8 cs@cuboulder  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 11-March 09

Re: Ourtunes Source Code Compiling Problems

Posted 11 March 2009 - 08:37 PM

Ok, still no luck:

having downloaded the .jar file:

Netbeans, I chose to create a new project from source code, and after expanding the .jar file to a directory set that directory as my project source code folder.

I was than prompted to delete all compiled classes (which I did)

Once the project was created, I ran the compiler and still received similar problems with missing private classes.

Is it possible I am still not properly importing everything so that the compiler can find it? Does anyone know of a way to "directly" import the .jar file into a project without expanding it first and using the directory I expanded it to as the source folder.

Thanks for all the help! I'm really looking forward to getting this guy running!
Was This Post Helpful? 0
  • +
  • -

#9 BigAnt  Icon User is offline

  • May Your Swords Stay Sharp
  • member icon

Reputation: 101
  • View blog
  • Posts: 2,392
  • Joined: 16-August 08

Re: Ourtunes Source Code Compiling Problems

Posted 12 March 2009 - 07:38 AM

Never used net beans but a quick google turned these as the top 2 for adding external jar's in Netbeans:

http://www.lampos.net/?q=node/166
http://www.jguru.com...jsp?EID=1303995
Was This Post Helpful? 0
  • +
  • -

#10 cs@cuboulder  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 11-March 09

Re: Ourtunes Source Code Compiling Problems

Posted 14 March 2009 - 07:49 PM

Ok, so still no luck. I was able to add the contents of the .jar file by either extracting them and than setting their directory as a source folder when I created a project from source.

The issue seems to all relate back to the projects inability to locate the DNS related variables that most likely exist in a JmDNS.java file, this file is located in the root directory of the .jar file, and is added to <Default Package> by Netbeans/Eclipse -

For Example:

JmDNS bonjour = Shared.getJmDNSInstance();

Returns:

Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - cannot find symbol
symbol : class JmDNS
location: class ourtunes.gui.GUI



**the same problem also happens in Eclipse. Here is a screen shot as well: Posted Image

I am curious if anyone would recognize an issue where I would have to import this JmDNS.java file in a unique way to trigger the project to compile it correctly. I will try adding it to library's for the project.

Thanks!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1