JDK 1.5 compilation error !!!

Hi all,
My source code looks like this:
* Test.java
* Created on November 9, 2004, 6:20 PM
package test;
* @author Administrator
public class Test
/** Creates a new instance of Test */
public Test()
* @param args the command line arguments
public static void main(String[] args)
// TODO code application logic here
I have tried to compile this source code using JDK1.5 in NetBeans 3.6 and then in console but I have the following errors:
An exception has occurred in the compiler (1.5.0). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.ClassFormatError: Invalid pc in LineNumberTable in class file com/sun/tools/javac/jvm/Code
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)
at com.sun.tools.javac.jvm.Gen.genMethod(Gen.java:859)
at com.sun.tools.javac.jvm.Gen.visitMethodDef(Gen.java:844)
at com.sun.tools.javac.tree.Tree$MethodDef.accept(Tree.java:482)
at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:651)
at com.sun.tools.javac.jvm.Gen.genClass(Gen.java:2129)
at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:325)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:474)
at com.sun.tools.javac.main.Main.compile(Main.java:592)
at com.sun.tools.javac.main.Main.compile(Main.java:544)
at com.sun.tools.javac.Main.compile(Main.java:58)
at com.sun.tools.javac.Main.main(Main.java:48)
Errors compiling Test.
How to solve this ?
Thanks,
/GFL

Yes. I know, because in another day I have used JDK1.5 in order to compile another application and it worked fine.
I have restarted the computer and now everything is ok . I do not know what the problem was.
Anyway thanks for your answer.
/Florian

Similar Messages

  • Compilation error when deploying EAR file on standalone OC4J...

    Hi All,
    I am getting the following error when trying to deploy an EAR File describing a web service from the Jdeveloper IDE to the stanalone OC4J server instance.
    ==========================================================
    Uploading file JavaWebServiceEmp-GetDates-WS.ear ...
    Application Deployer for JavaWebServiceEmp-GetDates-WS STARTS.
    Copy the archive to C:\Lester\Testing\JDev10.1.3\oc4j\j2ee\home\applications\JavaWebServiceEmp-GetDates-WS.ear
    Initialize C:\Lester\Testing\JDev10.1.3\oc4j\j2ee\home\applications\JavaWebServiceEmp-GetDates-WS.ear begins...
    Unpacking JavaWebServiceEmp-GetDates-WS.ear
    Done unpacking JavaWebServiceEmp-GetDates-WS.ear
    Unpacking WebServices.war
    Done unpacking WebServices.war
    Initialize C:\Lester\Testing\JDev10.1.3\oc4j\j2ee\home\applications\JavaWebServiceEmp-GetDates-WS.ear ends...
    Starting application : JavaWebServiceEmp-GetDates-WS
    Initializing ClassLoader(s)
    Initializing EJB container
    Loading connector(s)
    Starting up resource adapters
    Initializing EJB sessions
    Committing ClassLoader(s)
    Initialize WebServices begins...
    Initialize WebServices ends...
    Started application : JavaWebServiceEmp-GetDates-WS
    Binding web application(s) to site default-web-site begins...
    Binding WebServices web-module for application JavaWebServiceEmp-GetDates-WS to site default-web-site under context root JavaWebServiceEmp-GetDates-context-root
    Operation failed with error:
    Error compiling :C:\Lester\Testing\JDev10.1.3\oc4j\j2ee\home\applications\JavaWebServiceEmp-GetDates-WS\WebServices: compilation error occurred
    Deployment failed
    Elapsed time for deployment: 1 minute, 50 seconds
    ==========================================================
    Please could somebody help me out with this? Basically I am not able to understand how to deploy the EAR file created under the MyWork folder under jdeveloper\jdev to the applications folder of j2ee\home. I am new to both EAR deployment as well as web services and would like to get a good understanding of the working of a web service which includes SOAP components and the like.
    Any help with regards to building and deploying a web service on standalone OC4J would be appreciated. Thanks a lot.

    Initially I followed the following steps to start up OC4J:-
    Settings :-
    1) Jdeveloper is setup under C:\Lester\Testing as Jdev10.1.3 folder
    2) I downloaded the extended oc4j zip folder and unzipped it under a new folder oc4j at the location C:\Lester\Testing\Jdev10.1.3
    Steps followed to run oc4j and deploy application
    1) Setup a standalone oc4j from the jdeveloper ide giving C:\Lester\Testing\Jdev10.1.3\oc4j as the root folder for oc4j.
    2) While doing step 1 added password and deployed it. Changed server.xml under C:\Lester/Testing/JDev10.1.3/oc4j/j2ee/home/config
    to include the following:-
    <shared-library name="global.libraries" version="1.0" library-compatible="true">
    <code-source path="C:\Lester/Testing/JDev10.1.3/oc4j/j2ee/home/applib"/>
    </shared-library>
    AND
    <java-compiler name="javac" in-process="false" options="-J-Xmx1024m -encoding UTF8" bindir="C:\Jdeveloper\jdk" extdirs="C:\Jdeveloper/jdk" />
    3) Opened a command prompt and went to the location C:\Lester\Testing\JDev10.1.3\oc4j\j2ee\home and ran the following command:-
    --> java -jar oc4j.jar
    4) Deployment: Then I deployed my primewebservice application from command prompt at C:\Lester\Smart Cylinder\Example code\prime\PrimeNumberService>
    using:-
    --> java -jar C:\Lester/Testing/JDev10.1.3/oc4j/j2ee/home/admin.jar ormi://172.20.13.164:8888 oc4jadmin welcome -deploy -file PrimeNumberService.ear -deploymentName DocStyleWebService
    5) Web Binding: Then I bound my primewebservice application from command prompt at C:\Lester\Smart Cylinder\Example code\prime\PrimeNumberService>
    using:-
    --> java -jar C:\Lester/Testing/JDev10.1.3/oc4j/j2ee/home/admin.jar ormi://172.20.13.164:8888 oc4jadmin welcome -bindWebApp DocStyleWebService PrimeNumberService_web http-web-site /docws
    6) Steps 4 and 5 went through without error.
    7) However when trying to access the web service using the following link I get the standard HTTP 404 (Page not found) error:-
    http://localhost:8888/docws/prime
    This was before I tried deploying the web service through jdeveloper IDE.
    I had tried the document web service given at the following link:-
    http://www.oracle.com/technology/sample_code/tech/java/codesnippet/webservices/docservice/index.html
    from the web services how to links
    http://www.oracle.com/technology/sample_code/tech/java/codesnippet/webservices/index.html
    Please could somebody help me out? Also periodically I recieve the ojc.exe not found error when trying to deploy an application using jdeveloper ide. There are two conflicting jdeveloper versions one comes with this exe and one without.
    Message was edited by:
    Lester N

  • JSP Compilation Error when using OC4J out of the box

    Hello.
    After installing Java jdk 1.5.0_05, setting ORACLE_HOME, setting JAVA_HOME, rebooting, and installing OC4J standalone straight out of the box, I have deployed a simple web project that consists of just one JSP. I receive the following error message:
    NOTIFICATION J2EE JSP-0008 Unable to dispatch jsp Page: oracle.jsp.provider.JspCompilationException: Errors compiling: C:\LocalApps\OC4J\j2ee\home\application-deployments\oc4j_jsp\persistence\_pages\\_Test.java<pre></pre>
    I have deployed a number of Flex2 applications without incident. What am I missing here? Another odd thing is that my organization has OAS running and it can render JSPs fine.
    Any help is appreciated thanks,
    Mike
    P.S. I have gone back and set the JSP debug switches, but they do not yeild much more info. Here is the stacktrace:
    NOTIFICATION J2EE JSP-0008 Unable to dispatch JSP Page : oracle.jsp.provider.JspCompileException: <H3>Errors compiling:C:\LocalApps\OC4J\j2ee\home\application-deployments\oc4j_jsp\oc4j_jsp\persistence\_pages\\_Test.java</H3><pre></pre>
         at oracle.jsp.app.JspJavacCompiler.compile(JspJavacCompiler.java:304)
         at oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:731)
         at oracle.jsp.runtimev2.JspPageCompiler.compileBothModes(JspPageCompiler.java:456)
         at oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:413)
         at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:705)
         at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:694)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:414)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Unknown Source)

    I had the very same Problem, and I spent a lot of time on it.
    When installing Oc4j as a service using Javaservice opnesource, I had no problem, even using J.D.K 1.6:
    %JSEXE% -install %JSNAME% %JVMDIR%\jvm.dll -XX:PermSize=128m -XX:MaxPermSize=256m -Xmx1024M -Xms1024M -Djava.class.path=%OC4J_HOME%\oc4j.jar -start oracle.oc4j.loader.boot.BootStrap -params -config %OC4J_HOME%\config\server.xml -out %OC4J_HOME%\log\OC4J_service_stdout.log -err %OC4J_HOME%\log\OC4J_service_stderr.log -current %JSBINDIR% -auto -description OC4JService
    Then I wanted to install it using "ServiceMill" or "Javaservice Wrapper", becuase it has a better control on the process and I had that awfull compilation error.
    I guess it is because ServiceMills uses java.exe and javaservice the .dll to launch the oc4j, no idea.
    Anyway, thank you very much!!!!!
    Antonio

  • Compiler error in 9.0.3 when deploying using jdk1.4.1rc

    Hi, I'm trying to deploy an application into iAS9.0.3. The server is started with jdk1.4.1rc. However, I'm getting a compiler error (see below). When compiling with jdk1.3.1 everything is working fine, but I need to use the new API's in 1.4. Can anyone help me out here? Will 9.0.3 be certified for jdk 1.4 when the production version is released?
    Thanks
    /Johannes
    Auto-deploying OPS-EJB (No previous deployment found)... OPS_StatelessSessionBeanWrapper0.java:11: cannot access java.lang.Object
    bad class file: D:\j2sdk1.4.1\jre\lib\rt.jar(java/lang/Object.class)
    class file has wrong version 48.0, should be 47.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    public class OPS_StatelessSessionBeanWrapper0 extends com.evermind.server.ejb.RemoteStatelessSessionEJBObject implements com.novamedia.ops.ejb.OPS
    ^
    1 error
    Error compiling D:\eclipse-projects\ops-application\OPS-EJB: Syntax error in source

    OC4J 9.0.3 production will be certified with JDK 1.4.
    You can try the work arounds discussed in http://forums.oracle.com/forums/message.jsp?id=767439 to get it working with JDK 1.4
    regards
    Debu

  • Compile errors

    Hi, I am learning Java using a few courses from text books. Everything has been going well so far. I do most of my devleopment on Linux but recently installed the JDK on my Windows partition. The course I am using from the book comes with a library that you are to use in all the programming exercises. Anyway, this is the code from the program that I am getting a compile error on.
    import ccj.*;
    public class Fastype
    {     public static void main(String[] args);
      {          String totype = ("The quick brown fox jumps over the lazy dog.");
                double wpm;
              double sec;
              System.out.print("This program tests your typing skills. When you are ready to start press 'y'(and enter) and a sentence will appear. Type it as fast as you can without error(don't forget to press the enter key when done.) Ready?");
              String z = Console.in.readChar(); // just a statement that waits until the user is ready
              Time start = new Time();
              System.out.println(totype);
              String user = Console.in.readWord();
              Time end = new Time();
              sec = (end.getSeconds()-start.getSeconds());
              wpm = 9 * 60 / sec;
              System.out.print("Time: " + sec + "\nYou can type " + wpm + " words per minute.");
              if (user.equals(totype)) System.out.print("Good.");
              else
              if( user.compareTo(totype) != 0)
              System.out.println("  But speed is irrelevant when you type with errors.");
    }When I compile I get:
    Fastype.java:6: missing method body, or declare abstract
    {       public static void main(String[] args);
                               ^All the programs I've written so far use :
    { public static void main(String[] args)So I can't really tell whats going on here. I'm sure this is probably really stupid but I'm new to this.
    Thanks.
    IRC

    All the programs I've written so far use :
    { public static void main(String[] args)
    semicolon son,semicolon in the main method..
    tips: when the compiler gives an error ,try to take a closer look and check for the syntax of the corresponding line..
    don't worry happens to newbies...

  • Compiler error using compareTo

    I get a compiler error when I use compareTo with the Character class. I confirmed the error with following code from The Java Tutorial:
    public class CharacterDemo {
    public static void main(String args[]) {
    Character a = new Character('a');
    Character a2 = new Character('a');
    Character b = new Character('b');
    // ******* Problem is here ************
    int difference = a.compareTo(b);
    if (difference == 0) {
    System.out.println("a is equal to b.");
    } else if (difference < 0) {
    System.out.println("a is less than b.");
    } else if (difference > 0) {
    System.out.println("a is greater than b.");
    System.out.println("a is "
    + ((a.equals(a2)) ? "equal" : "not equal")
    + " to a2.");
    System.out.println("The character " + a.toString() + " is "
    + (Character.isUpperCase(a.charValue()) ? "upper" : "lower")
    + "case.");
    The compilier is complaining that compareTo is not part of the Character class. I am compiling with whatever compilier was installed with Suse Linux 7.1. The code compiles fine on my university's Unix system that I can dial into.
    I figure my Linux version must have some old compiler. But to be honest, I am also new to Linux and am having trouble figuring out what I am compiling with. Can any expert out there give me advice on identifying/updating the Java technology I am using. Thanks in advance.
    Jim

    Check the jdk version using the java command:
    java -versionwhich will output the jdk version you're using.

  • Adapter compilation error

    Hi Experts,
    I am trying to create a simple adapter with only one 'SET VARIABLE' task which is returning a literal '0'. But I am getting compilation error.
    [2012-05-06T07:44:07.156+00:00] [oim_server1] [ERROR] [] [XELLERATE.ADAPTERS] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 34eea5fc76281eb7:-4f1fdf59:13720a60940:-8000-0000000000000802,0] [APP: oim#11.1.1.3.0] Class/Method: tcAdpUtils/genXellerateAdapter encounter some problems: /tmp/oracle/oim/adapters/adpTEST.java (No such file or directory)[[
    java.io.FileNotFoundException: /tmp/oracle/oim/adapters/adpTEST.java (No such file or directory)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
    at java.io.FileWriter.<init>(FileWriter.java:73)
    at com.thortech.xl.dataobj.util.tcAdpUtils.genXellerateAdapter(tcAdpUtils.java:1367)
    at com.thortech.xl.dataobj.util.tcAdpUtils.createAdapter(tcAdpUtils.java:6857)
    at com.thortech.xl.dataobj.tcADP.createAdapter(tcADP.java:469)
    at com.thortech.xl.dataobj.tcADP.eventPreUpdate(tcADP.java:426)
    at com.thortech.xl.dataobj.tcDataObj.update(tcDataObj.java:633)
    at com.thortech.xl.dataobj.tcDataObj.save(tcDataObj.java:508)
    at com.thortech.xl.dataobj.tcTableDataObj.save(tcTableDataObj.java:2906)
    at com.thortech.xl.ejb.databeansimpl.tcDataObjectBase.save(tcDataObjectBase.java:177)
    at com.thortech.xl.ejb.interfaces.tcADPEJB.savex(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
    at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
    at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy326.savex(Unknown Source)
    at com.thortech.xl.ejb.interfaces.tcADP_3uwi2l_tcADPRemoteImpl.__WL_invoke(Unknown Source)
    at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
    at com.thortech.xl.ejb.interfaces.tcADP_3uwi2l_tcADPRemoteImpl.savex(Unknown Source)
    at com.thortech.xl.ejb.interfaces.tcADP_3uwi2l_tcADPRemoteImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
    at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    [2012-05-06T07:44:07.157+00:00] [oim_server1] [ERROR] [] [XELLERATE.ADAPTERS] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 34eea5fc76281eb7:-4f1fdf59:13720a60940:-8000-0000000000000802,0] [APP: oim#11.1.1.3.0] Class/Method: tcAdpUtils/createAdapter encounter some problems: Code Generation Failed For 'Test' adapter
    [2012-05-06T07:45:15.368+00:00] [oim_server1] [NOTIFICATION] [IAM-1020004] [oracle.iam.scheduler.impl.quartz] [tid: OIMQuartzScheduler_Worker-6] [userId: oiminternal] [ecid: 34eea5fc76281eb7:-4f1fdf59:13720a60940:-8000-0000000000000003,0] [APP: oim#11.1.1.3.0] Job Listener, Job to be executed Description null FullName DEFAULT.Issue Audit Messages Task Name Issue Audit Messages Task
    I checked few forums for this and have set XL.CompilerPath to jdk/bin. Also, JAVA_HOME has been set to jdk6 (not bin).
    Please provide some pointers for resolution.
    Thanks,
    Rahul

    Thanks Rajiv. I, in fact, did same for resolution as there was a reference to a directory in logs under /tmp but I wasn't able to find it. Cleaning up /tmp did the trick.

  • Compile error when connecting to JDBC:ODBC

    Hi
    I am not used to java so probably this is an enivorment problem, but I cannot fix, please help!
    FOLLOWING CODE
    import java.sql.*;
    public class DBtest {
    public static void main (String args[]) {
    String jdbcDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
    String protocolHeader = "jdbc:odbc:";
    String dbName = "myodbc3-test";
    String user = "";
    String password = "";
    Class.forName(jdbcDriver);
    Connection cn =
    DriverManager.getConnection(protocolHeader+dbName, user, password);
    GENERATES FOLLOWING COMPILING ERROR
    cd c:/Javakod/NewFolder/
    javac -classpath C:\Javakod\ DBtest.java
    DBtest.java:17: incompatible types
    found : java.sql.Connection
    required: NewFolder.Connection
    DriverManager.getConnection(protocolHeader+dbName, user, password);
    ^
    1 error
    What is wrong? I am using a Win2000.

    This code compiles and runs fine on my Windows 2000 machine running JDK 1.4.1:
    import java.sql.*;
    public class AnotherConnectionTester
        public static void main(String [] args)
            String jdbcDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
            String protocolHeader = "jdbc:odbc:";
            String dbName = "myodbc3-test";
            String user = "";
            String password = "";
            try
                Class.forName(jdbcDriver);
                Connection cn = DriverManager.getConnection(protocolHeader+dbName, user, password);
                DatabaseMetaData meta = cn.getMetaData();
                System.out.println("product name: " + meta.getDatabaseProductName());
            catch (Exception e)
                e.printStackTrace(System.err);
    }I set up an ODBC DSN myodbc3-test to connect to an Access database. It was no problem. I guess that doesn't explain why your post didn't work. I changed the name of the class and added that meta data output so I could make sure that it connected. - MOD

  • AspectJ usage for compilation error on field/class Member type

    Hello,
    I have stuck up with impleamentation of functionality to achieve following-
    I have class ABC and have multiple members in that. I want to give compiler error if the field type is List or non-primitive. I am trying this with AspectJ. But could not accomplish the task. Can somebody please suggest me some method or way to get this done ?
    Thanks.

    anj77 wrote:
    Hello,
    I have stuck up with impleamentation of functionality to achieve following-
    I have class ABC and have multiple members in that. I want to give compiler error if the field type is List or non-primitive. I am trying this with AspectJ. But could not accomplish the task. Can somebody please suggest me some method or way to get this done ?Yes, that kind of check pretty straightforward to implement with an annotation processor.
    I suggest using JDK 6 and javac for this task. To get started, see the packages javax.annotation.processing and javax.lang.model.*; also the JDK comes with an example checker in
    sample/javac/processing/src/CheckNameProcessor.java

  • Why it is giving compilation error

    byte b = 50;
    byte c = 50*2; //giving compilation error
    why????

    It shouldn't give you compilation errors. It compiles
    fine using JDK 1.4Maybe an earlier compiler (one that doesn't bother to actually check the int literals) is griping about a potential loss of precision, would be my only guess...

  • Compilation errors with JDeveloper 10.1.2.2.0

    Hello,
    I want to change my environment work. First I worked with Eclipse (Europa, jre 1.6), I have no error with my following code source :
    private List<String> lString;
    and now I have a compilation error with the same code
    ' Error(43,14): <identifier> expected '
    I think it's a compiler version problem but I'm not sure and I don't know how to change the compiler version.
    If someone have any idea, I will be happy to receive response.
    Thanks

    JDeveloper 10.1.2.2.0 doesn't support neither JDK 1.6 nor JDK 1.5.
    --olaf                                                                                                                                                                                       

  • Do java programms after giving compilation error generates .class file?

    Do java programms after giving compilation error generates the .class file?
    Do any outer class may have the private as access modifier?
    If someone asks you that -do any program in java after giving a compilation error gives the .class file -do any class except(inner class)
    be defined as private or static or protected or abc or xxx Now type the
    following program
    private class test
    public static void main(String s[])
    System.out.println("Hello!How are You!!");
    -Compile it.... You must have
    received this error test.java:1:The type type can't be private. Package members are always accessible within the current package. private class
    test ^ 1 error
    Here please notify that compiler has given the
    error not the warning therfore .class file should not be created but now type
    >dir *.class
    ___________ and you will see that the
    test.class file existing in the directory nevertheless this .class file
    is executable. if you will type __________________ >java test
    it will
    wish you Hello! and suerly asks you that How are You!! ________________!
    You can test it with the following as acces modifiers and the progrm will run Ofcourse it will give you compilation error.
    protected
    xxx
    abc
    xyz
    private
    Do you have any justification?

    Hmm,
    I've been working with different versions of jdk since, if I'm not mistaken, jdk1.0.6 and never was able to get *.class with compilation errors. It was true for Windows*, Linux, and Solaris*.
    About the 'private'/'protected' modifier for the type (class) - it makes perfect sence not to allow it there: why would anyone want to create a type if no one can access it? There should be a reason for restricting your types - let's say, any inner class can be private/protected.
    For ex., you shouldn't have compile problems with this:
    class Test
    public static void main(String s[])
    System.out.println("Hello!How are You!!");
    private class ToTest{}
    Sorry, but I don't really know where you can read up on that.

  • JPDK Sample Provider compile error

    Hi
    I have installed 'OracleAS Containers for J2EE Pre-configured PDK', version 9.0.4.
    The Portlal tools are running fine, but the 'JPDK Sample Provider' fails with a compile error:
    500 Internal Server Error
    OracleJSP: oracle.jsp.provider.JspCompileException:
    Errors compiling:C:\pdk-container2\j2ee\home\application-deployments\jpdk\jpdk\persistence\_pages\_htdocs\_testpage\_TestPage.java.
    I have set the PART and JAVA_HOME environment to point to a jsdk:
    java -version
    java version "1.4.2_05"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
    Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode).
    Any ideas???

    By setting the home, are you setting the JAVA_HOME to a proper JDK installation, and not to the JRE installation?
    thanks,
    Harsha

  • BUG. 10.1.3.EA: Internal Compilation error. Large project.

    I tried to compile large project (~4,000 classes) using extenal "javac" compiler and 1.4.2 JDK. When I "clean the project" and then run "make" the follwoing error frequently ocures. Once it fails it's true both for entire project and if I try to compile a single class not depending on anything else. This makes me to beleive that the problem is not related to any particular class (also see notes below, looks like "javac" process doesn't even start).
    Compiling...
    Internal compilation error, terminated with a fatal exception
    It doesn't happen if I use "rebuild" function instead of "make". It doesn't happen always but most of the times. I tried different versions of 1.4.2 (02,03,04) and don't see any specific pattern.
    Also looks like once I "rebuild" the project, "make" runs ok.
    I run Task Monitor and here is what I found out:
    - CPU maxs out at 100% for about 10 - 15 % and then the error is reported;
    - Error is reported before "javac" process is started;
    - There is plenty of memory available. I have 1 G with 640 set as max for JDeveloper, but it doesn't exceed 400 MB.
    I compiled a smaller project (~1,000 files) and didn't have this problem.
    I wont' be able to send the sorce code but I can send project files if it helps.
    Is there any logging I could enable to get more information? Did anybody reported anything similar? Is there any configuration parameters I can play with?
    Thanks in advance,
    Noel.

    I run JDev using jdev.exe and here is a stack I got in console window. Any ideas?
    java.lang.IndexOutOfBoundsException
    at oracle.jdeveloper.compiler.InputReadTextBuffer.getString(InputReadTex
    tBuffer.java:109)
    at oracle.javatools.parser.java.v2.internal.parser.ParserLayer1b.set_com
    ment_value(ParserLayer1b.java:324)
    at oracle.javatools.parser.java.v2.internal.parser.ParserLayer1b.handleO
    neComment(ParserLayer1b.java:422)
    at oracle.javatools.parser.java.v2.internal.parser.ParserLayer1b.skipTok
    en(ParserLayer1b.java:486)
    at oracle.javatools.parser.java.v2.internal.parser.ParserLayer1a.nextTok
    en(ParserLayer1a.java:241)
    at oracle.javatools.parser.java.v2.internal.parser.ParserLayer5.ty_body_
    rhs(ParserLayer5.java:825)
    at oracle.javatools.parser.java.v2.internal.parser.ParserLayer5.ty_body(
    ParserLayer5.java:774)
    at oracle.javatools.parser.java.v2.internal.parser.ParserLayer5.ty_d(Par
    serLayer5.java:998)
    at oracle.javatools.parser.java.v2.internal.parser.ParserLayer5.compilat
    ion_unit(ParserLayer5.java:1097)
    at oracle.javatools.parser.java.v2.internal.parser.ParserDriver.parse(Pa
    rserDriver.java:37)
    at oracle.javatools.parser.java.v2.JavaParser.parse(JavaParser.java:85)
    at oracle.javatools.parser.java.v2.JavaParser.parse(JavaParser.java:71)
    at oracle.jdeveloper.compiler.DependencyProvider.updateData(DependencyPr
    ovider.java:440)
    at oracle.jdeveloper.compiler.Ojc.checkDependencies(Ojc.java:1147)
    at oracle.jdeveloper.compiler.Ojc.translate(Ojc.java:1197)
    at oracle.jdeveloper.compiler.UnifiedBuildSystem$CompileThread.buildGrap
    h(UnifiedBuildSystem.java:299)
    at oracle.jdeveloper.compiler.UnifiedBuildSystem$CompileThread.buildProj
    ectFiles(UnifiedBuildSystem.java:514)
    at oracle.jdeveloper.compiler.UnifiedBuildSystem$CompileThread.buildAll(
    UnifiedBuildSystem.java:714)
    at oracle.jdeveloper.compiler.UnifiedBuildSystem$CompileThread.run(Unifi
    edBuildSystem.java:884)

  • JSPC Compile Error

    I'm trying to use the jspc from WL4.51SP8 on Solaris & JDK 1.1.7_08a to
              pre-compile all the jsp's for our web site. However, after setting all of
              the proper environment settings (i.e. classpath, docroot, -d, javac
              compiler, etc.) I can't get the jspc to compile the pages. All of the JSP's
              compile successfully when browsing the web site but just not when using the
              jspc from the command line.
              I'm getting the following error message when trying to compile just a single
              JSP, much less a whole directory of them:
              java.lang.ExceptionInInitializerError
              at java.lang.Throwable.<init>(Compiled Code)
              at java.lang.Error.<init>(Compiled Code)
              at java.lang.LinkageError.<init>(Compiled Code)
              at java.lang.ExceptionInInitializerError.<init>(Compiled Code)
              at java.beans.Beans.instantiate(Compiled Code)
              at weblogic.servlet.jsp.JspLexer.processBeanTag(Compiled Code)
              at weblogic.servlet.jsp.JspLexer.mXML_OPEN_USEBEAN(Compiled Code)
              at weblogic.servlet.jsp.JspLexer.mXML_THING(Compiled Code)
              at weblogic.servlet.jsp.JspLexer.mTOKEN(Compiled Code)
              at weblogic.servlet.jsp.JspLexer.nextToken(Compiled Code)
              at weblogic.servlet.jsp.JspLexer.parse(Compiled Code)
              at weblogic.servlet.jsp.JspParser.doit(Compiled Code)
              at weblogic.servlet.jsp.JspParser.parse(Compiled Code)
              at weblogic.servlet.jhtmlc.Jhtml2Java$Output.setSourceFile(Compiled
              Code)
              at weblogic.servlet.jhtmlc.Jhtml2Java.outputs(Compiled Code)
              at weblogic.utils.compiler.CodeGenerator.generate(Compiled Code)
              at weblogic.jhtmlc.runBody(Compiled Code)
              at weblogic.jspc.runBody(Compiled Code)
              at weblogic.utils.compiler.Tool.run(Compiled Code)
              at weblogic.jspc.main(Compiled Code)
              Here's a portion of my script (classpath is defined in the script):
              JSPC_OPTIONS=" -g -keepgenerated -verbose -deprecation -commentary "
              DOCUMENT_ROOT= /weblogic/marketstream/GUI/jspages
              WORKING_DIR=/weblogic/myserver/classfiles/examples/jsp/_jspages
              JAVAC_PROGRAM=/pkg/jdk-1.1.7_08a/bin/javac
              JSP_FILE=/marketstream/GUI/jspages/S_Home0_1.jsp
              $JDK_ROOT/bin/java weblogic.jspc -classpath $CLASSPATH \
              -compiler $JAVAC_PROGRAM $JSPC_OPTIONS \
              -d $WORKING_DIR -docroot $DOCUMENT_ROOT $JSP_FILE
              I'm using the same UNIX account to run the script as I'm using to run
              WebLogic so I don't think it's a rights issue. I've run different
              variations of the script but I can't get any instance to get past the error
              message.
              Anyone have any ideas?
              -Brian Cunningham
              eBuilt, Inc.
              

    Hello Jani,
    With
    <library-ref>
            <library-name>jsf</library-name>
            <specification-version>2.0</specification-version>
            <exact-match>true</exact-match>
    </library-ref>
    I encounter a compile time error Error: <J2EE> <BEA-160187> <weblogic.appc failed to compile the application. Recompile with the -verbose option for more details about the issue.> .
    When i change to
    <library-ref>
            <library-name>jsf</library-name>
            <specification-version>2.0</specification-version>
           <exact-match>false</exact-match>
    </library-ref>
    the compile error goes away however I encounter the error stack in my original post which basically shows pointers at the af:link tag which not available in versions of jdev prior to 12c. hence, jsf2.0 tag?

Maybe you are looking for