Running Java app on UNIX

Hi all, Any kind of help is much appreciated.
I am trying to run a Java program on Unix which also imports packages of a 3rd party vendor.
I run it from the directory where i have my MyProgram.java file stored and also provide the classpath for the .jar/.zip files of the 3rd party vendor (using -classpath option with javac)
Compiling is clean with no errors.
But, on running the java command: java MyProgram
It gives me java.lang.NoClassDefErrorFound for a class which came with the 3rd party vendor.
The class is present in the .jar file, which I provided in the -classpath option with javac. There are many other classes present in the same .jar file which are being used in the program but it just gives the error for this particular class.
-I also tried by saving that class in my current directory and compiled it with
javac <-classpath> MyProgram.java 3rdVendor.java
command and created its .class file in the current directory but then again using java command from the same directory gives the same error: java.lang.NoClassDefFoundError
Plzz....help
Thanx Shaan

here is the command i used
javac -classpath .:/home/top/MyName/dir1/jcommom-0.9.7/jcommon-0.9.7.jar:/home/top/MyName/dir1/jfreechart-0.9.21/jfreechart-0.9.21.jar DyanmicChart.java
COMPILATION IS WITH NO ERRORS
and then I run java from the same directory where i have DynamicChart.class built
java DynamicChart
error in class Main : java.lang.NoClassDefFoundError for org/jfree/data/time/RegularTimePeriod
RegularTimePeriod is present in jfreechart-0.9.21.jar and its .java file is located in the folder jfreechart-0.9.21/source/org/jfree/data/time/RegularTimePeriod.java
There are lot of other classes that I use from .jar files mentioned in the classpath but its just this one class. I also saved the RegularTimePeriod.java file in the pwd to built its .class in the current directory and compiled it using the above (javac) command with DynamicChart.java. AGAIN NO COMPILATION ERRORS...but the same error when i run: java DynamicChart
Shaan

Similar Messages

  • What is needed as a minimum to run Java apps?

    Hello,
    I'm running Windows 2000 Pro on a home computer and want to conserve disk space. There seem to be a lot of duplicate files in Java directories on my system. I only want to be able to run Java apps - no development or deployment. What is the minimum installation required to just run apps?
    I currently have J2SE Runtime Environment installed.
    Thanks in advance,
    Kudzuken

    I could get all technical and fancy on you, tell you about jre's that can run on palm pilots and such, but nevermind that stuff.
    The answer is that the java 2 runtime environment is all you need
    Be careful about moving and deleting files tho
    Hello,
    I'm running Windows 2000 Pro on a home computer and
    want to conserve disk space. There seem to be a
    lot of duplicate files in Java directories on my
    system. I only want to be able to run Java apps -
    no development or deployment. What is the minimum
    installation required to just run apps?
    I currently have J2SE Runtime Environment installed.
    Thanks in advance,
    Kudzuken

  • How to run Java App in Jar file

    I can run Java App jar-ed into 1 jar file with java -jar App.jar
    But sometimes I need to jar only the app and bind the other classes from different place. So I tried to use:
    java -classpath c:\utils.jar -jar App2.jar
    where classes in App2.jar link to utils.jar. I just can't make it work. Any idea/help.
    thanks
    -ho

    hi HasanOen
    u need to edit the manifest file in yr JAR file u can do this by using the following cammand or by making the batch file but make sure all the files are in same folder.
    first of all u need to make a text file like below
    /////////// first file name: "THIS.txt" /////////
    Manifest-Version: 1.0
    Created-By: java // whatever here
    Main-Class: PUT YOUR MAIN CLASS NAME HERE (like MAIN)
    //////////////////// BATCH FILE "RUN.bat" //////////////
    jar cmf This.txt App2.jar MANIFEST.mf com
    com is the folder where your all the class file are.
    now double click the run.bat file. this will edit yr manifest file.
    hope this should work for u
    Note : Make sure yr jar file, txt file, bat file, and yr classes folder is in the same folder(I mean at same level)
    regards
    Satinderjit

  • Running Java app when java not installed

    I need to run java apps on a server I don't control and the admin will not install java. :(
    Tried a few things to run java without installation, but get error that a java registry item can not be found. "Error opening registry key 'Software\JavaSoft\Java Runtime Environment'" Might be that without control of the registry, there's no way to run the java engine, but curious if there's a way to get it to run... I'm gonna play around with it, but figured if someone out there knows it's not possible, they could save me time by letting me know.
    Thanks!

    Depends on what you want to run. To run an applet on the computer requires that the JRE be installed, as the applet needs the Java Plug-in and Registry keys that the JRE install includes. To run a Java program from the command line needs a copy of the JRE, but it does not need to be "installed" by the Java installer. Then the command "java ... classname" needs to include the full path to the java executable that the JRE contains.
    There might be websites that allow you to run certain kinds of Java programs on the website. I don't know if they still wxist. I also doubt that they'll run applets.

  • Run Java App as a Windows Service

    Hi,
    Is there an easy way (without 3rd party software) to run a Java app as a service in windows?
    Sorry if this isn't the right forum to post to...
    Any help would be greatly appreciated!
    Thanks in advance!

    Nope there isn't. And there also isn't a reason not to use 3rd party software as there is an excellent open source API to do this job: Java Service Wrapper.

  • Running jave apps in web browser

    Hi,
    I'm (very obviously) new to java.
    Longer term I'm looking to develop a distributed application using java. I recently saw a java app that ran in a clients web browser. I assumed that the browser was using java applets, it wasn't. The web page I was looking at clearly had functionality on it that was well beyond that which could be produced by an html page.
    I was told by the person showing me the web page that when the user hit the URL the system would download and install "jar" files if they weren't already installed and the application would run.
    The page had on it a table (datagrid) which could be sorted by clicking on any of the table headings.
    Being new to java I'm unsure what this technology is, if it is not an applet, and how it works. Is anyone out there able to give me a brief high level description of what particular part of the java technology this is (does it require J2SE or J2EE).
    Many thanks...

    1) The "grid" is a JTable component, which is available in applets, providing the plug-in/JRE is of a more recent (1.2+) vintage.
    2) Applets are not HTML - they're little Java programs, which means they can use Swing, which is a much richer UI environment than any HTML page (including DHTML). See #1
    3) Applets are embedded in HTML pages, so they kinda look like they're part of the page, just like using a TABLE tag.
    4) Current JRE/plug-ins cache the applet JAR files, so it's easier to start next time you run across that page.
    5) Web Start is another distribution option, wherein the JRE/plug-in is used to retrieve and update "fat" (stand-alone) applications via a web site, but the browser is not required to run the application. The only time the browser is involved is on the initial download of the application.
    6) J2SE downloads include Web Start.
    Methinks you'd be better off studying and understanding the Java technologies better before you decide you're going to use it...

  • Run Java App in a CD

    Hi. I want to develop a java application that can be run from a CD... No installation required. The idea is to distribute an application that users will be able to use by just running the java app in a CD. Can this be done? Can this java app in CD run on windows, linux, and mac?
    Please help... I am new to java and some sample codes or procedures/steps will be a big help.
    Thanks!

    No the dbf route doesn't have SQL (unless you're willing to pay for propitiatory database drivers), but you read it in row by row and then pull out the columns you want. You could create several dbf files on the CD which would be like different select statements. I only mention this because .dbf is probably easier than an embedded database. Take a look at the API. (I highly suggest going this route if possible it will simply development) .dbf files are just a spec, so they would work on linux.
    http://www.svcon.com/jdbf/docs/index.html
    If you feel you really need to be able to create select statements take a look at :
    http://www.oracle.com/database/berkeley-db/je/index.html
    Message was edited by:
    ZimmerS1337

  • Unable to run Java Command (on UNIX)

    Hi,
    When I try to run Java command:
    java ChatServer 9830
    I get the following error:
    /usr/bin/java: line 67: /tmp/javaJb9694: Permission denied
    /usr/bin/java: line 67: /tmp/javaJb9694: Success
    Could any one suggest what could be the reason and solution.
    The site is hosted on a UNIX palatform and we are using Tomcat.
    Thanks & Regards,
    Joy.

    lol
    How would we know? We don't know your setup, we don't know your software, we don't know what happens...
    It doesn't even look like a standard Java message to me.

  • Run Java app on Time

    I've created a standalone Java app that must run at certain times in the day, can anyone recommend how the best way to do this is, its going to run on a windows box!!

    i would suggest you get some scheduler to do this for you. windows comes with one of these (programs > accessories > System Tools > Scheduled Tasks)

  • How do I run java app when user calls a number?

    Hi all
    Is it possible to run a java app everytime a user calls a number? It has to run before the call is placed. The app will do its job and then place the call using PlatformRequest().
    Thanks
    hsogra

    Hi,
    I believe in general this is not possible.
    J2ME was designed in such a way that J2ME apps don't have permission to interrupt the normal functions of the phone (making/receiving calls, sending/receiving SMS).

  • Run java app on N9

    How do I run a java app [mobile banking app] on my N9 ?
    Frankly , I truly regret buying N9. It doesn't have whatsapp, viber, java support,low single retention etc. I am trying to live with it till I can palm it off to my enemy.

    It doesn't look very promising according to this link:  http://forum.meego.com/showthread.php?t=4012 

  • Run Java app as admininistrator

    Hi,
    how can I invoke the apple SecurityAgent to ask the user to authenticate? This one:
    !http://www.bol.ucla.edu/software/sophos/img/install_osx3.png!
    I have developed a java app that requires privileges to run. Right now I'm starting it from the command line using
    sudo java -jar MyApp.jar
    But how can I run it as administrator by doubleclicking on the JAR file?
    Message was edited by: Mine82

    Hi
    Welcome to Apple discussions.
    I think you need to invoke the JAAS infrastructure, but I've never done this myself and it sure looks complicated. See http://java.sun.com/j2se/1.5.0/docs/guide/security/jaas/JAASRefGuide.html
    Good luck (I think you're going to need it)
    Bob

  • Form become white after running java app. under windows XP

    Hi,
    i developed an application (Form base application) that connect to FTP server and connect to a server via telnet.
    The application is running fine until i'm trying to run it under Windows XP.
    when i'm running the applicaion under windows XP and sending data, the form become WHITE (looks like stuck program).
    the app. is still running but the user think the app. is stuck.
    i try to INVALIDATE the form every time the loop is sending the data and many more ideas but it is still become white.
    the app. is working greate under windows 2000, 98, ME.
    does anyone know this problem and how to fix it?
    Thanks Guy.

    i "just" develope an application that connected to an exsiting servers and upload data to them.
    the problem is that when i run this app. under windows XP, the screen ( the application created in "Form Base") become white, like the program is stuck.
    there is no error, it's seems to be an invalidate problem, but i try to out invalidate everywhere but it is still doen't fix this problem.
    the app. doesnot stuck, it is just looks like that!!!!!
    the weird thing is when i run this app. under all other windows, it's working fine.
    if anything is not clear, write back.
    thanks.

  • Help running Java apps in Mac OS 10.1.3

    I'm currently taking an intro course to Java and I've been using the OS 10.1.3 Unix Shell to compile and run my assignments, using the "javac" command to compile my classes and the "java" command to run them. It's been working fine until a few days ago when every class I started to compile from that day on wouldn't run. The previous classes I've compiled run fine, however if I re-compile them and attempt to run them I incur the same problem.
    I get this error :
    Exception in thread "main" java.lang.NoClassDefFoundError:
    followed by the classname.
    The best I can figure is that I've accidently changed some option in the java system, but now I have no idea as to how to change it back. I've asked my CS professor what to do but ofcoarse he's a PC user and when he hears Mac he just replies "I don't know about Macs" eventhough I've tried telling him that OS X is unix based. Anyways, if there are any well informed Mac OS 10.1.3 users out there, please help me so that I can resume my CS assignments on my Mac.
    Thanks,
    Craig

    1. Are you certain that you have all of your java files compiled
    and that their class files are in your classpath? Did you import
    the class TestWeeklyEmployee in your java file that has your
    main method? Do all of your class filenames have the same
    name (minus the .java or .class) as the class in the file?All of the java files needed to run the class are in the same directory, and they all have the correct names, You see I'm able to run my programs perfectly on other machines, infact I have to test them in the computer labs before I turn them in. So I know that my probrem isn't a syntax error.
    2. when you start the terminal, type the following:
    echo $CLASSPATH
    and make sure that the output it gives has the . [dot] that you
    added via the .cshrc file at the end or that only a dot gets
    displayed. If it does not have your dot in the output, then you will
    have to use the -classpath option to the java runtime binary to
    tell it where your classes are located.I tried typing echo $CLASSPATH but I got this error message:
    CLASSPATH: Undefined variable.
    And I had directly copied the code you wrote into my .cshrc file.
    3. When you try to run your java program, are you sure that you > are in the directory where all of the class files are located? use
    the "ls" command to see if your class files are in the current
    directory. (you may want to search the web for a UNIX tutorial or
    a UNIX for beginners type of article so that you can feel more
    comfortable using the Terminal application)Yes all of my classes are in the same directory and yes I'm in the correct directory when compiling and attempting to run my programs.
    4. Assuming that 3 is true: If you run your program using the
    "java -classpath . MyClassWithAMainMethod" do you still get an
    error? If you do, then I am pretty sure that you have neglected to
    import a class that your main method is trying to instantiate or
    that you have not compiled the source of the class in question >
    (or both).All classes are imported correctly and yes I have compiled the class. As I said it works fine when I compile and run on other machines, just not mine.
    Are you trying to install the developer tools from the developer
    cds? If you are and you have since updated your OS to 10.1.x,
    then I would not expect project builder to work. The same thing
    happened to me when I upgraded to 10.1.x. Sounds like you
    may need to install the latest developer tools which can be
    downloaded for free from the Apple Developer Connection site
    (http://www.apple.com/developer). Installing the latest developer
    tools should get things right for you.The developer tools that I'm attemping to run are not from the CD, they're the current downloadable version from apple developer. I've contacted apple developer support with my problem with project builder, but they blew me off.
    So now that we've eliminated these possibilities, any other ideas?
    Thanks,
    Craig

  • How to run java application in Unix Box

    Hi,
    Would anybody show me how to run my server application in unix box?
    Thank you very much.
    Hung

    Your application should have a main class. Suppose it's called MyMain.class. I'll assume it's in the anonymous package. So you cd to the directory containing the class, and type java MyMainIf it's not in the default package, or is a jar file, say so.

Maybe you are looking for

  • Changed file location in catalog to backup drive location

    Photoshop Elements 6 (20070910.r.377499) I do not know why the catalog has changed the file location of "ALL" pictures to the location on my backup drive. Example: K:\My Documents\My Pictures\Pets\PICT1460-1.JPG The actual location of the original ph

  • Captions in Pages

    When using Pages, when I put in a photograph and then put a caption with it the caption font is always in helvetica. I want to use Times New Roman. The only way I can change it  its do it individually on each caption. Is there any way I can fix this

  • Not render any field search criteria initially in Advanced Search Panel

    Hi Everyone! It's possible to hide or remove all field search criterias initially in Advanced search panel. We need that initially doesn't exist any field search and the user use the 'Add another' option when him need add search criterias. Thanks, Ca

  • G5 only starts up in Safe Boot mode

    We have an older model G5 Dual (no Intel Core) at the office that we tried to install CS3 on. I told them that first we would need to upgrade from 10.3.8 to 10.4.10 -- which they did, and then installed CS3. But they did it without running the disk u

  • Instering MPEG-4 video

    I am new to Dreamweaver and have been teaching myself basic functions in order to update our webiste.  However, one thing I just can not figure out is what I need to do to upload/insert a MPEG-4 video to the site. MPEG-4 is not an option in the "Inse