How can I use JAXB on Java 1.4?

My code is developed on 1.4 and my firm has not upgraded to 1.5 yet.
Can I use JAXB?
All I see on web is JAXB2.0 hat requires Java 1.5.
What can I do? Is there any pre-2.0 release of JAXB - I am sure they had JAXB before Java 1.5
Please shed some light, thanks.

https://jaxb.dev.java.net/servlets/ReadMsg?list=users&msgNo=4868
Turadg Aleahmad:
Could JAXB2 work in JSE 1.4 if it was run through Retrotranslator?
http://retrotranslator.sourceforge.net/
Kohsuke Kawaguchi:
It isn't officially supported, but it actually works. Yes, use retrotranslator.
You'd also have to use @xexplicitAnnotation="true" (for Ant) and use
-XexplicitAnnotation for CLI to work around some of the issues.

Similar Messages

  • ... how can i use 'enter' in java (text) -.-

    Hi all,
    first the simple version;
    How can i use 'enter' in java. Like turn HELLO into
    H
    E
    L
    L
    O
    The not so simpler version IF needed;
    I have the following piece of code;'
    if (line.startsWith("Monday")) {
         String subjectsMonday = " math and philosophy";
         Calendar c = Calendar.getInstance();
              System.out.format("School begins at" +" 08:10", c, c, c);
              System.out.format(" school ends at " +" 15:55", c, c, c);
         System.out.println("We have the following subjects;" + subjectsMonday);the thing is ... i want the text "we have the following subject; math and philosophy" to start at a new line.
    HOW am i supposed to do that.

    %n may work for you:
            String subjectsMonday = " math and philosophy";
            Calendar c = Calendar.getInstance();
            System.out.format("School begins at" + " 08:10%n", c, c, c);
            System.out.format(" school ends at " + " 15:55", c, c, c);
            System.out.println("We have the following subjects;" + subjectsMonday);

  • Adobe is asking for Java SE 6 runtime. How can I use Oracle's Java 7 instead?

    Platform: Mac OS X, version 10.9.2 (the latest available as of May 11, 2014)
    When trying to open my old Adobe Illustrator, as part of Creative Suite CS4, I get the following error message:
    To open "Adobe Illustrator CS4," you need a Java SE 6 runtime. Would you like to install one now?
    I have the latest Oracle Java 7 (Version 7 Update 55) installed and I don't want the historic Apple Java 6. How can I configure Adobe software to use the already installed Java 7?
    Best, regards
    Tom

    despite this being for a different os, read (especially the end paragraphs) Install Java (JRE) | Mac OS 10.7 Lion

  • How can I use HyperLink In Java Applet..

    I am new In Java Programming And i Want to create a Hyperlink OR URL in java Applet, How can be It possible?

    well u can use a hyperlink as a url by using url from java.net.url class
    define ur url .... u can check the API fo r that
    and by using wht u mean .. u want to browse in applet with that url or wht
    if u want to do browing in applet than u will also have to do parsing of all HTML tags
    hope it will help u

  • How can i use the operationsComplete JAVA API in EJB2.0

    Hello guys,
    My Issue is cleaning the EJB Cache. some guys saying using JAVA API like operationsComplete like the follwing
    weblogic.ejb.interfaces.EJBLocalObject
    public.void.operationsComplete()
    weblogic.ejb.EJBObject
    public.void.operationsComplete()
    Please reffer the link below
    (http://e-docs.bea.com/wls/docs92/ejb/entity.html#wp1194003)
    Understanding Passivation of Entity Beans
    Entity beans that are involved in transactions can be passivated when necessary in order to attempt to prevent a CacheFullException when an attempt is made to insert an entity bean into a cache that is full. Passivation is handled automatically by the EJB container and you do not need to change the way you program EJBs in order to take advantage of this feature. However, you can optionally program your EJBs to communicate to the cache that they are done performing all operations in the current transaction. The cache can then make use of this information when evaluating beans for the possibility of passivation.
    To optionally program EJBs to notify their cache that they are done performing operations in the current transaction, you can use the operationsComplete Java API as follows:
    weblogic.ejb.interfaces.EJBLocalObject
    public.void.operationsComplete()
    weblogic.ejb.EJBObject
    public.void.operationsComplete()
    It would be great help if any guy give me a solution.
    Thanks in Advance
    Rajasekhar

    Netweaver is comprised of different components...
    in WAS ABAP.. if you go to SPAM.. and select imported support packages and click display..
    You will see list of components.. some of the components you might see at same level and some follow different paths...
    ex:
    SAP_OCS  - > SPAM/SAINT UPDATE 24
    SAP_BASIS -> Support pacakage 13 for 7.0
    SAP_ABAP-> Support pacakge 13 for 7.0
    and the same way you can find different components in java engine...
    http://<host>:<port>/sap/monitoring/SystemInfo
    You can upgrade each of them by individual support packages.. or you can upgrade stack by stack..
    stack is collection of supporpt packages...
    If you follow stack.. then you can tell that you at NW04S Support stack 10 or 11... if you upgrade by support package always it is collection of versions of different support packs in your system...
    Please do come back if you require any further information..
    Award points if this reply found useful

  • How can i use twain from java servlet?

    dear all
    iam a web developer ,iam haviving now a task to search in point pf scanning image through web (Intranet) using java
    can any one tell where can i find resources how to deal with Twain using java (On web specially not from a desktop application)
    i hope u can help me
    Thanks in advance
    Yours,
    Amr
    Senior Java Web developer

    Hi,
    You can try a package named: JTwain, which is available at http://asprise.com/product/jtwain.
    JTwain supports all kinds of digital cameras and scanners. You can use Java to access, contorl digital cameras and scanners, and of course, to acquire images with flexible settings.
    The developers' guide is available @ http://asprise.com/product/jtwain/devGuide.php
    In the simplest case, one line of Java code can solve your problem.
    Good luck!

  • How can I use tomcat with Java ServerFaces

    Is there a tutorial on Java ServerFaces using tomcat?

    the JWSDP1.3 download includes Tomcat
    Follow links from here - http://java.sun.com/webservices/index.jsp
    NOTES
    #1 JWSDP1.3 includes a Beta release of Tomcat 5
    So you may want to also download the latest version from the apache/Tomcat websites
    http://jakarta.apache.org/tomcat/index.html
    #2 JWSDP1.3 contains JSF EA4 - JSF 1.0 Beta is now available
    follow the link on the JWSDP web site above

  • How can i use or embed  the ' C'  language in java

    thanks a lot friends for your suggestion on using 'c' language to implement the control of the keyboard ie. to prevent a key stroke of : ctrl+alt+delete keys from closing a running java application. i was advised that it won't be possible to implement this with java language, the use of 'C' language was suggested. i then wish to ask the following:
    1. how can i use 'C'language in a java program and be able to compile to program so that the resultant program can help me prevent the closing of my java-application when the user of the application presses the following keys : ctrl+alt+delete. i don't even know the c language at all. how can i start and how can i combine the resultant code with java.
    2. i'm thinking of creating an application that retrieves information from a database, like microsoft sql or oracle, and displays the resultant data from a table, say STUDENT TABLE, in a java application using the JTable class. i don't even know how to use this JTable but i've seen it used and know it will suit what i have in mind.
    3. how can i make the table dynamic, ie. how can i make the table to immediately register / show the result of an update to the 'STUDENT' table in the database.
    4. THANKS FOR YOUR HELP IN ADVANCE. i will most appreciate it if you can give me a sample code or a site where i download one. once again thanks.

    Good luck disabling Ctrl+Alt+Del! I've read quite a bit about it, and at least on Windows 2000 (not sure about NT) or higher, disabling it is next to impossible. Problem is CAD is a system command, and the OS doesn't even send the keys to the active program. Ctrl+Alt+Del is handled by the GINA (Graphical Identification and Authentication) DLL installed on the system. You'll have to write and export the functions you need and change the GINA DLL used by the system to your own. Bear in mind that any small mistake in the dll can cause you to lose access to your computer if you haven't taken precautions!
    On Windows 95/98, disabling Ctrl+Alt+Del is fairly easy as you just have to write some simple native code to fool the system that a password protected screensaver is running.
    I've provided a link regarding winlogon and GINA here, but you've been forewarned!
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/security/winlogon_and_gina.asp

  • How can I use Seeburger java functions on SAP XI's user defined functions?

    Hi All,
    As my title implies; how can I use Seeburger java functions on SAP XI's user defined functions?  I've tried searching over the net in tutorials regarding this topic but I failed to find one; can someone provide me information regarding my question? thanks very much.
    best regards,
    Mike

    Hi Mike !
    You should check your documentation about which java classes you need to reference in the "import" section of your UDF. And also deploy the java classes into the java stack or include them as a imported archive in integration repository...it should be stated in the seeburger documentation.
    What kind of functions are you trying to use?
    Regards,
    Matias.

  • How can I use XStream to persist complicated Java Object  to XML & backward

    Dear Sir:
    I met a problem as demo in my code below when i use XTream to persist my Java Object;
    How can I use XStream to persist complicated Java Object to XML & backward??
    See
    [1] main code
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.ArrayList;
    import com.thoughtworks.xstream.XStream;
    import com.thoughtworks.xstream.io.xml.DomDriver;
    public class PhoneList {
         ArrayList<PhoneNumber> phones;
         ArrayList<Person> person;
         private PhoneList myphonelist ;
         private LocationTest location;
         private PhoneList(String name) {
         phones = new ArrayList<PhoneNumber>();
         person = new ArrayList<Person>();
         public ArrayList<PhoneNumber> getphones() {
              return phones;
         public ArrayList<Person> getperson() {
              return person;
         public void addPhoneNumber(PhoneNumber b1) {
              this.phones.add(b1);
         public void removePhoneNumber(PhoneNumber b1) {
              this.phones.remove(b1);
         public void addPerson(Person p1) {
              this.person.add(p1);
         public void removePerson(Person p1) {
              this.person.remove(p1);
         public void BuildList(){
              location = new LocationTest();
              XStream xstream = new XStream();
              myphonelist = new PhoneList("PhoneList");
              Person joe = new Person("Joe, Wallace");
              joe.setPhone(new PhoneNumber(123, "1234-456"));
              joe.setFax(new PhoneNumber(123, "9999-999"));
              Person geo= new Person("George Nixson");
              geo.setPhone(new PhoneNumber(925, "228-9999"));
              geo.getPhone().setLocationTest(location);          
              myphonelist.addPerson(joe);
              myphonelist.addPerson(geo);
         public PhoneList(){
              XStream xstream = new XStream();
              BuildList();
              saveStringToFile("C:\\temp\\test\\PhoneList.xml",convertToXML(myphonelist));
         public void saveStringToFile(String fileName, String saveString) {
              BufferedWriter bw = null;
              try {
                   bw = new BufferedWriter(
                             new FileWriter(fileName));
                   try {
                        bw.write(saveString);
                   finally {
                        bw.close();
              catch (IOException ex) {
                   ex.printStackTrace();
              //return saved;
         public String getStringFromFile(String fileName) {
              BufferedReader br = null;
              StringBuilder sb = new StringBuilder();
              try {
                   br = new BufferedReader(
                             new FileReader(fileName));
                   try {
                        String s;
                        while ((s = br.readLine()) != null) {
                             // add linefeed (\n) back since stripped by readline()
                             sb.append(s + "\n");
                   finally {
                        br.close();
              catch (Exception ex) {
                   ex.printStackTrace();
              return sb.toString();
         public  String convertToXML(PhoneList phonelist) {
              XStream xstream = new  XStream(new DomDriver());
              xstream.setMode(xstream.ID_REFERENCES) ;
              return xstream.toXML(phonelist);
         public static void main(String[] args) {
              new PhoneList();
    }[2].
    import java.io.Serializable;
    import javax.swing.JFrame;
    public class PhoneNumber implements Serializable{
           private      String      phone;
           private      String      fax;
           private      int      code;
           private      String      number;
           private      String      address;
           private      String      school;
           private      LocationTest      location;
           public PhoneNumber(int i, String str) {
                setCode(i);
                setNumber(str);
                address = "4256, Washington DC, USA";
                school = "Washington State University";
         public Object getPerson() {
              return null;
         public void setPhone(String phone) {
              this.phone = phone;
         public String getPhone() {
              return phone;
         public void setFax(String fax) {
              this.fax = fax;
         public String getFax() {
              return fax;
         public void setCode(int code) {
              this.code = code;
         public int getCode() {
              return code;
         public void setNumber(String number) {
              this.number = number;
         public String getNumber() {
              return number;
         public void setLocationTest(LocationTest bd) {
              this.location = bd;
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(location);
            f.getContentPane().add(location.getControls(), "Last");
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
         public LocationTest getLocationTest() {
              return location;
         }[3].
    package test.temp;
    import java.io.Serializable;
    public class Person implements Serializable{
         private String           fullname;
           @SuppressWarnings("unused")
         private PhoneNumber      phone;
           @SuppressWarnings("unused")
         private PhoneNumber      fax;
         public Person(){
         public Person(String fname){
                fullname=fname;           
         public void setPhone(PhoneNumber phoneNumber) {
              phone = phoneNumber;
         public void setFax(PhoneNumber phoneNumber) {
              fax = phoneNumber;
         public PhoneNumber getPhone() {
              return phone ;
         public PhoneNumber getFax() {
              return fax;
        public String getName() {
            return fullname ;
        public void setName(String name) {
            this.fullname      = name;
        public String toString() {
            return getName();
    }[4]. LocationTest.java
    package test.temp;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class LocationTest extends JPanel implements ChangeListener
        Ellipse2D.Double ball;
        Line2D.Double    line;
        JSlider          translate;
        double           lastTheta = 0;
        public void stateChanged(ChangeEvent e)
            JSlider slider = (JSlider)e.getSource();
            String name = slider.getName();
            int value = slider.getValue();
            if(name.equals("rotation"))
                tilt(Math.toRadians(value));
            else if(name.equals("translate"))
                moveBall(value);
            repaint();
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            if(ball == null)
                initGeom();
            g2.setPaint(Color.green.darker());
            g2.draw(line);
            g2.setPaint(Color.red);
            g2.fill(ball);
        private void initGeom()
            int w = getWidth();
            int h = getHeight();
            int DIA = 30;
            int padFromEnd = 5;
            line = new Line2D.Double(w/4, h*15/16, w*3/4, h*15/16);
            double x = line.x2 - padFromEnd - DIA;
            double y = line.y2 - DIA;
            ball = new Ellipse2D.Double(x, y, DIA, DIA);
            // update translate slider values
            int max = (int)line.getP1().distance(line.getP2());
            translate.setMaximum(max);
            translate.setValue(max-padFromEnd);
        private void tilt(double theta)
            // rotate line from left end
            Point2D pivot = line.getP1();
            double lineLength = pivot.distance(line.getP2());
            Point2D.Double p2 = new Point2D.Double();
            p2.x = pivot.getX() + lineLength*Math.cos(theta);
            p2.y = pivot.getY() + lineLength*Math.sin(theta);
            line.setLine(pivot, p2);
            // find angle from pivot to ball center relative to line
            // ie, ball center -> pivot -> line end
            double cx = ball.getCenterX();
            double cy = ball.getCenterY();
            double pivotToCenter = pivot.distance(cx, cy);
            // angle of ball to horizon
            double dy = cy - pivot.getY();
            double dx = cx - pivot.getX();
            // relative angle phi = ball_to_horizon - last line_to_horizon
            double phi = Math.atan2(dy, dx) - lastTheta;
            // rotate ball from pivot
            double x = pivot.getX() + pivotToCenter*Math.cos(theta+phi);
            double y = pivot.getY() + pivotToCenter*Math.sin(theta+phi);
            ball.setFrameFromCenter(x, y, x+ball.width/2, y+ball.height/2);
            lastTheta = theta;  // save theta for next time
        private void moveBall(int distance)
            Point2D pivot = line.getP1();
            // ball touches line at distance from pivot
            double contactX = pivot.getX() + distance*Math.cos(lastTheta);
            double contactY = pivot.getY() + distance*Math.sin(lastTheta);
            // find new center location of ball
            // angle lambda = lastTheta - 90 degrees (anti-clockwise)
            double lambda = lastTheta - Math.PI/2;
            double x = contactX + (ball.width/2)*Math.cos(lambda);
            double y = contactY + (ball.height/2)*Math.sin(lambda);
            ball.setFrameFromCenter(x, y, x+ball.width/2, y+ball.height/2);
        JPanel getControls()
            JSlider rotate = getSlider("rotation angle", "rotation", -90, 0, 0, 5, 15);
            translate = getSlider("distance from end",  "translate", 0, 100, 100,25, 50);
            JPanel panel = new JPanel(new GridLayout(0,1));
            panel.add(rotate);
            panel.add(translate);
            return panel;
        private JSlider getSlider(String title, String name, int min, int max,
                                  int value, int minorSpace, int majorSpace)
            JSlider slider = new JSlider(JSlider.HORIZONTAL, min, max, value);
            slider.setBorder(BorderFactory.createTitledBorder(title));
            slider.setName(name);
            slider.setPaintTicks(true);
            slider.setMinorTickSpacing(minorSpace);
            slider.setMajorTickSpacing(majorSpace);
            slider.setPaintLabels(true);
            slider.addChangeListener(this);
            return slider;
    }OK, My questions are:
    [1]. what I generated XML by XSTream is very complicated, especially for object LocationTest, Can we make it as simple as others such as Person object??
    [2]. after I run it, LocationTest will popup and a red ball in a panel will dsiplay, after I change red ball's position, I hope to persist it to xml, then when I read it back, I hope to get same picture, ie, red ball stiil in old position, How to do that??
    Thanks a lot!!

    Positive feedback? Then please take this in a positive way: if you want to work on persisting Java objects into XML, then GUI programming is irrelevant to that goal. The 1,000 lines of code you posted there appeared to me to have a whole lot of GUI code in it. You should produce a smaller (much smaller) example of what you want to do. Calling the working code from your GUI program should come later.

  • How can I use regular expression to open files of certain types in java?

    Ok this is the problem I am facing:
    I have a command line input of something like "/usr/foo/bar/*.html"
    and there are multiple files in that folder that end with .html.
    How can I use the input to go through/open all the .html files in Java?
    Help would be greatly appreciated thanks!

    Or if you have to do it in java, check out the interfaces java.io.FileFilter and java.io.FileNameFilter
    http://home.tiscali.nl/~bmc88/java/sbook/0128.html
    class HTMLFilter implements FilenameFilter {
        public boolean accept(File dir, String name) {
            return (name.endsWith(".html"));
    }Cheers,
    evnafets

  • How can i use Unix database in java?

    How can i use Unix database in Java?
    Message was edited by:
    JPro

    I have not a clue about FoxPro, but the db then is FoxPro and not Unix. The better question would be "How do I connect to FoxPro DB running on Unix with JDBC?".
    My answer to that would be, search the Internet for a JDBC driver.

  • How can we  use java variable in javascript code on JSP page?

    How can we use java variable in javascript code on JSP page?
    Pls help

    Think about it:
    JSP/Java is executed on the Server and produces HTML+JavaScript.
    Then that HTML+JavaScript is transfered to the client. The client now interpretes the HTML+JavaScript.
    Obviously there's no way to access a Java variable directly from JavaScript.
    What you can do, however, is write out some JavaScript that creates a JavaScript variable containing the value of your Java variable.

  • How can I use Servlets on Sun Java System WebServer 6.1

    Hi
    This is Khurram,
    I have just downloaded, and installed "Sun One Java System Web Server 6.1" on WindowsXP. This is installed and working properly on my system. But I want to use Servlet technology on this server, even I did download it just for working on servlets. Before it, I was using typical JavaWebServer2.0 for this purpose.
    Any ways.
    Can any one tell me, how can I do this on "Java System Web Server 6.1".
    Thanks
    any help will be appriciated
    regards
    Khurram

    Thanks for your such action.
    Actually I have installed it since 2 days, and have read throughly the documentation of WebServer, But Only the Link for this purpose is provided "Programmer's Guide to Web Applications", Now I have just searched for it and found only "Programmer's Guide" .PDF format. I have just read it out now, But here also provided a small refference to see "Programmer's Guide to Web Applications". Now I have just the problem that where to find it.
    Please, tell me if you have some solution to my problem
    or atleast tell me where to find the refference "Programmer's Guide to Web Applications". I tried but only found "Programmer's Guide" for Sun Web Server 6.1.
    Thanks any way to give some time.
    Khurram

  • How can i use C/Javascript/php/Java in flex?

    can i embed these language into my flex project?
    since i have to check harddisk space, free memory remain. Also, i need to check the pixel of photos before the photos becoming bitmapdata
    please help~

    saipanBETTY0509 wrote:
    Subject: How can i use C/Javascript/php/Java in flex?
    can i embed these language into my flex project?
    You can't.  Why do you want to do this?
    saipanBETTY0509 wrote:
    since i have to check harddisk space, free memory remain. Also, i need to check the pixel of photos before the photos becoming bitmapdata
    I think what this means is "I want to check to see how much hard disk space is available.  Also, I need to check the pixel dimensions of an image."
    Is that right?
    There is no way in the Flash Player (as far as I know) that you can determine the amount of free disk space.  However, in AIR you can use air.File.applicationStorageDirectory.spaceAvailable to determine the storage space available in the application storage directory.
    As far as determining the dimensions of an image, there are plenty of good resources out there on that.  Maybe this one will be helpful to you?
    http://www.yswfblog.com/blog/2008/12/22/flash-10-experiments-the-warholizer-loading-and-pr ocessing-local-images/
      -Josh

Maybe you are looking for