Another simple classpath problem question

Hi All
Yes I know, there are a lots of questions about this matter, but I couldn't found a solution to my problem.
I have a simple program:
public class prueba {
        public static void main(String[] args) {
                System.out.println("Ahi va...");
}placed in /tmp/javier/prueba.java
After compiled, I've tried to run it from / and then problems started:
cd /
java /tmp/javier/prueba
Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
I said, ok...it could be a classpath problem...then:
java -cp /tmp/javier/ /tmp/javier/prueba
Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba
Damn, another try...
java -cp .:/tmp/javier/ /tmp/javier/prueba
Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
Jesus Christ....may be the last slash....
java -cp .:/tmp/javier /tmp/javier/prueba
Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
Oh...no.... may be classpath to java classes..
java -cp .:/usr/java/j2sdk1.4.2_01/lib/jre/:/tmp/javier/ /tmp/javier/prueba
Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
Well, I don't know why this error happens....
Please, could somebody help me !!!
Thanks in advance...
<jl>

It's not too early to start following the Sun coding
conventions for Java:
http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.
tmlHi
thanks for your reply.
Yes, I agree. I use conventions with my programs. But my real problem was with a real application and then I did quickly this simple code to help others to understand the problem and give a fast reply...
Let me know if that works. (It was fine on my
machine.) - MODYes it works fine, thanks.... and Damn...Murphys law again, the only option I didn't tried is the solution to my problem... :)
Thanks again...

Similar Messages

  • Real simple xslt problem/question

    Hi, i have a real simple xslt problem but i just cant figure out how to do it by looking at various examples on the net. i have a xml document and in it are some elements with a "result" tag name. i want to use xslt to reproduce exactly the same xml document except with an attribute called "id" added to those elements with a "result" tag name. i'm sure that theres a simple solution to it but i just cant figure it out. any helps greatly appreciated, thanks

    Start with the XSLT identity transform (I don't have it handy and it's fairly long, but you should be able to google it up). Add this:<xsl:template match="result">
      <result id="">
        <xsl:apply-templates>
      </result>
    </xsl:template>

  • Another idiotic CLASSPATH problem

    I'm a bit new to both Java and Linux, so this is probably not as complicated as I think:
    When compiling with javac, or running with java, I have found it necessary to add "-cp $CLASSPATH:$PWD" or files in the current directory will not be found. Is there a way to make Java search the current directory automatically? Honestly, it's a little surprising that it doesn't....
    And, on the same subject, I had to set up CLASSPATH manually; which directories in the JDK folder is it supposed to point to?
    Many thanks,
    Andy Sommerville

    Hey! Fixed it myself:
    The problem was that I had not added "." to CLASSPATH. Pretty obvious.

  • HELP - Another simple JMS Problem

    I'm getting:
    JNDI API lookup failed: javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    When I try to look up a JMS ConnectionFactory I've defined in Sun App Server. I'm not sure whether the protocol is correct...the documentation says to use "jmsmq" as the protocol, but I get "unsupported protocol" when I try that.
    Here is the code:
    package com.tpc.jms.simpleProducer;
    import javax.jms.*;
    import javax.naming.*;
    import java.util.Hashtable;
    import java.util.Properties;
    public class SimpleJMSTest {
    public static final String PROVIDER_URL = "iiop://localhost:3700";
    public static final String CONTEXT_FAC = "com.sun.jndi.cosnaming.CNCtxFactory";
    public static void main (String argv[]) {
         try {
    Properties properties = new Properties();
    properties.put(Context.PROVIDER_URL, PROVIDER_URL);
    properties.put(Context.INITIAL_CONTEXT_FACTORY, CONTEXT_FAC);
    properties.put(Context.SECURITY_PRINCIPAL, "guest");
    properties.put(Context.SECURITY_CREDENTIALS, "guest");
    properties.put("server.jms-service.init-timeout-in-seconds", "60");
    properties.put("server.jms-service.type", "EMBEDDED");
    properties.put("server.jms-service.start-args", "");
    properties.put("server.jms-service.default-jms-host", "default_JMS_host");
    properties.put("server.jms-service.reconnect-interval-in-seconds",60);
    properties.put("server.jms-service.reconnect-attempts", 3);
    properties.put("server.jms-service.reconnect-enabled", true);
    properties.put("server.jms-service.addresslist-behavior", "random");
    properties.put("server.jms-service.addresslist-iterations", 3);
    properties.put("server.jms-service.mq-scheme","mq");
    properties.put("server.jms-service.mq-service","jms");
    properties.put("server.jms-service.property.instance-name", "imqbroker");
    properties.put("server.jms-service.property.instance-name-suffix", "");
    properties.put("server.jms-service.property.append-version", false);
    properties.put("server.jms-service.property.user-name", "admin");
    properties.put("server.jms-service.property.password", "admin");
    InitialContext initialCtx = new InitialContext(properties);
    ConnectionFactory connectionFactory = null;
    Destination dest = null;
    try {
    connectionFactory = (ConnectionFactory) initialCtx.lookup(
    "jms/ConnectionFactory");
    } catch (Exception e) {
    System.out.println("JNDI API lookup failed: " + e.toString());
    e.printStackTrace();
    System.exit(1);
    catch (Exception e) {
    e.printStackTrace ();
    }

    why iiop?

  • Another simple questions

    Hello friends:
    Another simple question: I need to learn things about Oracle on my desktop.
    My machine runs Windows 98. Oracle has some desktop product of its Database Line?
    For example: Oracle Personal?
    And Oracle Lite? What's the main difference between Oracle Personal and
    Oracle Lite?
    Thank You
    Gracias
    Ing. Pablo Romero
    CORDOBA ARGENTINA

    1. I didn't know the answer to your first question, but I googled it and it says the item is the in-call audio boost.
    http://forums.crackberry.com/f71/flag-icon-47659/
    2. isn't this setting determined by the carrier? So it's not a setting in the phone, but when you call in to your voicemail you can change your options?

  • Classpath problem

    i am here stuck..
    my dir structure is
    c:\my\xxx\yyy\zzz
    i have a code ...
    package xxx.yyy.zzz;
    class A
    // some code
    }i have compiled sucessfully and put the clsss file into c:\my\xxx\yyy\zzz folder.
    now i want to import it in another class
    like...
    package xxx.yyy; // note this
    import xxx.yyy.zzz.*; // note this
    class B
    // some code
    // creating instance of class A here
    }question is how do i compile and run it ?
    i am at c:\my---> what should be the command to compile and run the above code?
    plz give me the explicit command so that i can test and verify . i have given the dir structure.
    i have tried several ways but got class not found exception and errors . i know its a classpath problem but i could not figure out what should i type at the c:\my prompt.
    can u give exact command to run and compile the above code in steps ?
    thanx

    question is how do i compile and run it ?You don't with that code. You've defined class A to have "package visibility," meaning it can't be used from outside its package. You should declare it with public visibility instead, like "public class A {...".
    Once you change that, use these commands to compile and run:c:\my\>javac xxx/yyy/zzz/A.java
    c:\my\>javac xxx/yyy/B.java
    c:\my\>java xxx.yyy.B

  • Few problems/questions! (cover flow, album art...etc)

    Ok I finally added my songs to my new IPOD (replaced my old one) and this is my first Ipod with video, color...etc. Its the IPOD Classic 80 GIG.
    Well I am having a few problems/questions:
    ---Why when I hit "Get album art" does it ONLY get art for my videos? It doesn't get any for all 1,500+ songs! Is it because they aren't downloaded from Itunes? If so then why does it do it for the movies then? They aren't from ITunes either!
    ---With Cover Flow I updated the Album Art myself and have about 700 songs with art now. But I have two problems.
    1. It won't display all 700 songs under Cover Flow!
    2. It won't show them in order by song name! Can I change that?!? If not then how is it showing them by? What do I need to change?
    ---Are there any other video types supported besides that on Mpeg4 and that other weird type? If not why not? Its a pain to have to convert everything. Its almost not worth having this video IPOD if you have to go through sop much effort just to watch 1 stupid video. I mean I spent more money on extra programs now for music and videos then I did on the IPOD almost.
    ---Is there any way to transfer your music from one IPOD to another? I know some people say you can't but why? What about people like me who have music ripped from our own cds and NOTHING from ITunes? Its a REAL pain having to rerip all the cds, put them back on, rename all the songs, fix all the info...etc. Its taken me 4 days now. Apple needs to think about a "IPOD TO IPOD" music transfer kinda program.
    ---How do you get pics on the IPOD without having to keep them on your PC? I notice it has to SYNC them every time I have it plugged into the PC! But if I tell it NOT to sync pics anymore then they won't stay on the IPOD if turn that option off and unplug the IPOD. Theres got to be another way to add them.

    Assassin X wrote:
    ---With Cover Flow I updated the Album Art myself and have about 700 songs with art now. But I have two problems.
    1. It won't display all 700 songs under Cover Flow!
    2. It won't show them in order by song name! Can I change that?!? If not then how is it showing them by? What do I need to change?
    Cover flow on the ipod can only be done (as far as I know) on Album by Artist Name. On iTunes you can change it around
    Assassin X wrote:
    ---Are there any other video types supported besides that on Mpeg4 and that other weird type? If not why not? Its a pain to have to convert everything. Its almost not worth having this video IPOD if you have to go through sop much effort just to watch 1 stupid video. I mean I spent more money on extra programs now for music and videos then I did on the IPOD almost.
    Try using freeware, heres an excellent video converter for iPods:
    http://www.videora.com/en-us/Converter/iPod/

  • JDBC and Classpath problems on OpenVMS

    Hello,
    I'm working on an OpenVMS server and I got a simpler Java application that needs to establish a connection to an Oracle database, the application works perfectly well on Windows but when I moved to OpenVMS I got some problems with the oracle driver.
    I believe I�m using the correct driver, I already checked on the oracle site according to my java version (1.4.2) and my database version (oracle 9i 9.2.0.7.0)
    This is the error:
    $java -jar miss.jar "DnBProcess"
    About to start loading parameters for the MISS Proxy.
    Successfully load parameters for the MISS Proxy.
    About to load interface settings for DnBProcess
    Settings for DnBProcess succesffully loaded.
    About to load interface DnBProcess
    About to start loading parameters for DnB Interface.
    Successfully load parameters for DnB Interface.
    Interface DnBProcess succesffully loaded.
    About to execute interface DnBProcess
    Connecting to the database...
    java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver
    at miss.DnBProcess.ExecuteQueryToFile(DnBProcess.java:85)
    at miss.DnBProcess.Execute(DnBProcess.java:178)
    at miss.Proxy.ExecuteInterface(Proxy.java:160)
    at miss.Proxy.main(Proxy.java:207)
    I know is a classpath problem, and my classpath on VMS looks like this:
    define JAVA$CLASSPATH .,SYS$COMMON:[JAVA$142.LIB]TOOLS.JAR,SYS$COMMON:[JAVA$142.LIB]DT.JAR,SYS$COMMON:[JAVA$142.JRE.LIB]RT.JAR, USER1:[MONTEALEGRE.TEST.LIBS]OJDBC14.JAR,USER1:[MONTEALEGRE.TEST.MISS.LIBS]OJDBC14.JAR,[]
    As you can see I added the �ojdbc14.jar� in different folders but my application seems not to find it.
    Does anyone know how to set the classpath properly on VMS? Or maybe give me some tips that could lead me to find a solution to this problem.
    Thanks.
    Ileana.

    I would try googling for OpenVMS classpath. Unfortunatley the first result is this thread but there are a bunch of resources from IBM and HP listed and maybe they can help you.

  • 5610 problems/questions

    Okay, i have a 5610, firmware v9.4, and i have the foll problems/questions...
    1) The calender and alarm systems sometimes refuse to work. In the calender, i put reminders, but often it never gives any alarm, even though i have set it to alert me at such-and-such time. The alarm too, simply doesn't work at times. any solutions?
    2) On starting the phone, while updating the library, the phone temporarily gets hanged. After about 5 minutes, its back to normal, and the library is updated, but in those 5 mins i can't do anythinh. any solutions?
    3)On connecting my cell to the comp, i usually use memory storage mode, to access the memory card in windows explorer, cuz its faster than pc suite. afer disconnecting, my phone often says "not enough memory on phone. update cancelled", referring to the music player library update. any solutions?
    4)In menu>steeings>security>security level, what do the options do, i've not noticed any difference...

    security level is to either set passwords for start up of phone ,keypad locks,lock code for phone this enable you to put a pin on the phone where if it was to get stolen the person would need a pin the activate the phone with another sim in it
    If  i have helped at all a click on the white star below would be nice thanks.
    Now using the Lumia 1520

  • Simple Crop tool question... how do I save the crop section?

    Hi,
    I have a very simple crop tool question. I'm a photoshop girl usually... so Illustrator is new to me. When I select the crop section I want... how do I save it?... if I select another tool in the tool panel, the crop section disappears and I can't get it back when I re-select Crop tool. If I select Save as... it saves the whole document...and not just my crop section.
    Like I said, simple question...but I just don't know the secret to the Illustrator crop tool.
    Thanks!
    Yzza

    Either press the Tab key or F key.

  • Yes another user with problem with Apple Mobile Device Support, I am getting the error message: Service 'Apple Mobile Device'(Apple Mobile Device) failed to start. Vertify that you have sufficient privileges to start system service....

    Yes another user with problem with Apple Mobile Device Support, I am getting the error message: Service 'Apple Mobile Device'(Apple Mobile Device) failed to start. Vertify that you have sufficient privileges to start system service....I hit retry and it came up again. I hit ignore and it prompted me to hit finish so Itunes can open.   I looked thru alot of these posts on here to try and resolve this problem myself but it's not working too well...I downloaded Itunes to my desktop so I can right click it with the program i downloaded called WinRAR. I extracted it and then went into the folder called Itunes64setup. I saw the file called AppleMobileDeviceSupport64 in there so I began to try and download it on it's own. Well that didn't work as I planned and got this error message:
    Apple Mobile Device Support wasn't installed on your computer. The installer encountered errors before Apple Mobile Device Support could be configured. Your system has not been modified. To retry these operations at a later time,please run the installer again.
    Well I tried to run it again and came up with the same message...I see that some people got great support to help them so I am hoping someone can help me as well. I know "b nor" is very qualfied and hopefully can help me! Please advise what I can do. Thank you

    Hi Iss9243,
    Welcome to the Support Communities!
    You've already tried some great troubleshooting steps, but the article below gives you quite a few more for this issue.  Hope it helps ....
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Cheers,
    - Judy

  • Another Unlimited Data Upgrade Question

    (Yes, it's another one of those questions.  I'm sorry, but searching - on here, or on Google - only left me with conflicting information.)
    Here's my question:
    A friend of mine is interested in selling me his Galaxy Nexus phone.  Would I be able to keep my single-line, grandfathered, unlimited data plan if I buy his phone and switch to it, or is that only possible if I were to buy the phone new, directly from Verizon?
    Here's my story:
    I have an HTC Thunderbolt that I purchased when it launched.  A few months after buying it, it turned into the HTC Bad Dream, and now it's the HTC Nightmare.  Random heat issues, battery draining, random reboots... It's the same song and dance we've heard before.  These are design issues with the phone; not something a replacement or a repair would fix.
    The real annoyance, though, is the mobile hotspot.  I pay $30/month to use the hotspot legitimately, unlike the users who root their phones to use it without paying for the option, but ever since Verizon started blocking the third-party wireless tethering apps, I've had to choose between using the stock mobile hotspot app and unleashing the above-mentioned Phonemageddon, or simply going without.  I could drop the option from my plan, but seeing as the unlimited data plan no longer exists, I wouldn't be able to get it back without switching to a tiered or shared plan.
    Switching to a more stable phone would alleviate my issues, hopefully, but the difference between Verizon's retail prices and other retailers is hundreds of dollars.  Giving up my unlimited plan, however, wouldn't make the venture worth it.  A definite answer to the question of buying used - either from a Verizon representative, or a customer who's been in the same scenario before - would be very helpful.
    Thank you very much.

    Hi,
    If you provide your own equipment (your friend's Nexus or from ebay etc) then YES you can keep unlimited data. Another wayto keep unlimited would be to pay full retail for a new phone. But I'm sure your friend will give you a better deal than that
    Hope that helps!

  • JDeveloper IDE simple setting problem

    Hi,
    Recently we switched to JDeveloper from Visual Cafe .I have a simple setting problem.How can I set the options so that IDE gives, the core java classes and packages,and our application classes and packeges, prompts in imports as well as in code.Where to set the options.
    eg: when I write
    import java. it should prompt all the pakages.
    Thanks in advance.
    -Gopal
    null

    I am not sure I understand what you are requesting, but ...
    You can configure JDeveloper projects to include various libraries by default.
    This is done by selecting menu Tools | Default Project Properties.../ Libraries tab.
    You should define a library for your classes.
    You can import any of the packages / classes from all the libraries which your project includes.
    It would be incorrect for a tool to automatically add a bunch of import lines at the top of every file because each file should import what it needs and just as importantly, not import what it does not need depending on the component type (e.g. a servlet should not include javax.swing.* ).
    An easy way to import elements into JDeveloper is to type in something like:
    import java.
    // and then type in Ctrl Space
    and this launches the package browser, you can select packages or classes to import.
    You can also do this at the variable declaratiton point such as typing in:
    foo() {
    Frame x
    // Press Control Alt Space
    and this will correctly change the type (Frame) to the type you select in the package browser and add the import statement.
    -John
    null

  • Classpath Problem (Using JSAPI)

    Hi,
    I using IBM Via Voice as a the implementation of the JSAPI on my system. I've downloaded the speech for java pack from IBM Alphaworks and put it in the directory of
    c:\ibmjs
    This gives you access to the speech packages for utilisation in your programs so I should be able to import javax.speech in my programs. However the system doesn't see these classes.
    Heres my Autoexec...
    path=%path%;c:\jdk1.3.1_01\bin;c:\ibmjs\lib;
    CLASSPATH=%CLASSPATH%;c:\ibmjs\lib\ibmjs.jar;
    I presume the whole thing is just a classpath problem, does anybody have any idea from the above paths where I am going wrong?

    i guess you have to put some of ibm's dll files coming with speech for java in the path (not classpath). it's not sufficient to have the directories in the path.
    anyway, there come's an installation manual with speech for java which explaines all that.

  • Fragment Bundle Classpath problems

    Does anyone have any tips for solving classpath problems in fragment bundles? I'm getting a no-class-def that I can't explain.
    I've used maven to create a fragment, hosted by com.day.crx.sling.server, to create a custom login. It needs to call a web service, so I've included httpclient-4.2.3.jar. I can see this jar listed on the deployed fragment's Bundle-ClassPath, via the osgi>bundle console. When I inspect the bundle that maven created, I can find this jar contained in the bundle jar, in the directory specified in the Bundle-ClassPath. I even oppened the httpclient jar to ensure that the offending class (org/apache/http/client/HttpClient) is there.
    This is the first fragment that I've tried to build. Is there something I don't know about how they load classes?
    Does anyone have any tips or tricks on solving osgi classpath problems? I read that felix has some tools, but I haven't found any documentation about them.

    I'm still not sure why the classes didn't load, but I have a solution to my problem - don't try to include the jars in the fragment bundle. I tracked down osgi-ready versions of the libraries that I needed and and installed them.

Maybe you are looking for

  • Multiple Nanos in Family one Nano update download?

    When ever a new version of the nano software comes up each sync takes awhile because it has to download the 54MB updater for each of my families memeber nano. Is there a way to have the download happen only once and yet update each individual nano wh

  • Could not complete the paste command because the icc profile is invalid

    Hi. In PS CS4 & AI CS4. I get the following error when I try to copy & paste a logo from Illustrator into Photoshop: could not complete the paste command because the icc profile is invalid I don't understand because the color settings are sychronized

  • Where do I put a thank you?

    DNX in .mxf with CC. Superior codec, superior wrapper, now in Premiere... Do I thank Avid for making DNX? Do I thank the guys at adobe for getting this into the suite? Do I thank the people who requested the feature? I'm a fan of Pro Res, but c'mon..

  • Error -200220 occurred at DAQmx Create Channel (CO-Pulse Generation-Time).vi:1

    Hello, Just a couple of days ago I was given a task to complete. To transfer a Labview program from a desktop computer to laptop. The program itself uses a marlin camera to count the number of seeds. The transfer was fine I installed Labview 8.2, ins

  • Adobe After Effects CS6 Ram Preview Crash Problem

    Hey, Recently my AE cs6 has been crashing when I started to RAM preview and the message that shows up is. "After Effects error: Crash In Progress. last logged message was: <1948><ai.blit.pipe><2> HardwareBlitpipe Disenaged." Specs: AMB 8150 16 GB of