Package-accessable class elements

Can anyone help me with a makefile problem?
When I make on unix from the following makefile, classes from
other files in the same package as MainHandler cannot access
a non-public class in the MainHandler file. Even though they are in
the same package.
Also this same code compiles and works fine on windows using JBuilder,
i.e., The classes in these other files can access the class in MainHandler fine.
Am i missing some additional makefile directive??
======================================================
graphics=.:/usr/java/lib/classes.zip:classes:lib/jcommon-0.9.3.jar:lib/jfreechart-0
.9.18.jar:lib/log4j-1.2.8.jar:lib/jdom.jar:lib/gnujaxp.jar
CLSDIR=classes
CLASSPATH=$graphics
PKGDIR=mypkg
SRCDIR=src/$PKGDIR
javac -classpath $CLASSPATH -d $CLSDIR -deprecation $SRCDIR/MainHandler.java
javac -classpath $CLASSPATH -d $CLSDIR -deprecation $SRCDIR/TheReport.java
javac -classpath $CLASSPATH -d $CLSDIR -deprecation $SRCDIR/ReportDetails.java
javac -classpath $CLASSPATH -d $CLSDIR -deprecation $SRCDIR/Com1.java
cd classes/mypkg
chmod 777 *.*
cd ../..
cd $CLSDIR
jar -cfM MainHandler.jar $PCKDIR
chmod 777 MainHandler.jar

maybe do this:
javac -classpath $CLASSPATH -d $CLSDIR -deprecation $SRCDIR/*.java
Or maybe start using Ant.
Although I'm not sure why it would be a problem except that your classpath stuff is wrong when you run it.

Similar Messages

  • Default access class

    I tried searching for this but couldn't find it. If you have a package-access class, are there any special rules on access modifiers allowable for variables and methods?
    Thanks.

    No.Good answer.
    http://java.sun.com/docs/books/tutorial/java/java
    OO/accesscontrol.html
    http://java.sun.com/docs/books/tutorial/java/java
    OO/classdecl.html
    http://java.sun.com/docs/books/tutorial/java/java
    OO/index.html
    http://java.sun.com/docs/books/jls/third_edition/
    html/j3TOC.html
    Offset your good answer with these useless links.
    So, why is there no restriction? If you have a default-access classes but public (or protected?) members, wouldn't they still not be accessible for that class? Though it could just be another "simply memorize it" rule, are there any reasons you might think of for why it's done like that?

  • Unable to access classes in third party jar files packaged with my ejb.jar

    I have packaged some third party jar files in my xxx_ejb.jar file.  The third party jar file contains classes that are accessed by some custom classes which are in turn accessed by my bean classes.  I get the following error when my custom classes attempt to use any of the classes in one of the third party jar files:
    java.lang.NoClassDefFoundError: com/Ostermiller/util/CSVParser
    Shouldn't I be able to access classes in jar files that are packaged with my xxx_ejb.jar file?  I see the xxx_ejb.jar file as a resource of the application classloader that contains it but I don't see the third party jar files.

    As per the Java EE specification, additional JAR files should be packaged on the EAR level. Only WAR files' WEB-INF/lib folder is scanned for JAR files to be added to the classloader.

  • Access Class in Default Package

    Make long story short, I have to have some class in the "(default package)", related to JNI, and I will need to pass data back and forth from and to these classes from some packaged classes. I am using Java 1.4. As I know since Java 1.4, it's not possible to access classes in default package from packaged classes directly. Is there a work around? please help...

    I DON'T have the C/C++ codeSo you have to do with the "old" classes in the default package.
    Then use jschell's suggestion to devise proxying code that allow bridging between the packages.
    since Java 1.4, I can't call the java class in the default package from packaged class any moreIf I understand jschell's post, this restriction is enforced by the Java compiler , not by the Java interpreter (JVM). Indeed this is specified in the JLS (Java Language Specifications, http://java.sun.com/docs/books/jls/third_edition/html/packages.html#7.5), not the JVM specifications (I have not verified that latter point).
    So if you get an older JDK (before 1.4 they would accept the construct), you can try writing proxy classes within a named package, proxying to the old classes in the unnamed package. Once they are compiled, and jarred together for convenience, you can switch back to the current compiler (let's says 1.6) to compile the rest of your application classes, which only use the classes in the named package, using the jar as a library.
    When executing the program, the JVM will execute everything without complaining, since it supports execution of compiled code that has been compiled with former versions.

  • Why local class merely be final/abstract/package access?

    The scenario is that while declaring a local class as final/abstract/package access only and why this access specifier is using?
    could anyone plz express the reason for that?
    With Regards,
    Stalin.G

    final String efg = "efg";
    testCallback(new Callback()
    public void execute(String str)
    try
    Thread.sleep(3000);
    } catch (InterruptedException e)
    System.err.println(str+efg);
    System.err.println("finished " + System.currentTimeMillis());
    //...Look at the local variable efg, it must be final, or the code does not compile,, Can anybody explain why efg has to be final?*explained by dcminter and Jardium in [an older thread|http://forums.sun.com/thread.jspa?messageID=10694240#10694240]:*
    >
    ...Final variables are copied into inner classes - that's why they have to be declared final; to avoid the developer making an incorrect assumption that the local variable can be modified and have the change reflected in the copy.
    When a local class uses a local variable, it doesn't actually use the variable. Instead, it takes a copy of the value which is contained in the variable at the moment the class is instantiated. It's like passing the variable to a constructor of the class, except that you do not actually declare any such constructor in your code.
    To avoid messy execution flows to be present in a Java method, the Java language authors thought it was better to allow a single value to be present in such a variable throughout all its life. Thus, the variable has to be declared final.

  • Package and class viewer

    Hello,
    Is there an equivalent of a menu item or short-cut key to bring up package and class viewer? A similar feature exists in Eclipse which builds the indexes and Ctrl-Shift-T will bring up all the classes in your workspace / project. I have seen something similar in Jdeveloper while running in debug mode, if it cannot find a file that is need for trace options, it throws up a window that says "Package and Class Viewer". It would be useful to access that during development as well.
    Thanks
    Farooq.

    Thanks for the repose. Ctrl+ , along with Ctrl= is doing the same thing. Also discovered Ctrl- will bring up java classes. Only thing remains is the remaining files in the project e.g XML or JSP files
    Thanks for you, got me in the right direction.

  • Cannot access class oracle.sql.BLOB;

    Hi,
    I am trying to save a .tif file into Oracle database. When I run the program in JDeveloper I get the following errors:
    Error(9,19): cannot access class oracle.sql.BLOB; file oracle\sql\BLOB.class not found
    Error(59,29): class BLOB not found in class mypackage1.ImageUpload
    package mypackage1;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.sql.*;
    import java.util.Properties;
    import oracle.sql.BLOB;
    Blob imgblob = rs.getBlob(1);
    OutputStream blobos = ((BLOB) imgblob).getBinaryOutputStream();
    ...................Any help is appreciated. Thanks

    What package do I need to include in my classpath for
    this. ThanksWhy don't you inspect your JAR files? Do you have WinZip? Open them with it and find the class.

  • How to create a model access class ???

    HI,
          Can somebody tell me how to create a Model Access Class. In the Application Set, i can find the Model Access folder, but it has a list of application sets which is already created and the system asks to select a Application set. I need to create a new application set. Please help.
    Regards,
    Shiny

    Hi Shiny,
    I would suggest you not to create a new application set.
    If you are enhancing a standard PCUI application, i would suggest you to create new model access classes and assign them to the same application set which is assigned with the standard model access class for that application.
    Creating a model access class can be done through the transaction SE24(like any other Z-class).
    Go to transaction CRMC_BLUEPRINT_C and you could assign this newly created Model access class to the standard application set. This can be done under Application Element->Application Set->MOdel Access Class.
    If you still feel the need to create a new application set altogether, it can be done from Trx CRMC_BLUEPRINT_C->Layout of PCUI-> Application Element->Application set.
    I hope it helps.
    Cheers,
    Gyan.

  • Cannot access class jclass.util.JCVector

    I need the libraries .
    Where can I get the libraries for my java application?.
    When I compile , I get this error:cannot access class jclass.util.JCVector.
    I have been looking for them in the sitraka home, but I haven�t
    found any.
    I have installed libraries for jclass.bwt. package but I imagine
    that it isn�t enough.
    Thanks alot-
    ras

    I dont know the class JCVector, but if you received the error message
    "cannot access class jclass.util.JCVector"
    It means that the class is there, but you cannot access.
    Why I cannot access if the class is there? - you should ask
    Problably the access permission of this class is not Public, it must be private or protected.
    The most common is the class is protected and it is in another package.
    So the JVM locate the class, but cannot access it from your current class, because the class you are trying to access is protected or private.
    Hope that i Helped
    JoseAugusto

  • Package access level

    hey, i have packages structures as cg.chart, cg.chart.data, cg.chart.graphic etc with classes in all the packages. Now, i also have a getObject() method in each class, but I don't want this method to be visible from outside the cg package...however, I do want it to be visible within all the packages in cg.chart.
    Ex: I have a class called Axis.java under cg.chart and a class called DataSet.java under cg.chart.data package. Now, if I just have package access for getObject() in Axis.java, but need to invoke that method from DataSet.java, i'm not able to do so. Any ideas?
    Thanks.

    You can't do what you are trying to do.
    The classes in the cg.chart.data and cg.chart.graphic packages are not in the cg package. The cg.chart.data, cg.chart.graphic, and cg packages are totally unrelated. The hierarchical (sp?) package names mainly serve to make finding the class files on the path easier. It doesn't effect the relationships between packages at all.

  • [svn] 719: Added package and class level javadoc.

    Revision: 719
    Author: [email protected]
    Date: 2008-03-03 11:34:54 -0800 (Mon, 03 Mar 2008)
    Log Message:
    Added package and class level javadoc.
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/Configuration.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/Element.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationCompiler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/LogAdapter.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/SourceCodeBuffer.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/Visitor.java
    Added Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/package.html

    Just create a package.html file in the package folder and put your package documentation there. I just put my cursor on the Application Sources package folder name and right click and create a simple file. It will default to the package folder.

  • What is the package-visible class?

    I am reading JCVM2.2.1 Spec.
    I don't know what the package-visible class is?
    for example,
    Here is a sentence I could not understand.
    A public class cannot contain a public or protected field of type reference to a package-visible class.
    However, I know a general Access controls such as public, protected and private.
    Help me?
    What is the package-visible class in Java Card?

    There is something called package protected in Java. This means that an object may be accessible thru a package only. Sort of like public with limited visibility.
    Search the Java 2 Tutorial.

  • How to access the element s in a hashMap with order

    Does anybody know how to access the elements in a hashMap with order.
    I know set is a collection that doesn't gaurantee the order so the iterator of keySet will not gaurantee the order.
    Is there any way to solve this?
    Thanks

    If you mean the order in which the key/value pairs where added to the
    map, have a look at the LinkedHashMap class. If you mean 'natural'
    order, you shouldn't be using a HashMap at all then; have a look at the
    TreeMap class instead.
    kind regards,
    Jos

  • HTMLDocument - How Can I access an element ?

    Hello,
    I want to try and access the element in an HTMLDocument with a position received from a viewToModel() call (of a JEditorPane).
    I'm not sure what method I use, I think it's the getCharacterElement() of the HTMLDocument root class, but I'm not too sure.
    Could someone give me some advice ?
    thanks
    Kerry

    Hi camickr,
    Well this post is related to my other one you kindly answered earlier ( here )
    Just to recap :
    I'm using a JEditorPane to display HTML and when the user clicks on a part of the web page, for example an image. In response to this mouse event, I want to locate where in the HTML tree the particular item is and (eventually hightlight the corresponding HTML element in a JTree of the entire HTML page). So far this is my code that responds to Mouse events :
    private void jEditorPane1MouseClicked(java.awt.event.MouseEvent evt) {                                          <br />
            // TODO add your handling code here:<br />
            Object o = evt.getSource();<br />
    <br />
            if (o instanceof javax.swing.JEditorPane){<br />
                javax.swing.JEditorPane t = (javax.swing.JEditorPane)o;<br />
                javax.swing.text.Document d = t.getDocument();<br />
    <br />
                java.awt.Point p = evt.getPoint();<br />
                int k = t.viewToModel(p);<br />
                javax.swing.text.Element e = ((javax.swing.text.DefaultStyledDocument)d).getCharacterElement(k);<br />
                javax.swing.JOptionPane.showMessageDialog(null,Integer.toString(k));<br />
                //int comp = o.viewToModel(evt.getPoint());<br />
            }<br />
        }So as you see, I set the value of 'k' to 'nearest representative location in the model.' but then I'm not sure how I use this number to get to the HTML element, which accounts for the last few lines of the code.
    So my problem is I'm not sure what to do with the integer returned from viewToModel().

  • How do I find out what Package a class is in

    I am trying to find out what Package the classes XMLNode and XMLInterface are located in. Is there a way to search for a class to find out what package it is held in ?
    Quite often I see example code but spend wore time working out what package the class is in than actually writing code. Am I being really stupid ? (Don't answer that !!)
    Many thanks for any tips
    Dan

    you can find the class path by searching the $JAVA_TOP directory.
    Login to apps server.
    cd $JAVA_TOP
    find . -name "Classname.class"
    --Prasanna                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • What would you replace an ATI Radeon 9800 Pro (256MB) with?

    Hi, I started a thread before asking whether I could replace a 256MB card with a 128MB card, even though the interface was a different shape. But, as I know so little about Macs and graphics card, it seems wiser to ask What would you replace an ATI R

  • LIS Extraktion to BW - selfdefined LIS structures

    Hi, I found several documents about activation of content LIS structures and the process of extracting these structures into BW. In our case we defined a new LIS structure, loaded it with datas and now we want to extract this data to BW. Now my quest

  • Select user from dual with oid + oss ?

    Implementing a solution for global user administration, authentication and application schema mapping, will it break the simple but efficient possibility to do a 'select user from dual' ? If it is possible which value will we get, a global user ident

  • Adobe Premiere Pro Cs4 : Stuck When Load ExporterWave.prm

    hey , i just got my premiere pro stucked when startup , but when i delete the ExporterWave.prm , application run normally can someone explain this? sorry for my bad english

  • Selection formula not selecting by dates

    I'm having an odd problem with my report. I'm trying to filter by the start date of a job. The DB I'm pulling from stores it as a string, YYYMMDD (e.g. today is 20090713). In most of my reports it works just fine, but in this one it seems that it's i