Execute java program on UNIX

I have no experience on Unix and I now need to try to execute my java program on UNIX server to which I connect using telnet. I have copy my source file to the server and I could run the javac command to compile my source code.
In the current directory, I just execute "javac mySource.java"
And I got my .class file on the same directory. But when I tried to execute "java mySource", I got NoClassDefFoundError. I think it has something to do with classpath. But I just don't know how to do it in UNIX. Please someone assist me. Thanks.

Or setenv CLASSPATH $CLASSPATH:/your/classpath/here if you are running csh.

Similar Messages

  • Java program in UNIX environment

    Hi All,
    Could you please help me with how to configure a java program in UNIX environment..
    that is to schedule it to run every day from cron..
    I need to know what are the basic things we require to achieve the above..
    I guess it is:
    A script
    A config file containing db login details
    oher than this I don?t know what is required plz help

    You can execute any jar or class file with cron. If you are using a jar you might use something like java -jar /usr/bin/myapp.jar .
    I use Linux, this is my area of expertise.
    Here is an online guide "for complete newbies" on how to set up cron.
    http://www.unixgeeks.org/security/newbie/unix/cron-1.html
    Hope it helps.

  • Execute Java Program in a specific time everyday

    Hi All,
    I need help for Execute Java Program in a specific time everyday.
    I want to do insert data into database every 3:00 AM everyday.
    I thought there is a one thread program will do. It is correct my understanding? Please let me know and guide me How can I do?
    Thanks
    Amit

    If you are using Window$ then you can create a bat file to execute the program and place the bat file in Scheduled Tasks.

  • How to execute java programs in xcode

    I cannot execute Java program in XCode for Mountain Lion 10.8.2. Please help me how to execute a Java program.

    Do you have a particular error or message or diagnostic or issue, or something that's particularly wrong with Xcode?  If installed, Java does work, and Java applications can be invoked.
    Background: Java was deprecated from OS X a while back, and Java itself was removed from the default OS X 10.8 installation.
    Given that Java is now an add-on for OS X, you'll want to check with Oracle — the owner of Java — for OS X kits and tools.
    I don't know off-hand if Xcode still particularly supports Java (it was pretty weak, when last I checked), but I'd expect you'll be using makefiles for the work, and I'd also suspect that whatever Java support remains in Xcode will probably be going away in some future version of Xcode.   (If support hasn't already disappeared.  You may be using bash build scripts and makefiles to deal with Java now, or going forward.)
    If you don't have access to the Apple developer forums and the discussions of tools available there, then the archives of the Apple Java-Dev mailing list can be a good spot to look for existing discussions, and to post questions related to Java development on OS X.
    As for IDEs other than Xcode,  Eclipse or NetBeans or IntelliJ IDEA, and BlueJ all run on OS X, and any of these would probably be a better long-term choices for Java development on OS X.

  • How to request Administrator or root to execute java programs?

    How to request Administrator or root to execute java programs when the user is not enough permission?
    as same as following image:
    Windows : http://img151.imageshack.us/img151/6113/winrw5.gif
    Linux: http://img374.imageshack.us/img374/8990/linuxsj4.png
    Edited by: lauangus on 2008?10?13? ??9:15

    Dear Sys Admin,
    Would you please grant me and my group enough rights to do the tasks that have been assigned to us, we are using the following programs. They will need to asccess....
    Sincerely,
    lauangus
    Note: this will usually have to be accompanied by appropriate supervisor signatures and endorsements.

  • Executing java program in oracle

    Good day everyone!
    I created a small java program.
    import javax.swing.JOptionPane;
    public class LogOn {
    public static void main (String [] args) {}
    public static void ShowMessage(){
    JOptionPane.showConfirmDialog(null, "Hello", "Info", JOptionPane.PLAIN_MESSAGE);
    I compiled the code using javac and loaded into oracle using "loadjava -u scott/tiger Logon
    Then I created a procedure,
    create or replace procedure l_b
    as language java
    name 'LogOn.showMessage()';
    then I executed the procedure
    SQL> execute l_b;
    it's just say
    ERROR at line 1:
    ORA-03113: end-of-file on communication channel
    Any idea why its doing that?
    Thanks for the time
    Edited by: Xtro on Oct 30, 2008 9:38 AM

    What is the "warning banner" attempting to communicate? And where did this requirement come from-- presumably users are not seeing a banner when they log in today.
    Realistically, you are not going to be able to cause arbitrary client applications to display something, you are going to have to configure each client application separately, which seems like a huge investment of time for very marginal benefits assuming that government agencies have a decent number of client machines and a decent variety of client applications. The glogin.sql file will work for SQL*Plus (assuming very recent versions or that no one uses the "connect" command to connect to a different database), but I believe you are looking for something that works across client applications, which probably doesn't exist.
    Justin

  • Creating an executable java program

    hello every body
    i have finished my java program
    and i want to ask if there is some software that create a .exe of your project or make your projecte installable.
    for the moment i use javaexe but it's not really good
    do someone have an idea.

    That's the question most people ask.Actually this
    proccess is againts the goal of java for being a
    platform independent programing lang,That's an urban legend I haven't heard in a while -:)
    How can the generation of a native executable out of a Java source be against the goals of Java? Has the source code been contaminated in any way in the process? Is it now less portable than before? The native executable itself isn't portable of course but that's kind of the point of producing one, and it doesn't restrict the portability of the program itself.

  • Shell script to execute java program

    Hi there,
    In my script to execute my Java program, I have assigned a variable as follows:
    PROGRAM_ROOT = "C:/program"
    A jar file that my program needs is located in C:/program/build. ie. it is located in "PROGRAM_ROOT/build".
    In my script I have a property set as follows:
    -Dprogram.build="$PROGRAM_ROOT/build"
    When I execute the script using cygwin, the above line gets converted to the following:
    -Dprogram.build="$PROGRAM_ROOT
    /build"
    i.e. the concatenation of "PROGRAM_ROOT" and "build" results in PROGRAM_ROOT<carriage_return>\build.
    Is there a way to use PROGRAM_ROOT and concatenate "/build" to it?

    You'd have to build your own client/server implementation or use a remote messaging framework (like RMI) to help you with this if you wanted to do it in pure Java.
    It would be easier to just kick off some other installed process to send the message, e.g. install cygwin and pipe the command to start the shell and run the script through ssh. If you wrote a Java program to kick this off, it would only be a couple lines of code, and not really necessary.
    It's not ideal to try to do remote command administration just using Java.

  • How can i execute java program in JSP ?

    att
    thanks

    try to use:
    Runtime.getRuntime().exec("command line");
    where "command line" is your command to execute your program.

  • Shell script for executing java program

    i want to write a shell script which will export the classpath and compile & run the java program.
    any references from where i can get that?

    Try typing "man sh" at the command prompt.
    Ultimately it'll end up looking a lot like this:
    #!/bin/sh
    CLASSPATH=/path/to/a.jar:/path/to/anther.jar
    JAVA_HOME=/path/to/where/you/installed/java
    $JAVA_HOME/bin/java your.classes.package.YourClass

  • Executing java program

    iv installed jdk, jre 1.5.0_04 and 1.5.0_07 and NetBeans IDE 4.0 and 7.0.
    I
    am able to compile my java program but not able to run it.
    When i try to run it, i get the error ""Exception in thread "main" java.lang.NoClassDefFoundError:" followed by file name.
    Pls give me a solution to this problem as soon as possible

    http://onesearch.sun.com/search/onesearch/index.jsp?qt=Exception+in+thread+%22main%22+java.lang.NoClassDefFoundError&subCat=siteforumid%3Ajava31&site=dev&dftab=siteforumid%3Ajava31&chooseCat=javaall&col=developer-forums

  • Making batch files to execute java programs in windows

    In my comp sci class, i found a folder with a batch file, an application file, and all class files necessary to run the program.
    how do i take my java program and make a batch file to run it (in dos) like that program in my comp sci class?

    Okay, here are your steps for running a java program from a batch file:
    1) Open Notepad
    2) type the following:
    set JAVA_HOME=C:\j2sdk1.4.0_03 // specify the path where your jdk is
    set path=%JAVA_HOME%\bin;.
    javac {-classpath .;one.jar;two.jar} YourProgramName.java
    java {-classpath .;one.jar;two.jar} YourProgramName
    The stuffs inside {} is not necessary if your program doesnt use any .jar files.
    3) Save the notepad as mybatch.bat in the directory where your Java program is located.
    4) In the DOS prompt, go to the directory where you have .java and .bat files
    (use 'cd' command)
    5) Now, type mybatch.bat and press ENTER.
    Thatz it. Your program runs like a charm now!!!
    (provided the compiler is pleased with ur code :)
    -- layman's pal

  • Execute java programs automatically when system is connected to internet

    Good Day friends...
    Iam beginner in java. Please goes through the Question and please answer.
    I need to start my java programs automatically when system(windows operating-xp/7) is connected to the internet.
    Thanks in Advance,
    Shackir

    A. You might want to learn about Windows Services. Try searching for it on the web
    B. There is no way to programmatic detect if/when the local computer is connected to the internet, at least not in Java. The best you could do would be to create a timer and to periodically try to make your connection

  • Launching a Java Program from UNIX ( C/C++ )

    How do I launch my Java program from c/c++? Do I need to wrap my java command line ( ie. java -classpath .... ) in a C shell ? Is there another way?

    How do I launch my Java program from c/c++? Do I need
    to wrap my java command line ( ie. java -classpath
    .... ) in a C shell ? Is there another way?You can do it directly using Java Native Interface (JNI). Using this approach the Java program runs in the current process.
    Sylvia.

  • How to execute Java program in Solaris 8 (Intel Platform).

    Hello All,
    I have installed Solaris 8 on my Intel based PC. JDk 1.1 and JDK 1.2 is installed by default. When I compile any Java applet or Application, it successfull complies but when I try run that applet or application (java Appletname or applicationname), It gives the error message .... File not found...Check whether file exist in the directory or not.
    Can someone tell me the reason of this error and how to correct it. Where to set the CLASSPATh etc. under Solaris 8 for successful compilation and run of programs. I do not have any problem under Windows/2000.
    Thanks in advance,
    Amoid

    [amoyeed],
    Hello All,
    I have installed Solaris 8 on my Intel based PC. JDk
    1.1 and JDK 1.2 is installed by default. When I
    compile any Java applet or Application, it successfull
    compliesI will assume that you executed this command:
    #javac <java source code filename>.java
    In order to find out which version of the javac you are using to compile the program, execute the following:
    #/usr/bin/which javac
    The output will tell the exact path to the javac binary file.
    but when I try run that applet or application
    (java Appletname or applicationname), It gives the
    error message .... File not found...Check whether file
    exist in the directory or not.You probably have not set the current directory to your environment variable PATH for the Unix shell that you are using.
    You can do the following:
    #java ./<standalone application or applet name>
    Can someone tell me the reason of this error and how
    to correct it. Where to set the CLASSPATh etc. under
    Solaris 8 for successful compilation and run of
    programs.In the shell environment settings file. Which Unix shell are you using? Bourne, Korn or C?
    I do not have any problem under Windows/2000.
    Thanks in advance,
    AmoidHTH.
    Allen Lai
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

Maybe you are looking for

  • I'm looking for a job in the gulf area

    Hey all i'm an experienced ALBPM Developer and designer with over 4 years of total experience in the gulf area i'm looking for a job as an ALBPM Team Leader or a senior developer if you can help me please send me an email on [email protected] [email 

  • Cursor disappears except near dock (right side) OS 10.6.8, 27" Intel iMac. Started this morning.

    This morning my wireless mouse needed battery replacement. After that, the cursor disappears as I move it away from the dock area. If I move over buttons and am lucky, the proper action will take place but I cannot see the cursor. Sort of like playin

  • How to get a free code for installing Mountain Lion?

    Hey! I bought a MacBook Air 22 of June. I have read that if you bought a MacBook (with Lion 10.7.5) after the 11 of June you can get a free upgrade to Mountain Lion.. so im wondering how I can get this code..? Thanks! - Jonas

  • Adobe Acrobat 8 Standard install file download

    I have a license for Acrobat 8 Standard but no longer have the install file. Where can i find a download link for the install file?

  • InDesign files are opening in InCopy

    Hi there, Why is it that every time I click on an InDesign file it opens in InCopy?  I am a magazine designer so understand the purpose of InCopy. I have it on my computer only for emergencies with editors. But, these files were never put into InCopy