Computerized WorldComputerized WorldDiscussion on latest News and Events in my computerized world Articles
Verify calling Javascript function available to avoid runtime errors
2008-08-07 13:55:00 Do you want to verify whether a Javascript function exists before calling it to avoid runtime errors? With Javascript we used to call Javascript functions. But sometimes our Javascript code tend to throw runtime errors and showing then on the browser. For this there can be several reasons including; incorrect function names or invalid .js file names causing some functions not loaded into your web page. Javascript has the ability to check this. For that we can use the typeof keyword, and check whether that is of 'function' type or not.Generally we will be calling a Javascript function without checking whether it exists. Following code shows how we would call a function.function callClient(){ myTestFunction();}If the function named myTestFunction() is not available, the browser will show an error message at runtime. But we can check whether this method is available even before calling it, avoiding the errors. Following code snippet checks the existence before calling a function.f... More About: Tech , Calling , Errors , Avoid
Verify calling Javascript function available to avoid runtime errors
2008-08-07 13:55:00 Do you want to verify whether a Javascript function exists before calling it to avoid runtime errors? With Javascript we used to call Javascript functions. But sometimes our Javascript code tend to throw runtime errors and showing then on the browser. For this there can be several reasons including; incorrect function names or invalid .js file names causing some functions not loaded into your web page. Javascript has the ability to check this. For that we can use the typeof keyword, and check whether that is of 'function' type or not.Generally we will be calling a Javascript function without checking whether it exists. Following code shows how we would call a function.function callClient(){ myTestFunction();}If the function named myTestFunction() is not available, the browser will show an error message at runtime. But we can check whether this method is available even before calling it, avoiding the errors. Following code snippet checks the existence before calling a function.f... More About: Tech , Calling , Errors , Avoid
Verify calling Javascript function available to avoid runtime errors
2008-08-07 13:55:00 Do you want to verify whether a Javascript function exists before calling it to avoid runtime errors? With Javascript we used to call Javascript functions. But sometimes our Javascript code tend to throw runtime errors and showing then on the browser. For this there can be several reasons including; incorrect function names or invalid .js file names causing some functions not loaded into your web page. Javascript has the ability to check this. For that we can use the typeof keyword, and check whether that is of 'function' type or not.Generally we will be calling a Javascript function without checking whether it exists. Following code shows how we would call a function.function callClient(){ myTestFunction();}If the function named myTestFunction() is not available, the browser will show an error message at runtime. But we can check whether this method is available even before calling it, avoiding the errors. Following code snippet checks the existence before calling a function.f... More About: Tech , Calling , Errors , Avoid
Write Java with JDK 1.5 features and run on JRE 1.4
2008-08-06 14:33:00 Have you being writing your Java code on Java 1.5 (JDK 1.5) with new features like auto boxing, generics and enums? And suddenly realized that your customer's servers are still using Java 1.4 (JRE 1.4)? This is not a surprise since most of the customers are not in a position to take a risk and try the newer versions as they are running live/online businesses. But as professionals in the software development field, we have to move with the latest/stable versions available in the market. That's where the conflict occurs.Now you must deploy your Java 1.5 codes into a 1.4 Java runtime environment (even may be 1.3 or 1.2). Even if the Java code has not used any of the new features of Java 1.5, you still can not run your code in 1.4 JRE as the runtime throws an error saying "java.lang.UnsupportedClassVersionError". Compile 1.5 codes for 1.4 JVMJava compiler provides an option to specify the target JVM of the generated classes like 1.5, 1.4, and 1.3 as follows.public class MyClass { pu... More About: News , Tools , Tech , Features
Write Java with JDK 1.5 features and run on JRE 1.4
2008-08-06 14:33:00 Have you being writing your Java code on Java 1.5 (JDK 1.5) with new features like auto boxing, generics and enums? And suddenly realized that your customer's servers are still using Java 1.4 (JRE 1.4)? This is not a surprise since most of the customers are not in a position to take a risk and try the newer versions as they are running live/online businesses. But as professionals in the software development field, we have to move with the latest/stable versions available in the market. That's where the conflict occurs.Now you must deploy your Java 1.5 codes into a 1.4 Java runtime environment (even may be 1.3 or 1.2). Even if the Java code has not used any of the new features of Java 1.5, you still can not run your code in 1.4 JRE as the runtime throws an error saying "java.lang.UnsupportedClassVersionError". Compile 1.5 codes for 1.4 JVMJava compiler provides an option to specify the target JVM of the generated classes like 1.5, 1.4, and 1.3 as follows.public class MyClass { pu... More About: News , Tools , Tech , Features
Write Java with JDK 1.5 features and run on JRE 1.4
2008-08-06 14:33:00 Have you being writing your Java code on Java 1.5 (JDK 1.5) with new features like auto boxing, generics and enums? And suddenly realized that your customer's servers are still using Java 1.4 (JRE 1.4)? This is not a surprise since most of the customers are not in a position to take a risk and try the newer versions as they are running live/online businesses. But as professionals in the software development field, we have to move with the latest/stable versions available in the market. That's where the conflict occurs.Now you must deploy your Java 1.5 codes into a 1.4 Java runtime environment (even may be 1.3 or 1.2). Even if the Java code has not used any of the new features of Java 1.5, you still can not run your code in 1.4 JRE as the runtime throws an error saying "java.lang.UnsupportedClassVersionError". Compile 1.5 codes for 1.4 JVMJava compiler provides an option to specify the target JVM of the generated classes like 1.5, 1.4, and 1.3 as follows.public class MyClass { pu... More About: News , Tools , Tech , Features
Java: Numbers only String by removing non numeric characters
2008-07-31 14:05:00 With Java , deleting non numeric characters (letters, symbols etc) from a string to produce a numbers-only String is a common requirement in web applications, as application users are used to insert numeric values with non-numeric characters. For example a phone number will be entered with (-) characters like;650-212-5710. A price value may be entered with (,) characters like;12,500.00In Java, java.lang.Character class has a method; isDigit() which can be used to identify whether a character is a digit or not. Following method can be used for extracting a numbers-only string.public static String getOnlyNumeric s(String str) { if (str == null) { return null; } StringBuffer strBuff = new StringBuffer(); char c; for (int i = 0; i < str.length() ; i++) { c = str.charAt(i); if (Character.isDigit(c)) { strBuff.append(c); } } return strBuff.toString();}Calling above method with any String will return a numbers-onl... More About: Tech , Characters , Numbers
Java: Numbers only String by removing non numeric characters
2008-07-31 14:05:00 With Java , deleting non numeric characters (letters, symbols etc) from a string to produce a numbers-only String is a common requirement in web applications, as application users are used to insert numeric values with non-numeric characters. For example a phone number will be entered with (-) characters like;650-212-5710. A price value may be entered with (,) characters like;12,500.00In Java, java.lang.Character class has a method; isDigit() which can be used to identify whether a character is a digit or not. Following method can be used for extracting a numbers-only string.public static String getOnlyNumeric s(String str) { if (str == null) { return null; } StringBuffer strBuff = new StringBuffer(); char c; for (int i = 0; i < str.length() ; i++) { c = str.charAt(i); if (Character.isDigit(c)) { strBuff.append(c); } } return strBuff.toString();}Calling above method with any String will return a numbers-onl... More About: Tech , Characters , Numbers
Java: Numbers only String by removing non numeric characters
2008-07-31 14:05:00 With Java , deleting non numeric characters (letters, symbols etc) from a string to produce a numbers-only String is a common requirement in web applications, as application users are used to insert numeric values with non-numeric characters. For example a phone number will be entered with (-) characters like;650-212-5710. A price value may be entered with (,) characters like;12,500.00In Java, java.lang.Character class has a method; isDigit() which can be used to identify whether a character is a digit or not. Following method can be used for extracting a numbers-only string.public static String getOnlyNumeric s(String str) { if (str == null) { return null; } StringBuffer strBuff = new StringBuffer(); char c; for (int i = 0; i < str.length() ; i++) { c = str.charAt(i); if (Character.isDigit(c)) { strBuff.append(c); } } return strBuff.toString();}Calling above method with any String will return a numbers-onl... More About: Tech , Characters , Numbers
How to open a .war (web archive) or .jar (java archive) files
2008-07-30 14:14:00 With Java we generate .JAR files to bundle a set of resources. For J2EE web applications, we generate .WAR (Web Archive ) files for deployments. Both of these are ways of archiving a set of files.Both these .jar or .war archives are in zip format. So there are plenty of ways to open those files to read the content. One way would be to use any tool that you use to open/extract a .zip file. Next will be to use the Jar command itself.JAR CommandJAR (command) utility in Java can be used to open/extract these files as follows. Run following command from the folder where you need the content to be extracted by providing the path to the archive.jar xf <path-to-file>options:x - extract the filesf - file to extractjar xf myWebApp.warjar xf myProject.jarRelated : Open and read a file inside a war file of a web application with JavaHome More About: Tech , Files
How to open a .war (web archive) or .jar (java archive) files
2008-07-30 14:14:00 With Java we generate .JAR files to bundle a set of resources. For J2EE web applications, we generate .WAR (Web Archive ) files for deployments. Both of these are ways of archiving a set of files.Both these .jar or .war archives are in zip format. So there are plenty of ways to open those files to read the content. One way would be to use any tool that you use to open/extract a .zip file. Next will be to use the Jar command itself.JAR CommandJAR (command) utility in Java can be used to open/extract these files as follows. Run following command from the folder where you need the content to be extracted by providing the path to the archive.jar xf <path-to-file>options:x - extract the filesf - file to extractjar xf myWebApp.warjar xf myProject.jarRelated : Open and read a file inside a war file of a web application with Java More About: Tech , Files
How to open a .war (web archive) or .jar (java archive) files
2008-07-30 14:14:00 With Java we generate .JAR files to bundle a set of resources. For J2EE web applications, we generate .WAR (Web Archive ) files for deployments. Both of these are ways of archiving a set of files.Both these .jar or .war archives are in zip format. So there are plenty of ways to open those files to read the content. One way would be to use any tool that you use to open/extract a .zip file. Next will be to use the Jar command itself.JAR CommandJAR (command) utility in Java can be used to open/extract these files as follows. Run following command from the folder where you need the content to be extracted by providing the path to the archive.jar xf <path-to-file>options:x - extract the filesf - file to extractjar xf myWebApp.warjar xf myProject.jarRelated : Open and read a file inside a war file of a web application with Java More About: Tech , Files
Web Services with Apache Axis 1.4 Tutorial: server and client sides
2008-07-29 14:21:00 Web services are a handy method of integrating independent systems. Apache Axis is one of the best free tools available for implementing and deploying web services, and also for implementing the web service clients.In this article we will create a simple, but complete web service and a client for this service step-by-step. Article will be explanatory as much as possible to succeed you in implementing it yourself alone after completing this tutorial.PrerequisitesMust be familiar with Java Familiar with basics on a web server like TomcatSome knowledge in configuring Axis will be an added advantageSystem Configuration RequirementsWe will be discussing the configuration in brief as our scope is mainly on web services. (If Axis already configured, jump to implementation). If you find any issues on the configuration part, you can refer to Apache Axis site for troubleshooting. (But if you can not solve it yourself do not worry, post the issue under the comments section in this article, and ... More About: Services , Tutorial , Tech
Web Services with Apache Axis 1.4 Tutorial: server and client sides
2008-07-29 14:21:00 Web services are a handy method of integrating independent systems. Apache Axis is one of the best free tools available for implementing and deploying web services, and also for implementing the web service clients.In this article we will create a simple, but complete web service and a client for this service step-by-step. Article will be explanatory as much as possible to succeed you in implementing it yourself alone after completing this tutorial.PrerequisitesMust be familiar with Java Familiar with basics on a web server like TomcatSome knowledge in configuring Axis will be an added advantageSystem Configuration RequirementsWe will be discussing the configuration in brief as our scope is mainly on web services. (If Axis already configured, jump to implementation). If you find any issues on the configuration part, you can refer to Apache Axis site for troubleshooting. (But if you can not solve it yourself do not worry, post the issue under the comments section in this article, and ... More About: Services , Tutorial , Tech
Web Services with Apache Axis 1.4 Tutorial: server and client sides
2008-07-29 14:21:00 Web services are a handy method of integrating independent systems. Apache Axis is one of the best free tools available for implementing and deploying web services, and also for implementing the web service clients.In this article we will create a simple, but complete web service and a client for this service step-by-step. Article will be explanatory as much as possible to succeed you in implementing it yourself alone after completing this tutorial.PrerequisitesMust be familiar with Java Familiar with basics on a web server like TomcatSome knowledge in configuring Axis will be an added advantageSystem Configuration RequirementsWe will be discussing the configuration in brief as our scope is mainly on web services. (If Axis already configured, jump to implementation). If you find any issues on the configuration part, you can refer to Apache Axis site for troubleshooting. (But if you can not solve it yourself do not worry, post the issue under the comments section in this article, and ... More About: Services , Tutorial , Tech
Java2WDSL & WSDL2Java - java.util.Date not handled consistently
2008-07-16 14:28:00 Java2WSDL and WSDL2Java tools in Axis (1.4) are pretty handy tools. Those help you to generate a WSDL from a java class as well as generating stubs/skeletons from a WSDL. But if you are dealing with java.util.Date fields in your code, you must pay some attention.Java2WSDLConsider the following java interface which uses java.util.Date as a return type as well as a method parameter.public interface MyService { public java.util.Date getNextDate(); public void updateLastRun(java.util.Date date);}When the Java2WDSL tool generates a WSDL for a class with a Date field, it will represent java.util.Date fields as dateTime fields in WSDL. The generated WSDL file would look as follows.<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions targetNamespace="http://service" xmlns:apachesoap="http://xml.apache.org/x ml-soap" xmlns:impl="http://service" xmlns:intf="http://service" xmlns:soapenc="http://schemas.xmlsoap.org /soap/encoding/" xmlns:wsdl="h... More About: Java , Tech , Web Services
Java2WDSL & WSDL2Java - java.util.Date not handled consistently
2008-07-16 14:28:00 Java2WSDL and WSDL2Java tools in Axis (1.4) are pretty handy tools. Those help you to generate a WSDL from a java class as well as generating stubs/skeletons from a WSDL. But if you are dealing with java.util.Date fields in your code, you must pay some attention.Java2WSDLConsider the following java interface which uses java.util.Date as a return type as well as a method parameter.public interface MyService { public java.util.Date getNextDate(); public void updateLastRun(java.util.Date date);}When the Java2WDSL tool generates a WSDL for a class with a Date field, it will represent java.util.Date fields as dateTime fields in WSDL. The generated WSDL file would look as follows.<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions targetNamespace="http://service" xmlns:apachesoap="http://xml.apache.org/x ml-soap" xmlns:impl="http://service" xmlns:intf="http://service" xmlns:soapenc="http://schemas.xmlsoap.org /soap/encoding/" xmlns:wsdl="h... More About: Java , Tech , Web Services
Java2WDSL & WSDL2Java - java.util.Date not handled consistently
2008-07-16 07:28:00 Java2WSDL and WSDL2Java tools in Axis (1.4) are pretty handy tools. Those help you to generate a WSDL from a java class as well as generating stubs/skeletons from a WSDL. But if you are dealing with java.util.Date fields in your code, you must pay some attention.Java2WSDLConsider the following java interface which uses java.util.Date as a return type as well as a method parameter.public interface MyService { public java.util.Date getNextDate(); public void updateLastRun(java.util.Date date);}When the Java2WDSL tool generates a WSDL for a class with a Date field, it will represent java.util.Date fields as dateTime fields in WSDL. The generated WSDL file would look as follows.<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions targetNamespace="http://service" xmlns:apachesoap="http://xml.apache.org/x ml-soap" xmlns:impl="http://service" xmlns:intf="http://service" xmlns:soapenc="http://schemas.xmlsoap.org /soap/encoding/" xmlns:wsdl="h... More About: Java , Tech
Java Sorting: Comparator vs Comparable Tutorial
2008-07-10 15:11:00 Java Comparators and Comparables? What are they? How do we use them? This is a question we received from one of our readers. This article will discuss the java.lang.Comparator and java.lang.Comparable in details with a set of sample codes for further clarifications.PrerequisitesBasic Java knowledgeSystem RequirementsJDK installedWhat are Java Comparators and Comparables?As both names suggest (and you may have guessed), these are used for comparing objects in Java. Using these concepts; Java objects can be sorted according to a predefined order.Two of these concepts can be explained as follows.ComparableA comparable object is capable of comparing itself with another object. The class itself must implements the java.lang.Comparable interface in order to be able to compare its instances.ComparatorA comparator object is capable of comparing two different objects. The class is not comparing its instances, but some other class?s instances. This comparator class must implement the java.lan... More About: Tutorial , Java , Tech , Sorting
Java Sorting: Comparator vs Comparable Tutorial
2008-07-10 15:11:00 Java Comparators and Comparables? What are they? How do we use them? This is a question we received from one of our readers. This article will discuss the java.lang.Comparator and java.lang.Comparable in details with a set of sample codes for further clarifications.PrerequisitesBasic Java knowledgeSystem RequirementsJDK installedWhat are Java Comparators and Comparables?As both names suggest (and you may have guessed), these are used for comparing objects in Java. Using these concepts; Java objects can be sorted according to a predefined order.Two of these concepts can be explained as follows.ComparableA comparable object is capable of comparing itself with another object. The class itself must implements the java.lang.Comparable interface in order to be able to compare its instances.ComparatorA comparator object is capable of comparing two different objects. The class is not comparing its instances, but some other class?s instances. This comparator class must implement the java.lan... More About: Tutorial , Java , Tech , Sorting
Java Sorting: Comparator vs Comparable Tutorial
2008-07-10 08:11:00 Java Comparators and Comparables? What are they? How do we use them? This is a question we received from one of our readers. This article will discuss the java.lang.Comparator and java.lang.Comparable in details with a set of sample codes for further clarifications.PrerequisitesBasic Java knowledgeSystem RequirementsJDK installedWhat are Java Comparators and Comparables?As both names suggest (and you may have guessed), these are used for comparing objects in Java. Using these concepts; Java objects can be sorted according to a predefined order.Two of these concepts can be explained as follows.ComparableA comparable object is capable of comparing itself with another object. The class itself must implements the java.lang.Comparable interface in order to be able to compare its instances.ComparatorA comparator object is capable of comparing two different objects. The class is not comparing its instances, but some other class?s instances. This comparator class must implement the java.lan... More About: Tutorial , Java , Tech , Sorting
Create/Restore Internet Explorer desktop shortcut
2008-06-24 14:05:00 Internet Explorer (IE) shortcut on Windows desktop is missing! May be it was deleted accidentally or missing due to some unexpected reason. So what would be the way to recreate it? You can create a shortcut just by right clicking on Windows Desktop . But you must give the application path to Internet Explorer installation. How would you find it?You would do a search on Windows for iexplore.exe on your C drive (Windows drive); and you'll end up seeing a number of iexplore.exe files on your machine. Are these the ones you have to use? which one out of these? Not exactly. The expected executable will not be shown by a Windows search. The correct file is a "protected operating system file", also it's hidden. By default Windows Explorer hides those files, but still you can view such files by changing the folder options as shown in the image. Tools->Folder Options->View The iexplore.exe executable will be available under;C:Program FilesInternet Exploreriexplore.exeSo create a shortcut... More About: Internet , Internet Explorer , Tech
Create/Restore Internet Explorer desktop shortcut
2008-06-24 14:05:00 Internet Explorer (IE) shortcut on Windows desktop is missing! May be it was deleted accidentally or missing due to some unexpected reason. So what would be the way to recreate it? You can create a shortcut just by right clicking on Windows Desktop . But you must give the application path to Internet Explorer installation. How would you find it?You would do a search on Windows for iexplore.exe on your C drive (Windows drive); and you'll end up seeing a number of iexplore.exe files on your machine. Are these the ones you have to use? which one out of these? Not exactly. The expected executable will not be shown by a Windows search. The correct file is a "protected operating system file", also it's hidden. By default Windows Explorer hides those files, but still you can view such files by changing the folder options as shown in the image. Tools->Folder Options->View The iexplore.exe executable will be available under;C:Program FilesInternet Exploreriexplore.exeSo create a shortcut... More About: Internet , Internet Explorer , Tech
Create/Restore Internet Explorer desktop shortcut
2008-06-24 07:05:00 Internet Explorer (IE) shortcut on Windows desktop is missing! May be it was deleted accidentally or missing due to some unexpected reason. So what would be the way to recreate it? You can create a shortcut just by right clicking on Windows Desktop . But you must give the application path to Internet Explorer installation. How would you find it?You would do a search on Windows for iexplore.exe on your C drive (Windows drive); and you'll end up seeing a number of iexplore.exe files on your machine. Are these the ones you have to use? which one out of these? Not exactly. The expected executable will not be shown by a Windows search. The correct file is a "protected operating system file", also it's hidden. By default Windows Explorer hides those files, but still you can view such files by changing the folder options as shown in the image. Tools->Folder Options->View The iexplore.exe executable will be available under;C:Program FilesInternet Exploreriexplore.exeSo create a shortcut... More About: Internet , Internet Explorer , Tech
Change Apache Tomcat port 8080 to 80 or another port number
2008-06-17 14:24:00 Change Apache Tomcat port 8080 to 80 or another port number. Whether it is Apache Tomcat 5 or Tomcat 6, by default Apache Tomcat runs on port 8080. But there can be situations where there are some other servers running on this same port forcing you to change the port of one of the servers. This article explains how to change this port 8080 on Tomcat (we tested this against Apache Tomcat 5.5 and 6.0 versions).Here we?ll be using label to denote the folder where Tomcat is installed. In our systems, tomcat is installed in the following path.=C:Java Tomcat_x.xWe need to edit the file named server.xml inside conf folder.In the server.xml file; locate the following segment.<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --><Connector port="8080" ? />By changing this 8080 value of port attribute, server would start listening on new port number.<Connector port="8081" ? />After saving the changed server.xml file, Tomcat server must be restarted (stop then start) to... More About: Change , Tech , Port
Change Apache Tomcat port 8080 to 80 or another port number
2008-06-17 14:24:00 Change Apache Tomcat port 8080 to 80 or another port number. Whether it is Apache Tomcat 5 or Tomcat 6, by default Apache Tomcat runs on port 8080. But there can be situations where there are some other servers running on this same port forcing you to change the port of one of the servers. This article explains how to change this port 8080 on Tomcat (we tested this against Apache Tomcat 5.5 and 6.0 versions).Here we?ll be using label to denote the folder where Tomcat is installed. In our systems, tomcat is installed in the following path.=C:Java Tomcat_x.xWe need to edit the file named server.xml inside conf folder.In the server.xml file; locate the following segment.<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --><Connector port="8080" ? />By changing this 8080 value of port attribute, server would start listening on new port number.<Connector port="8081" ? />After saving the changed server.xml file, Tomcat server must be restarted (stop then start) to... More About: Change , Tech , Port
Change Apache Tomcat port 8080 to 80 or another port number
2008-06-17 07:24:00 Change Apache Tomcat port 8080 to 80 or another port number. Whether it is Apache Tomcat 5 or Tomcat 6, by default Apache Tomcat runs on port 8080. But there can be situations where there are some other servers running on this same port forcing you to change the port of one of the servers. This article explains how to change this port 8080 on Tomcat (we tested this against Apache Tomcat 5.5 and 6.0 versions).Here we?ll be using label to denote the folder where Tomcat is installed. In our systems, tomcat is installed in the following path.=C:Java Tomcat_x.xWe need to edit the file named server.xml inside conf folder.In the server.xml file; locate the following segment.<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --><Connector port="8080" ? />By changing this 8080 value of port attribute, server would start listening on new port number.<Connector port="8081" ? />After saving the changed server.xml file, Tomcat server must be restarted (stop then start) to... More About: Change , Tech , Port
java.lang.UnsupportedClassVersionError: Bad version number in .class file
2008-04-09 04:51:00 java.lang.UnsupportedClass Version Error: Bad version number in .class file [at java.lang.ClassLoader.defineClass1(Native Method)]is an error that you may face in running a compiled java class file.So as you can see from the stack trace, a class has not been loaded. But which class? The problem is this error message does not show the name of the failed .class, isn't it?No, it is not. This error is caused when you compile a .java file with one version of JDK and running the .class file with a different version of JVM.Confused? You may say; same version is not required to compile and run. Yes, that is true. But you can not run .class files that are compiled with a newer version than the JVM.Say;javac (compile) - version: Xjava (run) - version: YIf X is newer than Y; then you may face this issue at runtime.Now you know how to solve this issue, isn't it? More About: Java , Tech , File
java.lang.UnsupportedClassVersionError: Bad version number in .class file
2008-04-09 04:51:00 java.lang.UnsupportedClass Version Error: Bad version number in .class file [at java.lang.ClassLoader.defineClass1(Native Method)]is an error that you may face in running a compiled java class file.So as you can see from the stack trace, a class has not been loaded. But which class? The problem is this error message does not show the name of the failed .class, isn't it?No, it is not. This error is caused when you compile a .java file with one version of JDK and running the .class file with a different version of JVM.Confused? You may say; same version is not required to compile and run.Yes, that is true. But you can not run .class files that are compiled with a newer version than the JVM.Say;javac (compile) - version: Xjava (run) - version: YIf X is newer than Y; then you may face this issue at runtime.Now you know how to solve this issue, isn't it? More About: Java , Tech , File
java.lang.UnsupportedClassVersionError: Bad version number in .class file
More articles from this author:2008-04-09 04:51:00 java.lang.UnsupportedClass Version Error: Bad version number in .class file [at java.lang.ClassLoader.defineClass1(Native Method)]is an error that you may face in running a compiled java class file.So as you can see from the stack trace, a class has not been loaded. But which class? The problem is this error message does not show the name of the failed .class, isn't it?No, it is not. This error is caused when you compile a .java file with one version of JDK and running the .class file with a different version of JVM.Confused? You may say; same version is not required to compile and run. Yes, that is true. But you can not run .class files that are compiled with a newer version than the JVM.Say;javac (compile) - version: Xjava (run) - version: YIf X is newer than Y; then you may face this issue at runtime.Now you know how to solve this issue, isn't it?Home More About: Java , Tech , File 1, 2, 3, 4, 5, 6 |



