Compiles in Java 5.0 but not 6.0

I did my homework on my school computer (in eclipse) and compiled in in 6.0 and everything worked. Then I saved it to a usb drive
and brought it home. I tried to run it on my computer (in eclipse) in 6.0 and it gave me this error:
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 java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)when I tried to run it. The weird thing is, if I change eclipse's preferences to compile in 5.0 everything works fine. I just don't understand
why it compiled in 6.0 at school but won't work on my home computer in 6.0? I'm worried that my teacher might grade the assignment in
6.0 because if he does I'll get a 0 even though everything works 100% in 5.0.
I was just wondering if anyone could shed some light on this for me. Thanks in advance!
Here is my assignment (just giving this so you know what the program is suppose to do):
http://www2.ics.hawaii.edu/~esb/2008spring.ics211/hw9.html
It basically reads from a file and adds items in the file to a PriorityQueue using a heap as the data structure. It keeps track of levels
traversed to re-establish the heap property. How long add/poll take in realTime. And when add/poll occurs in simulatedTime.
Here's my program:
import java.io.*;
import java.util.*;
public class KinseyAnthony9<T> {
     private static String name = "";
     private static long deadline;
     private static long duration;
     private static int time;
     private static int simulatedTime = 0;
     private static boolean add;
     public static void ProcessLine(Scanner line){
          if(line.next().equalsIgnoreCase("schedule")){
               add = true;
               if(line.hasNext()){
                    name = line.next();
               if(line.hasNext()){
                    deadline = Long.parseLong(line.next());
               if(line.hasNext()){
                    duration = Long.parseLong(line.next());
               else {
                    System.out.print("There is a format error in the supplied file");
                    System.exit(1);
               return;
          else {
               add = false;
               if(line.hasNext()){
                    time = Integer.parseInt(line.next());
               else {
                    System.out.print("There is a format error in the supplied file");
                    System.exit(1);
     public static void main(String[] param) {
          Comparator<MyProc> procCompare = new ProcComparator();
          MyPQueue<MyProc> myQueue = new MyPQueue<MyProc>(procCompare);
//          PriorityQueue<MyProc> myQueue = new PriorityQueue<MyProc>(1000, procCompare);
          if(param.length == 1) {
               try {
                    File readMe = new File(param[0]);
                    Scanner readFile = new Scanner(readMe);
                    String line = "";
                    while(readFile.hasNextLine()) {
                         line = readFile.nextLine();
                         Scanner readLine = new Scanner(line);
                         ProcessLine(readLine);
                         if(add) {
                              System.out.println(simulatedTime + ": adding " + name + " with deadline " + deadline + " and duration " + duration + ".");
                              myQueue.add(new MyProc(name, deadline, duration));
                         else if(!add) {
                              String procName = "";
                              long procDeadline = 0;
                              long procDuration = 0;
                              while(simulatedTime != time) {
                                   Scanner procScan = null;
                                   int queueSize = myQueue.size();
                                   if(queueSize <= 0) {
                                        simulatedTime = time;
                                        break;
                                   if(queueSize > 0) {
                                        procScan = new Scanner(myQueue.peek().toString());
                                        procName = procScan.next();
                                        procDeadline = Long.parseLong(procScan.next());
                                        procDuration = Long.parseLong(procScan.next());
                                        System.out.println(simulatedTime + ": performing " + procName + " with deadline " + procDeadline + " and duration " + procDuration + ".");
                                        myQueue.poll();
                                        simulatedTime += procDuration;
                                        if(simulatedTime > time) {
                                             System.out.println((simulatedTime-procDuration) + ": adding " + procName + " with deadline " + procDeadline + " and duration " + (simulatedTime-time) + ".");
                                             myQueue.add(new MyProc(name, deadline, (simulatedTime-time)));
                                             simulatedTime = time;
                                             break;
                                        else if(simulatedTime <= time) {
                                             if(procDeadline < simulatedTime) {
                                                  System.out.println(simulatedTime + ": done performing " + procName + " (late).");
                                             else {
                                                  System.out.println(simulatedTime + ": done performing " + procName + ".");
               //catch any exception that might occur
               catch(Exception e){
                    System.out.println(e); //print out the error
                    System.exit(1); //exit
          //Check if more than one or less than one parameter is entered
          else {
               //if so give an error
               System.out.println("Error with parameter.");
               System.exit(1); //exit
class ProcComparator implements Comparator<MyProc>{
     public int compare(MyProc x, MyProc y){
          long result = x.getDeadline() - y.getDeadline();
          if(result < 0)
               return -1;
          else if(result > 0)
               return 1;
          else
               return 0;
class MyPQueue<T>{
     public MyHeap<T> theHeap;
     public MyPQueue(Comparator<T> comp) {
          theHeap = new MyHeap<T>(comp);
     public boolean add(T item){
          if(theHeap.add(item)) return true;
          else return false;
     public T peek(){
          return theHeap.peek();
     public int size(){
          return theHeap.numItems();
     public T poll(){
          T result = null;
          if(theHeap.numItems() == 0) return result;
          try{
               result = theHeap.remove();
          catch(Exception e){
               System.out.println(e);
               System.exit(1);
          return result;
     public String toString(){
          return theHeap.toString();
@SuppressWarnings("unchecked")
class MyHeap<T>{
     private Comparator<T> heapComparator = null;
     private final int MAX_SIZE = 1000;
     private T heap[];
     private int rTraverseCount = 0;
     private int aTraverseCount = 0;
     public MyHeap(Comparator<T> comp){
          heapComparator = comp;
          heap = (T[])new Object[MAX_SIZE];
     public int numItems() {
          int numItems = 0;
          for(int i = 0; heap[i] != null; i++) {
               numItems++;
          return numItems;
     public T peek() {
          if(numItems() == 0) return null;
          return heap[0];
     public boolean add(T item) {
          long start = System.nanoTime();
          long time;
          int numItems = numItems();
          if(numItems == 0) {
               heap[numItems] = item;
               System.out.println("--> " + aTraverseCount +" levels were traversed to re-heapify the tree.");
              time = System.nanoTime() - start;
               System.out.println("--> It took " + time + "ns to complete the add operation.");
               return true;
          else if(numItems > 0) {
               heap[numItems] = item;
               siftUp(0, numItems);
               if(aTraverseCount == 1)
                    System.out.println("--> " + aTraverseCount +" level was traversed to re-heapify the tree.");
               else
                    System.out.println("--> " + aTraverseCount +" levels were traversed to re-heapify the tree.");
               aTraverseCount = 0;
               time = System.nanoTime() - start;
               System.out.println("--> It took " + time + "ns to complete the add operation.");
               return true;
          return false;
     public T remove() throws Exception{
          long start = System.nanoTime();
          long time;
          int numItems = numItems();
          T result = heap[0];
          if(numItems == 0){
               throw new Exception("NoSuchElementException");
          if(numItems == 1){
               heap[0] = null;
               time = System.nanoTime() - start;
               System.out.println("--> It took " + time + "ns to complete the remove operation.");
               System.out.println("--> " + rTraverseCount +" levels were traversed to re-heapify the tree.");
               return result;
          else {
               heap[0] = heap[numItems - 1];
               heap[numItems - 1] = null;
               removalswap(0);
               if(rTraverseCount-1 == 1)
                    System.out.println("--> " + (rTraverseCount-1) +" level was traversed to re-heapify the tree.");
               else
                    System.out.println("--> " + (rTraverseCount-1) +" levels were traversed to re-heapify the tree.");
               rTraverseCount = 0;
          time = System.nanoTime() - start;
          System.out.println("--> It took " + time + "ns to complete the remove operation.");
          return result;
     public void removalswap(int root) {
          rTraverseCount++;
          T valueHolder = heap[root];
          int left = (2*root) + 1;
          int right = (2*root) + 2;
          if(heap[right] != null && heap[left] != null){ //make sure left and right children aren't null
               if(heapComparator.compare(heap[root],heap[left]) <= 0 &&  //if root is less than or equal
                  heapComparator.compare(heap[root],heap[right]) <= 0) return; //to its children return
               if(heapComparator.compare(heap[root],heap[left]) > 0){ //if root is greater than left
                    if(heapComparator.compare(heap[left], heap[right]) > 0){ //compare left and right
                         heap[root] = heap[right]; //and swap with the smaller of the two
                         heap[right] = valueHolder;//in this case right is smaller so swap with right
                         removalswap(right);
                    else { //in this case left is smaller so swap with left
                         heap[root] = heap[left];
                         heap[left] = valueHolder;
                         removalswap(left);
               else if(heapComparator.compare(heap[root],heap[right]) > 0){ //root can be greater than left
                         heap[root] = heap[right]; //but smaller than right. In this case just swap with the
                         heap[right] = valueHolder; //right child.
                         removalswap(right);               
          else if(heap[right] == null && heap[left] != null){ //the right child can be null while the left child
               if(heapComparator.compare(heap[root],heap[left]) <= 0) return;//is not, but the left child will never
               else { //be null if the right child isn't. If this is the case see if the root is greater than the
                    heap[root] = heap[left]; //left child and swap if so.
                    heap[left] = valueHolder;
                    removalswap(left);
     public void siftUp(int root, int end) {
          int child = end;
          int parent = (child-1)/2;
          while(child > root){
               parent = (child-1)/2;
               if(heapComparator.compare(heap[parent], heap[child]) > 0) {
                    swap(parent,child);
                    child = parent;
               else{
                    return;
     public void swap(int parent, int child){
          aTraverseCount++;
          T holdValue = heap[parent];
          heap[parent] = heap[child];
          heap[child] = holdValue;
     public String toString(){
          int i = 0;
          String heapPrint = "";
          while(heap[i] != null){
               heapPrint += heap;
               i++;
          return heapPrint;
class MyProc {
     private String name;
     private long deadline;
     private long duration;
     public MyProc(String n, long dl, long dur) {
          name = n;
          deadline = dl;
          duration = dur;
     //Acessors
     public String getName() {
          return name;
     public long getDeadline() {
          return deadline;
     public long getDuration() {
          return duration;
     //Mutators
     public void setName(String n) {
          name = n;
     public void setDeadline(long dl) {
          deadline = dl;
     public void setDuration(long dur) {
          duration = dur;
     public String toString(){
          return name + " " + deadline + " " + duration;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

But if I run that in terminal I get this:
anthony-computer:~ anthonyjk$ java -version
java version "1.5.0_13"Yes - commandline/Terminal, that's what I meant.
So long as the program doesn't use any 1.6-only features, then will it will compile OK both at school (using1.6) and at home (using 1.5). Eclipse can be told to produce .class files that are compatible with a particular runtime. In your case the school compiler was producing 1.6 class files that are no good when you take them home. Hence the need to recompile, telling Eclipse you want 1.5 compatible .class files.
Or - as I mentioned - download and install the most recent JDK for use at home. There'll be less confusion that way

Similar Messages

  • JSF webapp works with Java 1.4, but not Java EE 5

    Hello
    I am having a really weird problem with internationalizing my JavaServer Faces web application.
    I am using Netbeans 6.0, Tomcat 6.0.10, JSF 1.2, and JTSL 1.1....
    If I use Java 1.4 to run the webapp, everything works fine!
    If I use Java EE 5 then it fails to execute internationalization of my choosen locale.
    I could just use Java 1.4 and have my site working fine, but I would really like to use Java EE 5 since it can do more. Also I don't see why it can work on one version of Java but not another. My locales are English (en) and Korean (ko).
    This is my index.jsp
    <%--
        Document   : index
        Created on : 2/05/2008, 01:33:01
        Author     : Steve
    --%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
    <html>
        <f:view locale="#{localeBean.language}">
            <f:loadBundle basename="resources.messages" var="msg"/>
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                <title>JSP Page</title>
            </head>
            <body>
                <h2>Hello <h:outputText value="#{localeBean.country}"/>!</h2>
                <br>
                <h4><h:outputText value="#{msg.language}"/>:</h4>
                <h:form id="languageForm">
                    <h:selectOneMenu   onchange="this.form.submit();" valueChangeListener="#{localeBean.dropdown1_processValueChange}">
                        <f:selectItem itemLabel="English" itemValue="en"/>
                        <f:selectItem itemLabel="������" itemValue="ko"/>
                    </h:selectOneMenu>
                </h:form>
                <h:outputText value="#{localeBean.language}"/>
            </body>
        </f:view>
    </html>This is my localeBean which is under the package "resources"
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package resources;
    * @author Steve
    import java.util.Locale;
    import javax.faces.event.ValueChangeEvent;
    public class localeBean {
        private String language = Locale.getDefault().getLanguage();
        private String country = Locale.getDefault().getCountry();
        public String getLanguage() {
            return language;
        public void setLanguage(String newValue) {
            language = newValue;
        public String getCountry() {
            return country;
        public void setCountry(String newValue) {
            country = newValue;
        public void dropdown1_processValueChange(ValueChangeEvent vce) {
            setLanguage((String) vce.getNewValue());
    }This is my faces-config file
    <?xml version='1.0' encoding='UTF-8'?>
    <!-- =========== FULL CONFIGURATION FILE ================================== -->
    <faces-config version="1.2"
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
    <application> 
            <locale-config>  
                <default-locale>en</default-locale>  
                <supported-locale>en</supported-locale>
                <supported-locale>ko</supported-locale>
            </locale-config>
            <message-bundle> resources.messages </message-bundle>
        </application>
        <managed-bean>
            <managed-bean-name>localeBean</managed-bean-name>
            <managed-bean-class>resources.localeBean</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
    </faces-config>and lastly I have my message bundle under the "resources" package which is named "messages".
    This has a key word "language" which is "Language" in the 'en' locale file and "����" in the 'ko' locale file.
    Once again when using Java 1.4 this project runs fine, however with Java EE 5 it does not.
    You may notice in my index.jsp that I have <h:outputText value="#{localeBean.language}"/>
    I use this to display the locale that has been chosen by my select box. Even when this shows a different language has been chosen the page does still not display in the correct language. According to <f:view locale="#{localeBean.language}"> then the locale of the page should be changed.
    I have looked over the web quite far for an answer to this problem. But everyone else seems to be using a similar method of loading up a message bundle and using it the same way I am. However my method does not work.
    Any suggestions or clues to what is going wrong would be really appreciated.
    Thanks in advance^^

    it seems that the
    <f:view locale="en">
    only work if a ressource bundle with the locale sufix '_en' is provided.
    Everything works now if I provide 3 ressouce files:
    global_en.properties
    global_de.properties
    global.properties
    global.properties and global_en.properties are identically!
    But if I delete the global_en.properties file always the global_de.properties file wins before the default properties.
    I did not expect such a behavior :-(

  • Java in Safari but not in Firefox

    Dear Forum
    I have Java running in Safari, but the java.com test does not pass when I try to do it in Firefox. What can be wrong? What can i do? I require Firefox because I need the Firebug plugin.
    Thanks for any feedback.

    Have you enabled Java and Javascript in the Safari preferences? Have you updated to Tiger 10.4.10?

  • My class only compiles in Java 1.6 and not in Java 1.5

    Hi, my java class wont compile in java 1.5, it only compiles in Java 1.6. How can i compile the following?
    import java.util.*;
    public class ShoppingBasket
         Vector products;
         public ShoppingBasket() { products = new Vector(); }
         public void addProduct(Product product)
         boolean flag = false;
         for(Enumeration e = getProducts(); e.hasMoreElements();)
              { Product item = (Product)e.nextElement();
                   if(item.getId().equals(product.id))
                   {flag = true; item.quantity++; break; }
              if(!flag){ products.addElement(product);}
         public void deleteProduct(String str)
              for(Enumeration e=getProducts();
              e.hasMoreElements();)
              { Product item = (Product)e.nextElement();
                   if(item.getId().equals(str))
                   {products.removeElement(item); break; }
         public void emptyBasket(){products = new Vector();}
         public int getProductNumber(){ return products.size();}
         public Enumeration getProducts() { return products.elements(); }
         public double getTotal()
         Enumeration e = getProducts();
         double total; Product item;
         for(total=0.0D;e.hasMoreElements();     total+= item.getTotal())
         {item = (Product)e.nextElement(); }
         return total;
    }It should link with a class called Product which compiles fine... the errors i get are below:
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:6: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
            public void addProduct(Product product)
                                   ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:10: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:10: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:20: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:20: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:35: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
            double total; Product item;
                          ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:36: inconvertible types
    found   : <nulltype>
    required: double
            for(total=0.0D;e.hasMoreElements();     total+= item.getTotal())
                                                                         ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:37: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
            {item = (Product)e.nextElement(); }
                     ^
    8 errors

    fahafiz wrote:
    ah, so should i put the classes into the folder which the classpath is assigned to?More likely you should assign your classpath to whatever folder your classes are in.
    Put your files where they make sense, and then fill in classpath accordingly:
    javac -classpath classpath MyFile.java(I think, it's been a while since I compiled from the command-line, see http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html)

  • Java will run but not compile

    I have had to format my computer and i re-installed java 1.5 and set up the system variables, but when i tried to compile some code it cannot find javac
    i have already compiled it before so i run the compiled code and it worked fine, it found java.exe
    the problem might be that when i tyyped the JAVA_HOME variable i accidentally typed it in with a space before it, but i got rid of that, but it still doesn't work. I have put i%JAVA_HOME% in the PATH, sp i dont know whats wrong with it. I've installed java quite a few times, and i'm sure i've set the variables up properly,.
    Any ideas?

    Thanks for your replies.
    The javac.exe does exist, its in the right places, i can compile if i type:
    "c:\program files\java\jdk1.5.0\bin\javac!" Word.java
    but typing
    javac Word.java
    doesn't work, so i think i'm right in thinkin this is a problem with the system variables.
    But the variables are exactly the same as on my mates computer, which works.
    I tried putting %JAVA_HOME%\bin\ in the path, but no luck, so i put it bac to just %JAVA_HOME%, still no luck.
    My variables are:
    JAVA_HOME - C:\Program Files\Java\jdk1.5.0\bin
    PATH - all the stuuf already there + ;%JAVA_HOME%
    I've got microsoft visual studio installed thats got some environmental variables set up , one called path, would that be interferring?
    Also, when i first put in the JAVA_HOME is set it to " C:\Program Files\Java\jdk1.5.0\bin" with a space before it, but it aint worked even after i changed it..
    I can remember having the same problem on my old computer, after i upgraded to 1.5 from 1.4, when i changed the JAVA_HOME variable, it didn't work.
    thanks

  • Works with Java 1.4 but not with Java 1.5

    Please check
    http://forum.java.sun.com/thread.jspa?threadID=791767&tstart=0
    in the Java Programming Forum.
    Thanks!

    it seems that the
    <f:view locale="en">
    only work if a ressource bundle with the locale sufix '_en' is provided.
    Everything works now if I provide 3 ressouce files:
    global_en.properties
    global_de.properties
    global.properties
    global.properties and global_en.properties are identically!
    But if I delete the global_en.properties file always the global_de.properties file wins before the default properties.
    I did not expect such a behavior :-(

  • My java is installed but not working

    My java is installed and it was working fine a couple of days ago but when i went to restart my computer my java had stop working. I checked to see if my enable java was checked in the security tab, and it is but it's still not working? Is something wrong with my Mac? since i had restarted my safari i'm thinking that was the issue.

    Check if your bank has a app for the iPad. It sounds like you are trying to use the bank's web page/site rather than using an app.

  • Deploying web dynpro java application successfully but not working

    Hi all,
    I have a web dynpro java application. When I deployed in my local portal (7.10 SP6) it is working fine. But when I deployed in another portal (7.10 SP2) it is not working totally. In system default trace I saw below exception:
    Failed to create deployable object 'sap.com/a1sbicbc~unv' since it is not a Web Dynpro object.
    It seems that the web dynpro application was not deployed anymore, but in deployment UI I can see the package was deployed without any errors.
    In this situation, is there any other portal/java engine configuration which may prevent the web dynpro application being deployed? For example deployment or security policy, etc?
    Looking forward for replies.
    B.R.

    Hi,
    Try to undeploy the application from the server
    Then deploy it
    Regards
    Ayyapparaj

  • Compiling in SQLDeveloper gives error, but not sqlplus

    Hi All,
    My case is very strange. I am able to compile a package body from sqlplus successfully, but gets the error "PLS-00707: unsupported construct or internal error [2603]" if I do the same from Oracle SQL Developer. My procedure is so big that I could not copy it here.
    Thanks,
    Sharmin

    you are in the wrong forum, this one is dedictaed to oracle forms.

  • .java file compiling but not executing in jdk6

    Using javac in jdk6 I can compile a .java file but cant executing the same using java command from my own directory. I can still compile and execute the same file from jdk\bin directory. I am using windows XP Home. While executing the .java file from my own directory, it fires a message: "The Java class could not be loaded. java.lang.UnsupportedClassVersionError: Myfilename (Unsupported major.minor Version 50.0)". i have set path in environment variable as "C:\sun\sdk\jdk\bin" where jdk placed in sun\sdk.
    Please help me to solve the problem

    This isn't information we can give you. You have to set it up based on your system.
    Do you understand how execution paths work? There's a list of filesystem paths, separated by a semicolon or a colon depending on the system, all concatenated into one big string. The entries earlier in the string are looked in first.
    So if your path has this:
    c:\Windows\java;c:\sun\sdk\jdk\bin
    Then if you type "java" from the command line, the Windows one would be executed, not the JDK 6 one.

  • Compile correct but not run java programs

    I have problem. Java program copile correctly but not run. I can't understand this one.
    **this is the error**
    Exception in thread "main" java.lang.NoClassDefFoundError: suminda
    Caused by: java.lang.ClassNotFoundException: suminda
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Could not find the main class: suminda. Program will exit.

    The error is telling you that the jvm could not find a class named suminda. Are you aware that class names are case sensitive? Suminda is not the same as suminda for example.
    This error usually happens when you haven't specified the classpath correctly. A simple thing to try isjava -cp  .  sumindaHere's some links that may help.
    [http://www.kevinboone.com/classpath.html]
    [http://java.sun.com/javase/6/docs/technotes/tools/findingclasses.html]

  • Path not working in win xp pro, can call java but not javac !

    Hello,
    I just upgraded to win xp and set up the J2SDK. I have set the path variable in the environment settings.
    when I tried to test this by typing java from my documents directory it works all right but not the javac command, to which it gives the error
    "'javac' is not recognized as an internal or external command,
    operable program or batch file."
    when I type path then I get the following result -
    PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\FSC\PCOBOL32;C:\Program Files\FSC\PCOBOL32;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;c:\borland\bcc55\bin; c:\jdk1.4.0_01\bin;C:\FSC\PCOBOL32;C:\PROGRAM\PCOBOL32 , so my path settings are correct.
    Why is this happening? Thanks for any help.
    - rdg
    P.S. I also am also unable to invoke the c++ compiler from my documents, so I think this may be a problem with my path, but then how am i able to call the java.exe ?

    -----BEGIN PGP SIGNED MESSAGE-----
    In win xp you must type the name of the directory as Dos-8 format,
    for example, if you want to use c:\J2sdk1.4.0_01 you must write in
    the path c:\j2sdk1~1.0_0
    -----BEGIN PGP SIGNATURE-----
    Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
    iQEVAwUBPWL6quIx3Zm+mBoJAQFhVwf/dM2pfQYN5Wp5AnmD+HV1Nx+5MSm1zmUs
    b3UPC8xJt0JhJItyims6YLEJKAv+Mrm0sk3fVyfg1o4Tcpw0bzG/RsVdsTsrmlDu
    vUlqWrxgTRH85IAjro83lGNuLUo6PKs10hVj4h4tqL8BkLE4pCkZfLT2tpG7VLt0
    YylUFx6DZQzF1HVK9+6MqYOvBEjxLhkNRHThNysUJj6SBkNHKDbDgnOcUQf+8PpZ
    RxItuKGUys6FdLSvrxonbj2qbHJ34Ewb/a8DL1MXcCOtP2QGIta4ozq/3SVPDAK4
    BD/NG97FsuYbL/l18Je4EzXRWqtG9IlIY8WBhbdx8X3B3fpuq8gICw==
    =UJDG
    -----END PGP SIGNATURE-----

  • Javac is working but not java

    PLEASE HELP.
    I've got a project due very soon, and I can't get very far until I can run my apps.
    Thank you,
    Dustin
    1.
    I CAN compile a single .java file if it does NOT refer to any class outside of itself.
    2.
    I CAN'T compile a .java file if it refers to another class outside of itself (even if it's with in the same directory.
    3.
    If I comment out the line that refers to an outside class then I can compile the .java file.
    HOWEVER, When I run the 'java Ap00.class' command, I get this error:
    Exception in thread "main" java.lang.NoClassDefFoundError: Ap00/class.
    This also applies to the above part 1. I can't work the .java command no matter what.
    4. Here is my
    classpath:
    ".;C:\j2sdk1.4.1_01\lib;C:\Prog\AudioPlayer;"
    Path:
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\PROGRA~1\ULTRAE~1;C:\Program Files\Common Files\Autodesk Shared\;C:\j2sdk1.4.1_01\bin
    They look alright to me.
    5. Yes, this program used to run just fine. I have not altered it. Everything got screwy when I upgraded to WinXP.
    6. Everything works fine inside of a an IDE like Forte.
    Ap.00 compiles and runs.
    It seems that the answer is right under my nose, but I just can't put it together.

    Open a console window.
    Type the following
    echo %CLASSPATH%
    The output is your class path. (Do not guess what it is. Follow the above to find out exactly.)
    Your classes do NOT have packages right?
    You can test a class path with the following even if there is no 'main' in the class.
    java MyClass
    If you run the above and you get a no class found error, then your class path is wrong. If you get a 'no main' (or it runs) then the class path is right.
    This part of your classpath "C:\j2sdk1.4.1_01\lib" is non-sensical. I doubt you are putting your classes in there. And java itself uses jars and that will not pick them up. Remove it.
    When you run you are in the directory where the class files are correct? Or they are in "C:\Prog\AudioPlayer"

  • [weblogic-9.1] JSP 2.0 tag file gets compiled but not reloaded

    I am trying to use a JSP 2.0 tag file on weblogic 9.1. Everything works as expected until I reload the page after changing the tag file. Consider the following files, simple.jsp and simple.tag:
    h5. /simple.jsp
    &lt;%@ page language="java" %&gt;
    &lt;%@ taglib prefix="sandbox" tagdir="/WEB-INF/tags" %&gt;
    &lt;html&gt;
    &lt;body&gt;
    This output comes from the jsp.
    &lt;sandbox:simple&gt;
    &lt;/sandbox:simple&gt;
    &lt;/body&gt;
    &lt;/html&gt;h5. /WEB-INF/tags/simple.tag
    &lt;%@ tag language="java" %&gt;
    <div>This output comes from a tag file
    </div>The output of a call to simple.jsp is:
    <html><head>
    </head><body>
    This output comes from the JSP.
    <div>This output comes from a tag file</div>
    </body></html>So far, so good. Now I change the content of simple.tag to
    <%@ tag language="java" %>
    <div>This output comes from *simple.tag*<div>On a new call to simple.jsp,
    1. Weblogic notices that the file has been changed,
    2. generates the TagHandler .java file
    3. compiles the .java file
    But the new class file seems not to be loaded by weblogic; the resulting HTML does not change. It is not a browser cache issue, as I can see Javelin compilation errors. E.g., changing the tag file content to
    <%@ tag language="j" %>
    <div>This output comes from simple.tag</div>leads to the following (expected) error:
    Compilation of JSP File '/sandbox/simple.jsp' failed:
    simple.tag:1:18: "j" is not a valid setting for the language attribute.
    <%@ tag language="j" %>
    ^-^
    Changes to the .jsp file are reflected in the HTML output.
    Am I missing something? Is there any flag I have to set in my weblogic configuration?

    You are right in saying that decoding has nothing to
    do with rendering per se.I will go even further than Erik did, and dispute this statement.
    Consider that you are generating an <input> tag for a text field. Among other things, you have to generate a "name" attribute. Who decides what to put there? The renderer that actually created the markup.
    The "renderer" really does
    two completely different things. But both should
    nevertheless be separate from the component
    implementation itself. You could still have the
    renderer doing the decoding part, which arguably would
    rarely change, and somehow delegate the actual
    rendering to an implementation in a tag file.Whether you implement decoding in a separate class or inside the component, what request parameter name do you look for? It is not reasonable to assume that ALL possible renderers will choose the same parameter name ... hence, decoding and encoding are inextricably linked (the code doing the decoding has to know what kind of markup the code doing the encoding actually created). In JavaServer Faces, the current APIs create that linkage by requiring that the decode and encode be done by the same class (either the component, if you are not delegating, or the renderer if you are).
    Craig

  • Private nullref symbol in 5.6 but not with 5.5 C++ compiler

    We try to use the libmtmalloc.so library with our project using LD_PRELOAD_32 environment variable:
    export LD_PRELOAD_32=/usr/lib/libmtmalloc.so.1This library provides advanced memory management and memory debugging features.
    We have two Solaris machines named ‘earth2’ and ‘mars’. ‘earth2’ has “CC: Sun C++ 5.6” compiler, while ‘mars’ has an older version “CC: Sun C++ 5.5”.
    If we build our application on ‘earth2’ and load it with libmtmalloc.so library, it crashes inside heap memory management functions invoked from std::basic_string methods. The same application built on ‘mars’ machine runs without problems. It seems that the reason of the crash is a visibility of std::basic_string::__nullref symbol generated differently by each version of compiler. The following little code sample demonstrates the problem
    main.cpp
    =======
    #include <string>
    int main()
           std::string strA = "";
           std::string strB = "aaa";
           strA = strB;
          return 0;
    }If we build this sample on both machines, we can see that each compiler provides a different visibility of std::basic_string::__nullref symbol.
    On ‘earth2’ machine
    ===============
    hsbld33BM@earth2 $ CC -V
    CC: Sun C++ 5.6 2004/07/15
    hsbld33BM@earth2 $ CC -v main.cpp
    hsbld33BM@earth2 $ elfdump -s -C a.out | grep nullref
    [3] 0x00021720 0x00000030 OBJT WEAK D 0 .data std::basic_string<char,std::char_traits<char>,std::allocator<char> >::__nullref
    [13] 0x00021718 0x00000004 OBJT WEAK D 0 .data std::basic_string<char,std::char_traits<char>,std::allocator<char> >::__i_ctl___nullref
    [56] 0x00021720 0x00000030 OBJT WEAK D 0 .data std::basic_string<char,std::char_traits<char>,std::allocator<char> >::__nullref
    [66] 0x00021718 0x00000004 OBJT WEAK D 0 .data std::basic_string<char,std::char_traits<char>,std::allocator<char> >::__i_ctl___nullref
    On ‘mars’ machine
    ==============
    hsbld33BM@mars $ CC –V
    CC: Sun C++ 5.5 2003/03/12
    hsbld33BM@mars $ CC -v main.cpp
    ### command line files and options (expanded):
    ### -v main.cpp
    ### CC: Note: NLSPATH = /opt/SUNWspro/prod/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/SUNWspro/prod/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
    /opt/SUNWspro/prod/bin/ccfe -y-o -ymain.o -y-fbe -y/opt/SUNWspro/prod/bin/fbe -y-xarch=generic -y-verbose -O0 -ptf /tmp/29641%1.%2 -ptx /opt/SUNWspro/prod/bin/CC -ptk "-v -xs " -D__SunOS_5_9 -D__SUNPRO_CC=0x550 -Dunix -Dsun -Dsparc -D__sparc -D__unix -D__sun -D__BUILTIN_VA_ARG_INCR -D__SVR4 -D__SUNPRO_CC_COMPAT=5 -xdbggen=no%dwarf2+stabs -y-s -xdbggen=incl -y-xmemalign=4s -I-xbuiltin -xldscope=global -instlib=/opt/SUNWspro/prod/lib/libCstd.a -I/opt/SUNWspro/prod/include/CC/Cstd -I/opt/SUNWspro/prod/include/CC -I/opt/SUNWspro/prod/include/CC/rw7 -I/opt/SUNWspro/prod/include/cc -D__SUN_PREFETCH -xcomdat -y-comdat main.cpp -s /tmp/ccfe.29641.0.s >&/tmp/ccfe.29641.1.err
    rm /tmp/ccfe.29641.0.s
    ### CC: Note: LD_LIBRARY_PATH = (null)
    ### CC: Note: LD_RUN_PATH = (null)
    ### CC: Note: LD_OPTIONS = (null)
    /usr/ccs/bin/ld -u __1cH__CimplKcplus_init6F_v_ -zld32=-S/opt/SUNWspro/prod/lib/libldstab_ws.so -zld64=-S/opt/SUNWspro/prod/lib/v9/libldstab_ws.so -zld32=-S/opt/SUNWspro/prod/lib/libCCexcept.so.1 -zld64=-S/opt/SUNWspro/prod/lib/v9/libCCexcept.so.1 -R/opt/SUNWspro/lib/rw7:/opt/SUNWspro/lib:/usr/ccs/lib:/usr/lib -o a.out /opt/SUNWspro/prod/lib/crti.o /opt/SUNWspro/prod/lib/CCrti.o /opt/SUNWspro/prod/lib/crt1.o /opt/SUNWspro/prod/lib/values-xa.o -Y P,/opt/SUNWspro/lib/rw7:/opt/SUNWspro/lib:/opt/SUNWspro/prod/lib/rw7:/opt/SUNWspro/prod/lib:/usr/ccs/lib:/usr/lib main.o -lCstd -lCrun -lm -lw -lc /opt/SUNWspro/prod/lib/CCrtn.o /opt/SUNWspro/prod/lib/crtn.o >&/tmp/ld.29641.2.err
    rm main.o
    rm /tmp/ccfe.29641.1.err
    rm /tmp/ld.29641.2.err
    hsbld33BM@mars $ elfdump -s -C a.out | grep nullref
    [25] 0x00021300 0x00000030 OBJT GLOB D 0 .bss std::basic_string<char,std::char_traits<char>,std::allocator<char> >::__nullref
    [92] 0x00021300 0x00000030 OBJT GLOB D 0 .bss std::basic_string<char,std::char_traits<char>,std::allocator<char> >::__nullref
    We want to be able to use the libmtmalloc.so with newer compiler version. Please advise what we should do in order to achieve this goal.

    Those old compiler versions probably still have several bugs relating to the string class. Both are End Of Life. No support will be available for C++ 5.5 after this year, and all support ends for C++ 5.6 next year.
    The best solution would be to upgrade to a supported release. If you need to build or run on Solaris 8 (which is also End Of Life), get Sun Studio 11, which is free.
    [http://developers.sun.com/sunstudio/products/previous/11/index.jsp]
    If you don't need to build or run on anything earlier than Solaris 9, get Sun Studio 12, which is also free.
    [http://developers.sun.com/sunstudio/]
    "Free" means there is no license fee, no charge for downloading or use, nor for the distribution of applications created with Sun Studio.
    Next, whatever compilers you wind up using, be sure to get all the current patches. At a minimum, get the patches for the C compiler, C++ compiler, the compiler "back end" (sometimes called "common components"), and the C++ runtime library. You can get all patches here:
    [http://developers.sun.com/sunstudio/downloads/patches/index.jsp]
    The updated C++ runtime libraries need to be installed on the build system and on all target systems.
    You should also be sure that your build processes do not contribute to the problem:
    1. The C++ runtime libraries must be linked dynamically (the .so versions). Static linking can cause program failures when the application consists of other shared (dynamic) libraries, or when you run on a system different from the compilation system.
    2. When you build on one version of Solaris, the application can run on later versions of Solaris, but not on earlier versions.
    3. When you create a binary (.o, .a, .so) using one compiler version, it can be linked into a program created by a later compiler verison, but not into a program created by an earlier compiler version. (Note: the compiler version installed on a computer should not matter, since in a properly-constructed program, there is no runtime dependency on the installed compiler.)
    Information about supported compilers and interactions are listed in the Support Matrix:
    [http://developers.sun.com/sunstudio/support/matrix/index.jsp]

Maybe you are looking for

  • Flash crashing on Nightly and 6.0 when new tabs are opened

    Say I open a YouTube video, it works fine until I open a new tab or open a new instance of Firefox. Flash will then crash. It doesn't resolve itself by removing and reinstalling flash, or updating Firefox in any form. This has only happened as of tod

  • What if my 8GB iPod Touch 4th Gen. won't charge and won't keep it's charge?

    My iPod Touch 4thGen. 8GB 6.1.3, doesn't charge at all. For the past 2 weeks I've tried different cables/wires, 2 computers, different wall jacks, and my car charger, but to no success... And every time I somehow do manage to get it to charge, it doe

  • Language change in work flow

    hi,   I would like to know how to change the work item language(in inbox the work item subject should come in the language in which a person logs in to the system)say if a person logs in french the work item subject in inbox should come in french.lik

  • LR preview vs photoshop rendition

    I have read several threads on this issue because I have had this problem from time to time, my preview looks completely different from the version I open in photoshop, but since the problem was intermittent,I could usually find a work around.  99% o

  • HP 8500 won't give the option to perform a third level print head cleaning

    I'm not sure why I care since every time I clean the heads the printer is actually worse but the printer never gives me the option to go to level three cleaning. The steps * Go to clean print head option in the menu * Printer goes through cleaning pr