SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Dec 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question running java jar on asp page

    I'm trying to run a java jar on an asp page then fetch the created file and print it to the screen. The problem is that I can't get the java code to run to create the file from the asp page.

    Here are a couple failed tries:
    Code ASP:
    Dim oShell
    Set oShell = Server.CreateObject("Wscript.Shell")
    oShell.Run "cmd java -classpath Path\bin\Code\*;Path\bin\Code\lib\* Code.Launcher"
    Set oShell = Nothing

    Code ASP:
    set wshell = CreateObject("WScript.Shell") 
    wshell.exec "Path\Code.bat"
    set WshShell = nothing

    Code ASP:
    set wshell = CreateObject("WScript.Shell") 
    wshell.run "cd Path"
    iReturn = wshell.Run("java -classpath Path\bin\Code\*;Path\bin\Code\lib\*  Code.Launcher", , True) 
    response.Write "<p><strong>iReturn: </strong>" & iReturn & "</p>"
    set WshShell = nothing

    Anyone have an idea?

  2. #2
    SitePoint Member
    Join Date
    Dec 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking

    I managed to figure it out.

    This works.
    Code ASP:
    set wshell = Server.CreateObject("WScript.Shell") 
    wshell.run "%COMSPEC% /C java -classpath Path\bin\Code\*;Path\bin\Code\lib\* Code.Launcher > Path\OutputFile.txt", 0, TRUE 
    set wshell = nothing


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •