Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: importing QTJ into xCode




On 19 Jan 2006, at 23:36, Greg Guerin wrote:

Russell Edwards wrote:

I know how to compile my program in the terminal using "javac - classpath
/System/Library/Java/Extensions/QTJava.zip program name." But can't find a
way of setting the java flags in xCode, so i get compiler errors saying
that the imported files can't be found.

Can someone please tell me how to fix this?

Try doing nothing at all.  You shouldn't even need to name that file in the
'javac -classpath ...' command-line.  (By the way, there must be no space
between '-' and 'classpath'.)

The QTJava.zip file in that location is already automatically present in
your classpath, because it's installed as a Java extension, and Java
extensions are automatically placed in your classpath.

If you can't import a simple QTJ class, such as:
  import quicktime.Errors;

in a simple Java source file, then I suspect a permissions problem on
either QTJava.zip itself or one of the dirs leading up to it.  You do need
read-permission on the file, and r+x permission on the dirs, or the Java
extension mechanism will quietly ignore the files in that location.

If you're not sure how to fix permissions problems, post the output of this
command:
  ls -la /System/Library/Java/Extensions/

so we can see if it really is the cause.  If the command fails, then paste
the error message.

  -- GG

Hi Greg

thanks for the help

for some reason my computer does need the -classpath variable to be set (sorry about the space in my first post), here is the terminal output if i don't set it:

russ@russell-edwards-power-mac-g5:~/Documents/Year 3/JAVA/QTJ/QTVersionCheck> javac QTVersionCheck.java

QTVersionCheck.java:1: package quicktime does not exist
import quicktime.QTSession;
                 ^
QTVersionCheck.java:2: package quicktime.util does not exist
import quicktime.util.QTBuild;
                      ^
QTVersionCheck.java:10: cannot resolve symbol
symbol  : variable QTSession
location: class QTVersionCheck
                        QTSession.open();
                        ^
QTVersionCheck.java:11: cannot resolve symbol
symbol  : variable QTSession
location: class QTVersionCheck
                        System.out.println ("QT Version: " + QTSession.getMajorVersion() + "." + QTSession.getMinorVersion());
                                                             ^
QTVersionCheck.java:11: cannot resolve symbol
symbol  : variable QTSession
location: class QTVersionCheck
                        System.out.println ("QT Version: " + QTSession.getMajorVersion() + "." + QTSession.getMinorVersion());
                                                                                                 ^
QTVersionCheck.java:12: cannot resolve symbol
symbol  : variable QTBuild
location: class QTVersionCheck
                        System.out.println ("QTJ Version: " + QTBuild.getVersion() + "." + QTBuild.getSubVersion());
                                                              ^
QTVersionCheck.java:12: cannot resolve symbol
symbol  : variable QTBuild
location: class QTVersionCheck
                        System.out.println ("QTJ Version: " + QTBuild.getVersion() + "." + QTBuild.getSubVersion());
                                                                                           ^
QTVersionCheck.java:13: cannot resolve symbol
symbol  : variable QTSession
location: class QTVersionCheck
                        QTSession.close();
                        ^
8 errors

The code I am compiling is example one from Chris Adamson's book on QTJ where he says that  -classpath needs to be set. Here is the source code, just in case i have made a mistake (it does compile and run if I set the -classpath in the terminal).

import quicktime.QTSession;
import quicktime.util.QTBuild;

public class QTVersionCheck
{
public static void main (String[] args)
{
try
{
QTSession.open();
System.out.println ("QT Version: " + QTSession.getMajorVersion() + "." + QTSession.getMinorVersion());
System.out.println ("QTJ Version: " + QTBuild.getVersion() + "." + QTBuild.getSubVersion());
QTSession.close();
}

catch (Exception e)
{
e.printStackTrace();
}
}
}

I have used the "get info" box in the finder to test the permissions on all the folders and QTJava.zip and that says that I have read access on them all. The terminal results echo this, I don't have execute on QTJava.zip, but I do on all the folders.

Russell

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: importing QTJ into xCode (From: Greg Guerin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.