Compilation of obscured using CAP jar file

Hello

I have the following problem:

-J' have a midlet application that uses Bouncy Castle for cryptographic operations.

-Bouncy Castle defines classes Java, java.io.FilterOutputStream, etc. in his jar.

-To compile this code I use aggressive obfuscation so that package names are also obfuscated, otherwise the application will not build.

-J' use Java Platform Micro Edition SDK Version 3.0

-I want to generate a file of cod for the deployment of Blackberry using the CAP directly from the jar/jad file.

-I do not use a specific product of the rim api.

-I'm not using the - import in the CAP command option.

-When I run the CAP tool, I get a bunch of warnings saying:

java.lang.String: WARNING! : not found definition

java.lang.Throwable: WARNING! : not found definition

Finally, I get the error:

Error! : class: java.lang.String has no members: equals

What's not here?

Hello

Thanks a lot to all of you for your help. Actually I just tried add import = net_rim_api.jar to my options of Cap.

Which seemed to have solved the errors/warnings of compilation.

But right now I'm stuck with another question. In other words, when I try to install OTA application hosted on my web server for the Simulator I get an error "failed to save the Push 911." Any idea? My application uses a registry to statically recorded.

Thank you

Paiva

Tags: BlackBerry Developers

Similar Questions

  • Class not found in the applet using 2 jar files

    I have an applet that worked for many years as a stand alone or connecting directly to a database of derby on my home server. I just changed it to connect to MySQL on my ISP via AJAX and PHP server.

    I am now getting a class not found error in my browser, probably because I'm stuffing by the class path.

    The HTML code that I use to call the cmdlet is:
    <applet code="AMJApp.class" 
    codebase="http://www.interactived.com/JMTalpha" 
    archive="AMJ014.jar,plugin.jar" 
    width="500"height="500" 
    MAYSCRIPT style="border-width:0;" 
    name="jsap" id="jsap"></applet>
    The AMJ014.jar contains the applet and the support of class files.

    The error message is strange for me because it refers to a class, I noticed on another web page, but that has nothing to do with my applet. In any case, the message in its entirety is:
    load: class NervousText.class not found.
    java.lang.ClassNotFoundException: NervousText.class
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.ClassNotFoundException: NervousText.class
    java.lang.UnsupportedClassVersionError: AMJApp : Unsupported major.minor version 51.0
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClassCond(Unknown Source)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.defineClass(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.access$100(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.UnsupportedClassVersionError: AMJApp : Unsupported major.minor version 51.0

    886473 wrote:
    Nice reference - love these movies!

    ;-)

    I recompiled those classes with the following commands:

    javac -source 1.6 -target 1.6 -Xlint:-options -classpath "C:\Users\MJHIPP\Documents\Current\Java\CodeLocal\AMJ110920\plugin.jar";"." JSHelloWorld3.java
    javac -source 1.6 -target 1.6 -Xlint:-options -classpath "C:\Users\MJHIPP\Documents\Current\Java\CodeLocal\AMJ110920\plugin.jar";"." AMJApp.java
    

    JSHelloWorld3 always works for me and AMJApp still does not work, but the error message has changed:

    I got different results. The JSHelloWorld3 now works for me (and AMJApp still does not work).

    java.lang.UnsupportedClassVersionError: AMJApp :
        Unsupported major.minor version 51.0
    

    >

    Java Plug-in 10.0.0.147
    Using JRE version 1.7.0-b147 Java HotSpot(TM) Client VM
    User home directory = C:\Users\MJHIPP
    ..
    

    BTW - I was using a JRE 1.7 until I realized it couldn't run one of my projects for pets, DukeBoxand returned to 1.6. Previously, I had read in a forum that the current version at this time there was fundamentally flawed. For this reason I have will perform purely using JRE 1.6 for the moment. Versions available for use by applets and applications of Java web start. can be configured in the Java Control Panel.

  • What "vsphere client lib" or "data-services - 1.0.0" jar file to use in client plugin vsphere-web

    My client plugin project vsphere web contains the two files jar "vsphere-client-lib" or "data-services - 1.0.0. These two jars has many common classes with identical or different method signatures. I used the DataException class in my code that uses the signature of the method of the vsphere client file - lib.jar.

    When I build the project, then sometimes data-services - 1.0.0 jar file gets loaded first and so, build becomes due to a lack of signature of the method.

    I need to know why there are so many classes common to these two pots?

    Can we use only single (also available in the sdk directory) jar of vsphere-client-lib pot instead of data-services - 1.0.0 jar in plugin?

    We can achieve all features using vsphere-client-lib pot instead of data-services jar file - 1.0.0.

    Simply compile your Java with client/vsphere-Java code - lib.jar.  I don't know why you use data-service - 1.0.0 (and where you found it). It is not part of the SDK and is not the doc or samples.

  • error in execution of using os odi command utility jar file

    Hello

    I am trying to run the jar file using the command ' java-Xmx3072m-Xms2048m-jar exceltocsv.jar "in my bones odi utility command, but get the error" 'java' is not recognized as builtin or external, an executable program or batch file ".i have installed jdk and configured path."

    even order, that I am able to run cmd and no mistake.

    shot_odi_os_comm.png

    Oh, sorry. second process works for autonomous agent where ODI_JAVA_HOME sets in ODIPARAMS.bat

    For the local agent try ""% JAVA_HOME%/bin/java " (don't forget to put quotes, because your jdk could be in the directory Program Files)"


    If she does not check your envfiroment by the set command

    This command generates your environment in the c:/temp/1.txt file

  • An Extension using an external JAR file

    Hey,.
    I read this blog entry:
    -[http://blogs.oracle.com/jdevextensions/entry/adding_exteneral_jars_to_an]
    and the thought that maybe that is it, but unfortunately will only work if the jar is deployed with the installation of JDeveloper.
    I use in my extension jar files that I made myself, and even if I can get around this problem my copy just jar files to hand to the place where they are supposed to be, if I export the extension, it will not work on other PC.

    So what I need to do, it's somehow include the jar file in the deployment. I tried to add a new group of files for the libraries in the deployment window, but unfortunately, that has not helped at all.

    Thank you for your time and I hope someone can help me.

    Couple of things possible.

    It is probably just a thing of packaging in the forums, but make sure externally: part is all on the same line as the Bundle-Classpath entry.

    Also remove the space between the "external: ' and the ' $ORACLE_HOME$".

    One last thing, is in the previous post, you got the mon.jar in a 'test' under extensions folder.. In this example, it seems you are trying to call it directly from the Extensions folder.. This could be the main issue.

    Let me know if these elements help at all.

  • Memory used by the Windows executable jar file

    I wrote a java program that locates my position of mouse pointer, and then it moves on the screen using the Robot class. I created a file executable (executable) jar of this java single file and executed. Then I went to Task Manager processes list and saw that the exe is 11MB, which seems pretty huge for me. Anyone know why its occupying 11 MB of memory? And is it normal to occupy this physical memory much?

    Only 11MB? What is your problem? In order to execute a jar file, the JAVA virtual machine must be loaded into memory, so this 11 is actually JVM + your jar file, as well as all resources used.

  • can I use JAR files in flex?

    Hello
    I'm new to Flex and we create a web application.

    Can I use JAR files I already have and create the front-end server by using Flex?

    Thanks in advance.

    jar files are 'archives java' and are usually full of java class files.

    Flex use actionscript, java and is a technology on the client side.

    You can write your web application based on java, that server is using jar files on the side.

    the flex application would communicate with your server through typical HTTP, as javascript client-side can communicate with your server.

    so I guess the answer is YES, you can use what you want on the server. makes no difference to flex.

    . / paul

  • Problem in the visualization of a converted JavaHelp (jar) file (created using RH2002 to RoboHelp X 5)

    Hello

    I have a (compressed javahelp) javahelp project created using RoboHelp 2002. The output files are jar files.

    The source files are .mpj. When I consult the existing jar files without converting the project to the .xpj I am able to view the jar files.

    However, this project should be upgraded to RHx5. The conversion of (.mpj to .xpj), everything seems to work fine and javahelp files are generated. But when I try to view the jar files, nothing is displayed.

    I get the following error. Please see below.

    Everyone comes across something similar? I have to take care of, before moving on to .xpj? I can't locate the file glo.xml in HR.

    Best regards
    Jason Lee


    The analysis is not set to null
    Exception caught during parsing of jar: file: C: / Documents and Settings/urmiroy/Desktop/ep2_cd1helps/Developer_edit/JavaHelp/FLEXIEDGEBTS_dev_edit.jar!/ FLEXIEDGEBTS_dev_edit_glo.xmljava.io.FileNotFoundException: entry not found POT FLEXIEDGEBTS_dev_edit_glo.xml in C:\Documents and Settings\urmiroy\Desktop\ep2_cd1helps\Developer_edit\JavaHelp\FLEXIEDGEBTS_dev_edit.jar
    Exception occurred during the transmission of the event:
    java.lang.NullPointerException
    at javax.help.MergeHelpUtilities.mergeNodeChildren (MergeHelpUtilities.ja
    will: 89)
    at javax.help.plaf.basic.BasicGlossaryNavigatorUI.loadData (BasicGlossary
    NavigatorUI.java:217)
    at javax.help.plaf.basic.BasicGlossaryNavigatorUI.reloadData (BasicGlossa
    ryNavigatorUI.java:198)
    at javax.help.plaf.basic.BasicGlossaryNavigatorUI.installUI (BasicGlossar
    yNavigatorUI.java:146)
    at javax.swing.JComponent.setUI (unknown Source)
    at javax.help.JHelpNavigator.setUI(JHelpNavigator.java:257)
    at javax.help.JHelpNavigator.updateUI(JHelpNavigator.java:276)
    to javax.help.JHelpNavigator. < init > (JHelpNavigator.java:105)
    to javax.help.JHelpGlossaryNavigator. < init >(JHelpGlossaryNavigator.java:)
    62)
    at javax.help.GlossaryView.createNavigator(GlossaryView.java:82)
    at javax.help.JHelp.setupNavigators(JHelp.java:148)
    to javax.help.JHelp. < init > (JHelp.java:126)
    to javax.help.JHelp. < init > (JHelp.java:76)
    to sunw.demo.jhdemo.JHLauncher$ DisplayAction.actionPerformed (JHLauncher.
    Java: 956)
    at javax.swing.AbstractButton.fireActionPerformed (unknown Source)
    in javax.swing.AbstractButton$ ForwardActionEvents.actionPerformed (Unknow
    Source n)
    at javax.swing.DefaultButtonModel.fireActionPerformed (unknown Source)
    at javax.swing.DefaultButtonModel.setPressed (unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased (unknown safe
    This)
    at java.awt.Component.processMouseEvent (unknown Source)
    at java.awt.Component.processEvent (unknown Source)
    at java.awt.Container.processEvent (unknown Source)
    at java.awt.Component.dispatchEventImpl (unknown Source)
    at java.awt.Container.dispatchEventImpl (unknown Source)
    at java.awt.Component.dispatchEvent (unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent (unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent (unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent (unknown Source)
    at java.awt.Container.dispatchEventImpl (unknown Source)
    at java.awt.Window.dispatchEventImpl (unknown Source)
    at java.awt.Component.dispatchEvent (unknown Source)
    at java.awt.EventQueue.dispatchEvent (unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy (unknown Source)

    at java.awt.EventDispatchThread.pumpEventsForHierarchy (unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy (unknown Source)
    in java.awt.Dialog$ 1.run (unknown Source)
    at java.awt.event.InvocationEvent.dispatch (unknown Source)
    at java.awt.EventQueue.dispatchEvent (unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy (unknown Source)

    at java.awt.EventDispatchThread.pumpEventsForHierarchy (unknown Source)
    at java.awt.EventDispatchThread.pumpEvents (unknown Source)
    at java.awt.EventDispatchThread.pumpEvents (unknown Source)


    The question of the visualization of jar - resolved files.

    Hi all

    JavaHelp requires the Helpset file and files of navigation to build and display properly. In this case, he was not able to locate the a navigation files not be generated (unless I chose to create JavaHelp compressed with source files).

    I don't know how the generated navigation files in 2002 to HR, but when you have an existing (.mpj) project that must be upgraded to .xpj, it is important to generate JavaHelp with the source files for the first time.

    Once it creates all the files of navigation and the jar file is visible, I can go back to the option of creating just the JavaHelp Tablet and can also display the jar file.

    Best regards

    Jason Lee

  • FileNotFoundException, when you use a template stored in a jar file

    Hello

    Using Jdev 11.1.1.3.0 I created a JSF page template in a project and has been in the form of ADF library JAR file. In a second project, I added the library and I could see my model in the drop-down page templates. I created a new page based on this template, but when I run the page I get an exception FileNotFoundException indicating the name of the template file that I created in the first draft. Any idea?

    Make sure the JAR file that has been added to your project libraries has the 'default deployment"check box selected.

  • Why - jar option used to install software that is located in the executable jar file?

    Hi all
    I have a question, I have a generic installer that is used to install oracle weblogic 10.3 in unix (i.e., who is in the .jar extension) platform which is the executable jar file.

    To install this software that do use - jar installation option
    java-jar net_server < version > _generic.jar

    My question why we use - jar option of install or extract the software

    can any one clarify my doubts...

    Thanks in advance
    Aerts

    Published by: sumanth_abhi on January 27, 2009 23:50
  • How to call a jar file using the IIS virtual directory

    I have my application with limited functionality and I am trying to deploy a jar files in my library files, IIS is my web server. I want to create a virtual directory and I should be able to invoke the new jar of the virtual directory. Any thoughts?

    This issue is beyond the scope of this site and must be placed on Technet or MSDN

    http://social.technet.Microsoft.com/forums/en-us/home

    http://social.msdn.Microsoft.com/forums/en-us/home

  • Jar file does not not - in double file source error

    Hello

    I use the plugin Eclipse + BB 1.3.0 and I do a cross-platform for BB + Android app. I've extracted some of the pure java source files, no blackberry or Android specific methods or imports and put them in a jar file. I did it in eclipse by right-clicking on the project-> export-> Jar and selecting files in my project I want to add in the CONTAINER.

    Then, I deleted the files in my project, I just add in the CONTAINER so that they are only in 1 place at this stage. Then on the command line as I type:

    preverify -classpath ../lib/net_rim_api.jar myfile.jar
    

    Now, as I understand it, I should have a file JAR that I can use in eclipse and also the BB JDE.

    I tried to add the JAR directly to the project in Eclipse. Didn't ' work (gave the 'Module review errors'). I then created a project, assign the 'Library', adds that the POT and made 'exportable' and 'export '.

    The initial project can import the classes, but that's all!

    In eclipse, I get an error saying that there is a definition "duplicate" for one of my classes. In the console, it compiles the pot very well, but its when its compilation of the main project I get this error. But I deleted the files in the project and cleaned and refreshed, and deleted the "deliverables" folder then all *.cod and .debug files are deleted.

    Its quite frustrating!

    IF anyone can help, I would be very grateful!

    Thank you!

    Too bad
    I fixed it by adding the jar again to the main project in eclipse, and this time I just checked it in "order and export.

  • Problem with several adapters and Jar file included in a service.

    Hi all

    I'm new here and I am ready to work with the VMWare client sdk. I have already started and exported several adapters to implement the full functionality that I need. However, I get an error:

    Request context failed to create 'com.management.serviceprovider' in ' 1.0.0 version. org.springframework.beans.factory.BeanCreationException: error creating bean with name 'DatacenterConfig': calling the init method failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: cannot find class [com.adapters.Datacenter.ClusterConfigAdapterImpl] for the beans with the name 'ClusterConfigAdapterImpl' defined in URL [bundleentry://281.fwk1147580192/META-INF/spring/bundle-context.xml]. nested exception is java.lang.ClassNotFoundException: com.adapters.Datacenter.ClusterConfigAdapterImpl finds do not bundle [com.management.serviceprovider]

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

    to org.springframework.beans.factory.support.AbstractBeanFactory$ 1.getObject(AbstractBeanFactory.java:294)

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:591)

    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)

    to org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.access$ 1600 (AbstractDelegatedExecutionApplicationContext.java:60)

    to org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$ 4.run(AbstractDelegatedExecutionApplicationContext.java:325)

    ...

    This error occurs very often and it's strange because I place the cards together in a same way. Here is the OSGI layer and contaxt bundle files:

    Context Bundle:

    < name of the bean = "ClusterAdvancedAdapterImpl" class = "com.adapters.Datacenter.ClusterAdvancedAdapterImpl" >

    < constructor-arg ref = "dataServiceExtensionRegistry" / >

    < / bean >

    < osgi:service id = "DatacenterConfig" ref = "ClusterConfigAdapterImpl".

    interface = "com. VMware.vise.Data.Query.PropertyProviderAdapter"/ >

    < osgi:reference id = "dataServiceExtensionRegistry".

    interface = "com. VMware.vise.Data.Query.DataServiceExtensionRegistry"/ >

    And I really don't know why this isn't a job.

    The second problem is that I have another project with classes and I want to export it to a jar file. When I do this I also want to include this pot in the bundle, but when I change the ant file it does not work on virgo.

    Any help will be appreciated.

    Kind regards

    Stefan

    For option 2 which he question in post above, you can use the piece of code below in the Ant script in the target of the compilation at the end.

    --------

    -----

  • EchoSign version 20 jar file?

    Hello

    I'm new to Echosign and I got a task to upgrade to version20 echosign, currently we're using Echosign version15, but could not able to find Echosign.jar anywhere, can someone help me on this? May I know where you guys uploaded the new file Echosign.jar? I spoke with several types of customer support and no one understood what I'm looking for...

    Please help me to find/get the Echosign.jar file to version20.

    If some of you do not know this Echosign.jar file, then here is a simple explanation,

    EchoSign was an Echosign.jar file in their Web site, developers download the jar file, place it in their way of compiling, so they can import and use Echosign classes/methods as below

    Import echosign.api.clientv15.dto.ArrayOfFileInfo;

    Import echosign.api.clientv15.dto.CancelDocumentResult;

    Import echosign.api.clientv15.dto.DocumentCreationInfo;

    Import echosign.api.clientv15.dto.DocumentKey;

    Import echosign.api.clientv15.dto.FileInfo;

    Import echosign.api.clientv15.dto.Pong;

    Import echosign.api.clientv15.dto.Result;

    Import echosign.api.clientv15.dto.SenderInfo;

    Import echosign.api.clientv15.dto.SignatureFlow;

    Import echosign.api.clientv15.dto.SignatureType;

    Import echosign.api.clientv15.dto12.SendDocumentInteractiveOptions;

    Import echosign.api.clientv15.dto12.SendDocumentInteractiveResult;

    Import echosign.api.clientv15.dto14.AgreementStatus;

    Import echosign.api.clientv15.dto14.ArrayOfDocumentContent;

    Import echosign.api.clientv15.dto14.ArrayOfRecipientInfo;

    Import echosign.api.clientv15.dto14.DocumentContent;

    Thank you

    Dominik

    Update: I used the JAX - WS tool to generate class of wsdl files, but its not to create the proxy and service records?

    Hello Dominik,

    Please refer to the doc: https://secure.echosign.com/redirect/latestApiDevelopersKit

    Kind regards

    Rave

  • packages and JAR files

    New to Java:

    I'm trying to learn more about the packages and JAR libraries using jdk1.7.0_17 on Debian 6.0.7 (Squeeze). I created a tree of directories and files to work with:
    2013-05-11 20:22:07 dpchrist@desktop ~/sandbox/java/jar
    $ tree .
    .
    |-- Makefile
    |-- bin
    |   |-- using_class_files
    |   |   `-- MyApp.class
    |   `-- using_jar_file
    |-- ext
    |   `-- com
    |       `-- example
    |           `-- myapp
    |               `-- util.jar
    |-- obj
    |   `-- com
    |       `-- example
    |           `-- myapp
    |               `-- util
    |                   `-- Speak.class
    `-- src
        `-- com
            `-- example
                `-- myapp
                    |-- MyApp.java
                    `-- util
                        `-- Speak.java
    
    17 directories, 6 files
    
    2013-05-11 20:22:39 dpchrist@desktop ~/sandbox/java/jar
    $ cat src/com/example/myapp/util/Speak.java 
    package com.example.myapp.util;
    public class Speak {
        public static void hello(String arg) {
         System.out.println("hello, " + arg);
        }
    }
    
    2013-05-11 20:23:27 dpchrist@desktop ~/sandbox/java/jar
    $ cat src/com/example/myapp/MyApp.java 
    import com.example.myapp.util.Speak;
    public class MyApp {
        public static void main(String [] args) {
         Speak s = new Speak();
         s.hello("world!");
        }
    }
    
    2013-05-11 20:23:54 dpchrist@desktop ~/sandbox/java/jar
    $ cat Makefile 
    .PHONY: all
    all: clean using_class_files using_jar_file
    
    .PHONY: using_class_files
    using_class_files:
         # create utility bytecode file (Speak.class)
         mkdir -p obj/com/example/myapp/util
         javac -d obj src/com/example/myapp/util/Speak.java
    
         # compile application file against Speak.class
         mkdir -p bin/using_class_files
         javac -d bin/using_class_files -cp obj src/com/example/myapp/MyApp.java
    
         # run application
         java -cp obj:bin/using_class_files MyApp
    
    .PHONY: using_jar_file
    using_jar_file:
         # put Speak.class into a Java archive (util.jar)
         mkdir -p ext/com/example/myapp
         jar cvf ext/com/example/myapp/util.jar -C obj/com/example/myapp/util Speak.class
    
         # print util.jar table of contents
         jar tf ext/com/example/myapp/util.jar
    
         # compile application against util.jar
         mkdir -p bin/using_jar_file
         javac -d bin/using_jar_file -extdirs ext src/com/example/myapp/MyApp.java
    
    .PHONY: clean
    clean:
         rm -rf bin ext obj
    I use to make my orders are repeatable. the Makefile is 'quick and dirty '. Emphasis is placed on the keywords 'package' and 'import' of Java and command line tools and their options (javac, jar and java).

    Compile the utility class (Speak.java), compile the application (MyApp.java) against the tree of bytecode (. / obj) and running the application against the tree quote bytecode:
    2013-05-11 20:23:58 dpchrist@desktop ~/sandbox/java/jar
    $ make clean
    rm -rf bin ext obj
    
    2013-05-11 20:24:01 dpchrist@desktop ~/sandbox/java/jar
    $ make using_class_files
    # create utility bytecode file (Speak.class)
    mkdir -p obj/com/example/myapp/util
    javac -d obj src/com/example/myapp/util/Speak.java
    # compile application file against Speak.class
    mkdir -p bin/using_class_files
    javac -d bin/using_class_files -cp obj src/com/example/myapp/MyApp.java
    # run application
    java -cp obj:bin/using_class_files MyApp
    hello, world!
    Put the bytecode of the utility (Speak.class) file in a JAR file (util.jar) works, but compile the application against the tree in the POT (. / ext) fails:
    2013-05-11 20:24:08 dpchrist@desktop ~/sandbox/java/jar
    $ make using_jar_file
    # put Speak.class into a Java archive (util.jar)
    mkdir -p ext/com/example/myapp
    jar cvf ext/com/example/myapp/util.jar -C obj/com/example/myapp/util Speak.class
    added manifest
    adding: Speak.class(in = 572) (out= 364)(deflated 36%)
    # print util.jar table of contents
    jar tf ext/com/example/myapp/util.jar
    META-INF/
    META-INF/MANIFEST.MF
    Speak.class
    # compile application against util.jar
    mkdir -p bin/using_jar_file
    javac -d bin/using_jar_file -extdirs ext src/com/example/myapp/MyApp.java
    src/com/example/myapp/MyApp.java:1: error: package com.example.myapp.util does not exist
    import com.example.myapp.util.Speak;
                                 ^
    src/com/example/myapp/MyApp.java:4: error: cannot find symbol
         Speak s = new Speak();
         ^
      symbol:   class Speak
      location: class MyApp
    src/com/example/myapp/MyApp.java:4: error: cannot find symbol
         Speak s = new Speak();
                       ^
      symbol:   class Speak
      location: class MyApp
    3 errors
    make: *** [using_jar_file] Error 1
    Any suggestions?

    TIA,

    David

    Normally, you would run javac from the 'src' directory, so:

    javac [options] com/mycompany/whatever/package/MyClass.java
    

    It will then automatically find or compile all the other classes that are correctly under 'src' under their packages.

Maybe you are looking for

  • Tecra 8100: vertical stripes on the screen

    I just bought a second hand Tecra 8100, who has been stripped of all its programs, OS. So I installed Windows98SE on this - now I get a screen with vertical stripes, which perch in the middle of the screen of the laptop with Windows just about visibl

  • Satellite C855-2J7 - Fn button reverse

    Hey guys,. for some time, I have the annoying problem that my "FN" key seems to be reversed. I have no chnge one of these parameters, and recently all keys of my superiors can be used by pressing the fn. As before everything worked without it. I have

  • Satellite A500 - how to restore factory settings?

    Hello I had software problems with my A500. I made the recovery disc. I tried to find a way to use these but can't find it in the manual that I downloaded. Am I just thinking I have the boot disk 1 in the drive of the computer lights up continuously

  • Photosmart 3210xi, photo tray does not properly

    After years of trouble-free use of photo printing to 4 X 6 borderless completely.  The photo tray started loading paper 4 X 6 with a margine (barely perceptible) light white. Little time photo tray continually trying to load, emits a sharp turning so

  • Why when I type the cursor jumps and the words in the previous sentence

    When I type an email the cursor seems to go to what I wrote previously. I have to stop and go back to elimanate the words so I can continue typing. This boring and tedious. The words blend together in the early writings. What is the cause?