Ann: Retroweaver - Run 1.5 class files in a 1.4 VM

Hi folks,
I've just posted the first release candidate of a free, open-source program that lets you run your 1.5 class files in a 1.4 VM. You can check it out at http://retroweaver.sf.net. Please give it a spin and let me know what you think.
God bless,
-Toby Reyelts

I've just released 1.0 RC4, which adds support for java.lang.Iterable, and the enum language construct.
You have to be somewhat careful with Iterable, because code like this works:Iterable<Integer> it = new Iterable<Integer>() {
  public Iterator<Integer> iterator() {
    return Arrays.asList( new Integer[] { 1, 2, 3 } ).iterator();
};and code like this, fails:Iterable<Integer> it = Arrays.asList( new Integer[] { 1, 2, 3 } );The problem is that I can't just modify the collection classes to implement my own Iterable_ interface.
God bless,
-Toby Reyelts

Similar Messages

  • How can I run a a class file on the Apache server?

    Hi Guys and Gurus,
    I am seeking some favor all of experienced gurus, i.e.
    How can I run a a class file on the Apache server?
    Actually, I want to extract some records from a MySQL Database running on Apache Server. I wrote a program just to select the columns and show them. It is now a Class file, Now how can I run this class file from the Server???
    Please advise...
    VJ

    cross posted
    http://forum.java.sun.com/thread.jsp?thread=299137&forum=31&message=1184025

  • URGENT PLEASE:How can I run a a class file on the Apache server?

    Hi Guys and Gurus,
    I am seeking some favor all of experienced gurus, i.e.
    How can I run a a class file on the Apache server? Can I run through an Applet?
    How can I set Environment variables in Windows2000 Professional Environment?
    Actually, I want to extract some records from a MySQL Database running on Apache Server. I wrote a program just to select the columns and show them. It is now a Class file, Now how can I run this class file from the Server???
    The code is here
    import java.sql.*;
    public class RecordShow {
    public static void main(String args[]) {
    String url = "jdbc:mysql://localhost/myhost";
    Connection con;
    String query = "select mytable.column," +
    "from mytable " +
    "where mytable.column = 1";
    Statement stmt;
    try {
    Class.forName("com.mysql.jdbc.Driver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    try {
    con = DriverManager.getConnection(url,
    "myuser", "mypassword");
    stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery(query);
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    int rowCount = 1;
    while (rs.next()) {
    System.out.println("Row " + rowCount + ": ");
    for (int i = 1; i <= numberOfColumns; i++) {
    System.out.print(" Column " + i + ": ");
    System.out.println(rs.getString(i));
    System.out.println("");
    rowCount++;
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.print("SQLException: ");
    System.err.println(ex.getMessage());
    Please advise... THANKS
    VJ

    Ehm, I wasn't referring to you at all... read up,
    there's a comment by jschell saying that CGI might be
    easier/better for his purposes.
    Yep.
    I know PHP/Perl/whatever might be easier for some
    purposes, but only if you happen to know them and want
    to/are able to use them. Ok. But you aren't the one asking the question are you. And the person who asked the question seems to have absolutely no familiarity with Apache or applets.
    So whatever they do they are going to have to learn a lot.
    And that does indeed suggest that in all likelyhood they have not investigated the alternatives.
    And for the vast majority of internet applications, especially with smaller projects (obvious this person is not working with a large team), using perl, or something besides java, is going to be the best business solution. It is simpler, and more secure (probably due to the fact that it is simpler.)
    Since this is a Java forum, I
    answer under the assumption that people have made a
    choice one way or another to use a Java solution to
    their problem, so I try to solve it in Java first, and
    only when that fails (very seldom) do I turn to other
    solutions.You approach problems by arbritrarily deciding to try to solve it in java first and only if you fail do you then look to other solutions?
    My first step is to try to figure out which of the various avenues is going to cost less. (And a secondary, but non-trivial concern, is then to convince the customer that just because they have heard of a buzz word like 'enterprise bean' that it doesn't mean that is a cost effective solution.) We must come from different worlds.

  • How can i run a java class file from shell?

    Hi all,
    I've a .class file named "File" that contains Main method, it is in the package "File2".
    How can I run it by shell command?
    PS: "java -cp . file" doesn't work it launch->
    Exception in thread "main" java.lang.NoClassDefFoundError: File2/File (wrong name: File2/File)
    Thanks in advance.

    Just to understand: is File2 ar jar archive or not? If it is a jar archive, have you tried open File2.jar? If File2 is a directory within the current directory, have you tried java -cp . File2/File? I just tested with a set of classes and it works... Let me be precise:
    * Let us imagine you are working in a directory whole path is PathToDir/
    * in this directory you have the classes put in a directory called File2
    * in order to launch File.class then you would have to invoke :
    cd PathToDir/ (just to be sure)
    java -cp . File2/File
    *if you were to do the following then you would have the problem you describe
    cd PathToDir/File2/
    java -cp . File

  • Run app with Class Files from JBuilder

    Hi,
    I have Java class files (at this point no java source code/files).
    How can I run the application from JBuilder with these class files.

    Thank you Annie.
    I want to run JBuilder in debug mode.
    Basically my application connects to the Sybase db. It will get some data from tables. But when I am running my app in debug mode ... I am hoping that it will show me the data. I dont see any data from the db tables.
    Do I need to setup anything else to see what data it is selecting through JBuilder

  • Java class files works on middle tier but chokes when called from pl/sql

    Hi,
    I have 2 class files WorkOrder and xxWorkOrder. xxWorkOrder creates an instance of WorkOrder. Both classes are under the /classes directory. Both compile fine and I have used loadjava to upload/resolve both in the database. I can see them as valid under the user_objects table. I created a function using Pl/sql which calls a method in xxWorkOrder. If I remove the line in xxWorkOrder where it creates an instance of WorkOrder, the pl/sql function works fine via sql plus. If I add the line in, it gives me ORA-29532: Java call terminated by uncaught Java exception: java.lang.ExceptionInInitializerError if i run my test again I get a No classdef found error.
    If i run the xxWorkOrder class file directly from the server using java, the code works fine with the instantiation of WorkOrder within it.
    I'm not sure which step I am missing ? For some reason when the pl/sql function calls the java method in xxWorkOrder and it sees the line where the instance of WorkOrder is created, it chokes.
    Please help!
    Preeti

    ExceptionInInitializerError means that whatever is being done at the time it occurs is trying to use some class for the first time so that an attempt to initialize that class is occurring and failing. Such a failure typically means that there is code in a static initializer, such as the foo(); in
    static SomeType someVarName = foo();
    or just any thing within
    static { ... }
    in the class being initialized which signals an uncaught exception. It's impossible to say why this would be happening in your particular case without seeing the code. Depending on the release you are using there may be more information (such as a backtrace of the original error) in the .trc file. An example of what I am describing in your case would be if the constructor for WorkOrder invoked a method on some class N, where N hadn't previously been used and where N contained
    static Class loser = Class.forName('no/such/Class');
    In this (admittedly goofy) case you might expect to see in the .trc file a backtrace for the ExceptionInInitializer error with a sub backtrace identified with "Caused by" that starts with a NoClassDefFound exception or the like. This might work outside the server if "no/such/Class" was present there but had not been loaded into the database.

  • Loading Java Class File in JSP page

    I'm trying to load a java class file from a jsp page.
    (e.g. MyFile.java <-- Source "MyFile.class<--Class file of MyFile.java")
    jsp page
    <%@ include file = "MyFile.class" %>
    <HTML> // HTML Tags are here
    MyFile.java
    A normal java source file that has "public static void main" in it.
    My jsp page can display it's contents, 'except' for showing e.g. "1235%%215648%%public%%$$@##" through out the page...
    My guess is that it can't display my java class file..
    Can anyone please help me solve this problem of mine ?
    Thanks in advance : )
    Yours Sincerely,
    RainbowEnergies

    This is my JSP file.
    <HTML>
    <HEAD>
    <TITLE>Activity Games</TITLE>
    </HEAD>
    <%
    String name = "";
    String id = "";
    name = session.getAttribute("name").toString();
    session.setAttribute("name",name);
    id = session.getAttribute("id").toString();
    session.setAttribute("id",id);
    %>
    <BODY bgcolor="#cc99ff" text="#000000" link="#E3E3E3" vlink="#CCCCCC" alink="#FF0000">
    <H3><%=name%>, you have enter Activity Games</H3>
    <%@ page import="Games.Lufia.*" %>
    <%Lufia lufia = new Lufia();%>
    </BODY>
    </HTML>
    After I execute...
    An error occurred at line: 18 in the jsp file: /jsp/ActivityGames.jsp
    error: File C:\Program Files\Apache Tomcat 4.0\webapps\website\WEB-INF\classes\Games\Lufia\Lufia.class does not contain type Games.Lufia.Lufia as expected, but type Lufia. Please remove the file, or make sure it appears in the correct subdirectory of the class path.
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\website\jsp\ActivityGames$jsp.java:85: Class Games.Lufia.Lufia not found.
    Lufia lufia = new Lufia();
    But if I comment this out....
    This is my JSP file.
    <HTML>
    <HEAD>
    <TITLE>Activity Games</TITLE>
    </HEAD>
    <%
    String name = "";
    String id = "";
    name = session.getAttribute("name").toString();
    session.setAttribute("name",name);
    id = session.getAttribute("id").toString();
    session.setAttribute("id",id);
    %>
    <BODY bgcolor="#cc99ff" text="#000000" link="#E3E3E3" vlink="#CCCCCC" alink="#FF0000">
    <H3><%=name%>, you have enter Activity Games</H3>
    <%@ page import="Games.Lufia.*" %>
    <%//Lufia lufia = new Lufia();%> <--- comment this out.... (HERE)
    </BODY>
    </HTML>
    The page shows but did not run my java class file..
    Thanks again for trying to help me solve this problem of mine. : - )
    Regards,
    RainbowEnergies

  • Getting an error msg while trying to run the java class from CMC

    Hi All,
    I am getting an error, while trying to run the java .class file, that which is imoported into CMC.
    Error msg:
    Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at com.crystaldecisions.sdk.plugin.desktop.program.internal.ProgramWrapper.main(ProgramWrapper.java:49)
    I have imported .class file into CMC and trying to invoke the .class file by another java program from eclipse..When i tried to invoke the .class in cmc, i am getting an error msg, mentioned above. I thought there might be version conflict. So i changed the java complier version to 1.5 in my Eclipse. After that is done again i am facing the same problem.
    Can anyone help me to resolve this issue?
    Thanks in Advance.

    i have installed BO SDK 3.1 , Service pack 3. It comes woth JDK 1.5 version. i have not done any chnages to it. I impoprted all the jar files related to BO into eclipse.
    1)  Actually, i am writing java code on eclipse. When i run code from the eclipse, it creates a session to cmc and creates folder structure what i need.
    2)  But the thing is, that code needs to run, when i import the .class file into cmc. The process how i imported the .class file to cmc.
    Manage> Add> Program File-->Java (Check Box). In this way i added java class file from the eclipse workspace (class file from the bin directory).
    3) So when i run the .class file externally by another java program or also when i log in to CMC and run that .class file, the instance shows sucess, but when i see the logfile i am getting an exception that which i mentioned above.
    If my method is worng can you please let me know the stepts how to run java program in cmc.
    Thanks in Advance

  • Newbie Question - Accessing Servlet Class file

    im trying to run my servlet class file but am not able to do so. I've compiled my servlet and the class file generated is under build...web-inf/classes as it should be. Now how i do access this through the browser , isnt it just not localhost:29080/MyWebApp/HelloServlet. Thanks
    -newbie

    Hi There,
    Are you using Java Studio Creator to develop your application? If so this tutorial will help you get started.
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/jscintro.html
    Please also visit the tutorials page at
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/index.jsp
    Thanks
    K

  • NEW CLASS FILES

    I need to use some different class files to the ones that come with the SDK. Where do I need to put them so that I can import them...? At the moment they are in a folder on my c: drive, but the import keyword cannot find them.. can sumone help? Please email me if you can...
    [email protected]

    I've tried putting it in the classpath, and its says:
    C:\java_code\sheep.java:1: package ann.easyio does not
    exist
    import ann.easyio.*;
    ^
    C:\java_code\sheep.java:7: cannot access Screen
    bad class file: C:\ann\easyio\Screen.class
    class file contains wrong class: ann.easyio.Screen
    Please remove or make sure it appears in the correct
    subdirectory of the classpath.
         public static Screen output = new Screen();
    my classpath is:
    .;.;C:\PROGRA~1\JMF21~1.1\lib\sound.jar;C:\PROGRA~1\JMF
    1~1.1\lib\jmf.jar;C:\WINDOWS\java\classes;.%CLASSPATH%;
    :\ann\easyio;
    i know these class files work cause i've used them at
    uni...
    help!!!???
    thanksYou should have c:\ in your class path. The Screen.java contains a class called ann.easyio.Screen. Since your Screen.java file resides in C:\ann\easyio directory, to refer to that class you should put c:\ in your class path. It should work with that.

  • My .class files work...but when I jar it, the swing goes crazy!!

    5 dukes, if anyone can get this :) :) ....
    Hi, I have an application which is working perfectly when I view it using the java viewer. But when I put the whole thing into a jar.....the layout, and the swing stuff is messed up, terribly. Like Its foxused on nothing, and you have to click on where you think the button is...to make it appear, sooo strange. Here's what I have.
    I put 2 panels onto desktopPane() using a GridBagLayout layout.
    on panel 1, I have a whole bunch of g2d objects,
    on panel 2, I have a whole bunch of Components (JButton's, JTextField's, etc..), but panel2 isn't really the problem, since when I removed panel 1, the jar ran without problems.
    So It could be panel 1, or something in the main() class which sets up the panels, here is the appropriate code...
    Panel 1
    static class MyComponent extends JComponent {
              JScrollBar scroll;
              //          ~~~~~~~~~~~~~~Graphics Stuff~~~~~~~~~~~~~~~
              public void paintComponent(Graphics g){
              // a whole bunch of g2d things
              // ~~~~~~~~~~~~~~Component Stuff~~~~~~~~~~~~~~~
              MyComponent() {
                        setBackground(Color.pink);
                        setBounds(0,0,500,500);
                        setBorder(BorderFactory.createLineBorder(Color.pink,10));
                        scroll = new JScrollBar(JScrollBar.VERTICAL,0,20,0,100);
                        scroll.setBounds(484,0,16,500);
                        scroll.setVisible(true);
                        add(scroll);
                        System.out.println(scroll.isEnabled() + "" + scroll.isVisible() + scroll.getBounds());
                        setVisible(true);
    And the main code...
         public static void main(String[] args) {
              //This section converts to windows look
              try {
              UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
              catch (Exception ex) {
              ex.printStackTrace();
              SwingUtilities.updateComponentTreeUI(frame);
              frame.pack();
              //~~~~
              componentPanel = new JPanel(); //initialize panel to place the component with buttons and stuff
              mc = new MyComponent(); // initialize the component with the g2d stuff
              mc.setSize(500,500);
              buttonComponent = new MySwingSwing(); // initialize the buttons and stuff
              componentPanel.setBorder(BorderFactory.createLineBorder(Color.GREEN));
              componentPanel.add(buttonComponent);
              JScrollPane scrollPane = new JScrollPane(mc);
              //~~~~~~~~~~~~~~~~~~~~~~~~~~~~Layout Stuff~~~~~~~~~~~~~~
              GridBagLayout grid = new GridBagLayout();
              constraints = new GridBagConstraints();
              frame.getContentPane().setLayout(grid);
              frame.getContentPane().setLayout(grid);
              constraints.weightx = constraints.weighty = 10.0;
              constraints.fill = 1;
              grid.setConstraints(componentPanel, constraints);
              grid.setConstraints(scrollPane, constraints);
              System.out.println("constraints are " + constraints.BOTH);
              scrollPane.setBackground(Color.green);
              frame.getContentPane().setBackground(Color.RED);
              buttonComponent.setBackground(Color.BLUE);
              frame.getContentPane().add(scrollPane);
              //frame.getContentPane().add(buttonComponent);
              frame.getContentPane().setVisible(true);
              scrollPane.setVisible(true);
              buttonComponent.setVisible(true);
              frame.getContentPane().requestFocus();
    I dont know what I did wrong, but If you can find it Ill give u 5 dukes!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Here is how it looks when its run as a .class file,
    http://www.members.lycos.co.uk/markrules/morestuff/1.jpg
    And it is just completely distorted when its not...
    thanks, MArk

    Dude, throw GridBagLayout out! Go get TableLayout or FormLayout! Seriously. Unless you are restricted to use only JDK layouts, TableLayout has been a huge time saver and life saver for me. Google it, you'll thank me a million times over, and toss me them 5 dukes. ;)

  • Unable to run a .class file w/ javaw

    I created a simple application which uses swing gui.
    This application works just fine when I click the "run" button in eclipse.
    But as soon as i copy the .class file from the eclipse project folder to somewhere else and try to run it with "javaw myclass" (the filename is myclass.class) nothing happens.
    No command not found error, no nothing.
    Its like javaw finds and executes the .class and then returns to the command prompt... But I dont see any windows or any sign of my program running.
    Thx in advance

    When run with just java I get this:
    C:\>java myclass
    Exception in thread "main" java.lang.NoClassDefFoundError: myclass$1
    at myclass.<init>(myclass.java:38)
    at myclass.<init>(myclass.java:28)
    But I Eclipse it works just fine...
    What does Eclipse do that I dont?

  • How can i run a program outside of Forte? (Forte and java/class files)

    im making a program with forte... and i have a bunch of class files, i form file and a java file... how can i put these in one file so poeple without forte can run it...
    thanks

    jmburns wrote:
    I am trying to do a silent install of a program I built using LabVIEW 8.5.  I also need to call an exe after the installation, so I am using the "run executable after installation" option on the Advanced tab of the installer.  I then pass the following command lines to the setup.exe:
    /qb /acceptlicenses yes /r
    This installs the LabVIEW program successfully, but does not then run the additional exe afterward.  If I run the setup.exe normally (with no command line parameters), the additional exe gets run.
    Thanks,
    Jason
    This problem is fixed in a future release of LabVIEW. Here's the CAR ID 67549 for tracking purposes.
    Message Edited by Bob P on 07-10-2008 09:10 AM

  • How to run a class file in MAC os, compiled in XP.

    Hi all,
    i am compiling a java program in windows using JDK 1.5 and i am copying this file to MAC os (Panther). In Mac i am running this class file using JDK 1.4.i am getting the following exception,
    Exception in thread "main" java.lang.UnsupportedClassversion error.
    This is understandable, but is there any solution for this ...
    Any one experienced the same problem ...
    If any one comes up with a solution to solve this, plz let me know...
    Thanks in advance......

    You are compiling it in 1.5 and expecting 1.4 to run it?
    You have two options: compile it at the 1.4 level or upgrade your Mac to 1.5

  • Running the .class file from java code

    I'm doing a kind of providing service like compiling and running Java code on server side and giving output to the end user.
    Please suggest me an approach with code to run .class file from the Java code.
    import java.io.*;
    public class demo {
    public static void main(String args[]) throws IOException, InterruptedException {
    int result;
    try {
    System.out.println("command output:");
    Process proc = Runtime.getRuntime().exec("java -cp . demoh");
    InputStream in = proc.getInputStream();
    result = proc.waitFor();
    BufferedInputStream buffer = new BufferedInputStream(proc.getInputStream());
    BufferedReader commandOutput = new BufferedReader(new InputStreamReader(buffer));
    String line = null;
    System.out.print(commandOutput);
    try {
    while ((line = commandOutput.readLine()) != null) {
    System.out.print(line);
    System.out.println("command output: " + line);
    }//end while
    commandOutput.close();
    } catch (IOException e) {
    //log and/or handle it
    }//end catc
    } catch (IOException e) {
    System.err.println("IOException raised: " + e.getMessage());
    }

    What happened when you tried what you have there?

Maybe you are looking for

  • Having trouble connecting to wireless network

    Hello. I am having some difficulties connecting to my Linksys router from my Powerbook G4. Here is my issue... sometimes airport can find the wireless connection (called Linksys) and sometimes it can't. I don't understand why it does sometimes, but o

  • Query regarding listoutput

    Hi, We have saved a file to desktop through lisoutput option into spreadsheet format, can anyone please help us in understanding as to whether we need to follow any steps to convert it into a proper full fledged excel format. Regards Srinivas

  • Best business Apps

    While studying Chinese in China I used some great apps to help me with my study. Pleco etc etc.. Now I am back home and I need productivity apps . Can people tell me what they use so I can try em out please Thanks guys 

  • EA4500 - Filter Guest Network Access

    Is there a way to filter guest network to restrict what services they can access? Support won't email me back.

  • EPCF Client Side Eventing

    Hello, I have been working on some EPCF client side eventing examples. I found the example by Dr. Ron Hendrickx at the following URL. https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/iview client side eve