How can i execute "*.java " files in Workshop

Hi,
Im sunil,new to this weblogic workshop8.1..i dont know how to execute standalone .java files or servlets in workshop.plz help me and tell the way.
regards
Budati sunil

Im not too sure about the Java project. But single normal java files with public static void maain(String [] args) are very simple to execute.
1. Write the java code somewhere lets call this class A.
2. Make a dummy page flow.
3. In the begin action of this pageFlow, call the main method of the A class directly using A.main(null) since main is a static method. your code will work fine.
4. If you have to pass a String[] as parameters. Before calling main, create this String[] and then pass it.
In this way you can make a jsp and take the input from the user also.
Hope it helps
Cheeers

Similar Messages

  • How to get "Executable java file"?

    Hi,
    I wanted to get the .class file of my java programme for execution. i.e say "c:\java Abc ", I wanted to get "Abc" so that I can execute my file in my GUI like "java Abc".
    Here is what I am doing
    File file;
    String command = "java";
    Process p;
    String classname = file.getPath(),fileName = file.getName();
    p = Runtime.getRuntime().exec(command+" "+classname);
    When I use this, I get the .java file. I wanted to get the "EXECUTABLE FILE ONLY", can any one help me?
    Thanks

    Put these lines after fileName = file.getName();
    if (fileName.endsWith(".java"))
        // Remove the .java extension from the filename
        fileName = fileName.substring(0, fileName.length() - 5);
    }

  • How can i run java file by double click like Visual basic

    i have to run java file by giving a command on DOS promtp.But in Visual basic i easily make a .exe file to run my program. Does java provide this thing?
    please help me.

    If you have intaled a JRE in your computer, at leasrt in windows, the .jar files are asociated with the VM, so a double click on them will execute the, thats how things work on my computer, with jdk 1.4 installed.
    Abraham.

  • How can I convert Java file into an XML file

    I have a requirement to save a GUI screen developed in Java as UIML(it is xml based language).
    So could anybody help me with how to do this transformation.
    thanks
    JhonMathew

    Actually UIML is XML based technology which is used to represent language independent User Interface. It stores all the information like what all comopnents are present where they are located on screen and what action is called when user clicks on some items on screen like button.
    All this information is stored in structured manner in XML(UIML). So if we have UIML representation of some screen then we can render it in any GUI specific language like HTML, WML, swing etc using language specific renderers and transformers.
    In my case I have swing screen and I have to transform all that information in UIML. Could you please let me know how to start on this

  • 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.

  • How to run standalone java file from weblogic server on Solaris

    Hi,
    We have a requirement to run a java file at a scheduled time in a day using cron scheduler on our linux server.
    We need to fetch data from the database & perform some business logic in this standalone JAVA file.
    Our application has an EAR which is deployed on Weblogic 10.3 server & in our application, we are utilizing the datasource created in that domain.
    Now, we have created a standealone Java file & used exisitng datasource (without Hibernate) of the domain with the help of below forums,
    Use DataSource of weblogic in a standalone Java file
    able to achieve the same.
    I've bundled this JAVA in application WAR & depoyed on the same domain where datasource is created.
    Now, how can I execute this file from anywhere on the server using weblogic classpath.
    Please help on the same in implementation.
    Thanks,
    Uttam

    If the Java application must be stand-alone you must not deploy it on WebLogic, then WebLogic will manage its lifecycle.
    In this case you can use the CommonJ API and use the timermanager if it must run on a certain time. More information
    of how to do this can be found here: http://middlewaremagic.com/weblogic/?p=5569
    If you keep the Java application stand-only and want to use a cron job you can follow the example presented here: http://middlewaremagic.com/weblogic/?p=7065
    Note that the example runs a WLST script, but you can follow the same steps to run your Java application.

  • How to Generate a Java file for a JSP Page

    Hi ,
    I am using weblogic11 .
    I am working on a JSP page which nearly consists of 4000 lines of code.
    I need to debug the file , but weblogic server is not generating the java file for the JSP pages .
    Please let me know how can i genertae Java file for the jsp pages ??

    JSPs are compiled into servlets automatically and those classes are stored in WEB-INF/classes folder. Servlet engine handles servlets.

  • How can I execute a batch file from my java program

    Hi,
    Can someone help me or direct me to a link,
    How can I execute a DOS batch file from my java program?
    Thanks

    You will need to grab a handle to the process's
    outputstream so u can see its output.The OP didn't mention any output from any batch file;
    nor any input for that
    matter,so lets not complicate matters here for now
    ok?Actually I think this is essential to see whether it works or not. It's either that or do some manual check to see whether it ran, which is not exactly elegant, and in some cases this may not be easier than simply writing the output stream code, or in fact it may be impossible to check manually.
    I'm sure it wasn't intentional that your post appeared to be bristling with attitude.

  • How can i execute vb scripts in java program

    hi
    how can i execute any batch files or any other exe files (vb scripts) from java programs
    thanks

    Hi,
    You use Runtime.exec to execute commands / exe-files. See the documentation (and remember that it will only work on windows):
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html
    /Kaj

  • How can I add image files to a executable jar file ?

    Could you tell me how can I add image files to executable jar file ?
    package structure:
    ../com/Main.class
    ../images/..

    Please don't cross post, and read this
    http://forum.java.sun.com/thread.jsp?forum=31&thread=271751
    I've answered the question in the New To Java thread.

  • How can i execute excelsheet without giving path in java

    Hi,
    How can i execute excelsheet without giving path in java, through this code, you can open the notepad but
    I want whereever the excel is installed in your machine , fine and open excelsheet without given absolute path.
    class ExecuteCommand{
    public static void main(String d[]){
         Runtime r = Runtime.getRuntime();
         Process p= null;
         try{
         p = r.exec("notepad");
              catch(Exception e){
                   System.out.println("error");
    If you know please send me your idea and code samples.
    regards
    Mohan kumar

    just execute the exelfile with the Windows "start" command:
    Runtime.exec("cmd /c start "+excelFileName);But this requires that Excel is the default application for the Excel file type (*.xls). You can test this by simply typing "start myTestExcel.xls" in a dos box.

  • Than how can i get java class by using it's class file?

    Hi
    After compilation of a java program, it creates a class file.
    After getting class file suppose class file has been deleted.
    Than how can i get java class by using it's class file?
    Thanks in advance.

    get a decompiler and run your class file through it--I'll assume you want the source code back and that you are not trying to recover a missing class file by attempting to use the class file that is missing--if it's missing, then I've not a clue on how to get it back by using what is already missing.
    BTW: many of your compilers have source control--if it does, just restore your missing file.

  • How can i build RPMs file for my own Java Application?

    How can i build RPMs file for my own Java Application?....I have my own directory that contains all Java Source files and some files that my Application required....I want to build RPMs file like a install File to Linux System, Now my OS is Linux Fedora core 1.....How can i do this?

    I think that in order to create a RPM, you'd need to
    use some C.Nope - the RPM is all about packaging and the "magic" x.spec file. You can have anything you want in the RPM, but you have to use RPM tools to build the .rpm file. One of the features is that you can also indicate (via "install" scripts) modifications to other files or the filesystem to support the installation of whatever's in the RPM.

  • Until how many lines can we  write java file

    in java file, how many lines can I write?
    Manybe It will depend on file system such as window, unix file system.
    but, I don't know the exact size.
    please let me know how many lines I can wirte in java file of window and unix file system.
    thank you in advance.

    A class and method implementation in source lines of code (sans comments and white space) should be as large as necessary, but no larger. Good design principals tend to drive towards smaller peices, but there is no one right size size limit.
    Personally, I suspect any method that has over 50 lines of code as being too large and probably refactorable. I also suspect any single class (or for that matter .java file) with more than 50 methods or more than 2000 lines of code as being too large and probably refactorable. But sometimes we might really need a 500 line method or an 8000 line, 200 method class. Maybe its a performance thing. Maybe it is just that complicated and too hard to break up. I doubt it occurs frequently, but I won't be shocked when I see it.
    Sometimes GUI classes (Swing and AWT) get really huge. Sometimes this is due to code generation, sometimes its just being sloppy. It pays to know the difference.
    But the Java langauge sets reasonable (if not overly generous) limits on bytecode and constant pool sizes If the Java compiler begins to complain that something you have built is is too large, face it, it probably is. It's like running into scope nesting or nested name (class in a class in a class...) size limits - usually not a good sign for the structure of your code.
    Chuck

  • How can we open any file using JAVA...

    Hi all
    i trying to make code in that code i choose a file using a filechooser then put that file name in FILE object like (File file = fileChooser.getSelectedFile();)
    but the thing is how can i open that file for example if that file is HTML file then opens in IE or if that file is MS Word document that open in Word, like that
    is there any suggestions
    Thanx
    Regards
    Satinderjit

    start is a windows command-line utility.
    start foo.doc will start Word (or Star Office or Word Perfect or whatever is registered for the .doc extension),
    start bar.htmnl will start your registered browser etc.

Maybe you are looking for

  • Installation Failure: Windows failed to install the following update with error 0x800F0922

    Hi folks, I have a HP Elitebook Folio 9470p.  It came with Windows 8, and I installed it on my corporate domain.  I was trying to do some Windows updates so  I could upgrade it to Windows 8.1, but it fails installing the updates, whether or not I try

  • Error on Expression Query - java.sql.SQLException: DSRA9420E

    We are getting the below error when we execute an Expression query. Other queries seem to be working fine. Has anyone seen this error? Any help or suggestions are welcome. Thanks ERROR - java.sql.SQLException: DSRA9420E: Connection cannot be reassoci

  • Error in executing command

    Hello, I am trying to execute nqcmd command in unix envt throgh putty to purge cache but it giving me following error....I went through blog, but its not much helpful. I new to unix: below is the error exec(): 0509-036 Cannot load program nqcmd becau

  • Can't play midi files anymore

    I've upgraded to QT 7.2 and now any midi file I download is unplayable. All I get it "Mac OS error -208". What gives? I use a lot of midi files for my work and now - nothing. Does anyone know a fix?

  • TIMESTAMPDIFF rounding to 2 decimal places instead of 0

    Hi, Requirement is to find difference between two timestamp column, as known one we cannot perform arithmetic operation in non number type in rpd. Hence tried using TIMESTAMPDIFF function as below, TimeStampDiff(SQL_TSI_MINUTE, MONITOR_TIMESTAMP, ATT