Compilation Error using Command Line

By: Rama Kodumagulla - rkodumagulla
Compilation Error using Command Line
2003-01-07 08:53
Hello,

I am getting compilation errors when trying to compile the xml file to generate the .jasper file. I am able to view the xml file using the viewer without any problem.

Any pointers on what I am doing wrong?

Here is what I am doing.


C:\install\ActsReports\templates>java JasperCompiler -Tcompile -FQueryTwoDef.xm

QueryTwoDef.xml
********************************************************************
* WARNING: Unable to compile with "sun.tools.javac.Main" compiler. *
* Cause : java.lang.ClassNotFoundException : sun.tools.javac.Main *
* Compiling with command line "javac" compiler. *
********************************************************************
java.io.IOException: CreateProcess: javac -classpath C:\install\ActsReports\Jas
erreports\lib\jasperreports.jar C:\install\ActsReports\templates\QueryTwoDef.ja
a error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:63)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:550)
at java.lang.Runtime.exec(Runtime.java:475)
at java.lang.Runtime.exec(Runtime.java:441)
at dori.jasper.engine.design.JRCompiler.compileClassWithExeCompiler(JRC
mpiler.java:294)
at dori.jasper.engine.design.JRCompiler.compileClass(JRCompiler.java:23
)
at dori.jasper.engine.design.JRCompiler.compileReport(JRCompiler.java:1
2)
at dori.jasper.engine.JasperCompileManager.compileReportToFile(JasperCo
pileManager.java:129)
at dori.jasper.engine.JasperCompileManager.compileReportToFile(JasperCo
pileManager.java:101)
at JasperCompiler.main(JasperCompiler.java:137)

NESTED BY :
java.io.IOException: CreateProcess: javac -classpath C:\install\ActsReports\Jas
erreports\lib\jasperreports.jar C:\install\ActsReports\templates\QueryTwoDef.ja
a error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:63)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:550)
at java.lang.Runtime.exec(Runtime.java:475)
at java.lang.Runtime.exec(Runtime.java:441)
at dori.jasper.engine.design.JRCompiler.compileClassWithExeCompiler(JRC
mpiler.java:294)
at dori.jasper.engine.design.JRCompiler.compileClass(JRCompiler.java:23
)
at dori.jasper.engine.design.JRCompiler.compileReport(JRCompiler.java:1
2)
at dori.jasper.engine.JasperCompileManager.compileReportToFile(JasperCo
pileManager.java:129)
at dori.jasper.engine.JasperCompileManager.compileReportToFile(JasperCo
pileManager.java:101)
at JasperCompiler.main(JasperCompiler.java:137)

NESTED BY :
dori.jasper.engine.JRException: Error compiling report java source file : C:\in
tall\ActsReports\templates\QueryTwoDef.java
at dori.jasper.engine.design.JRCompiler.compileClassWithExeCompiler(JRC
mpiler.java:319)
at dori.jasper.engine.design.JRCompiler.compileClass(JRCompiler.java:23
)
at dori.jasper.engine.design.JRCompiler.compileReport(JRCompiler.java:1
2)
at dori.jasper.engine.JasperCompileManager.compileReportToFile(JasperCo
pileManager.java:129)
at dori.jasper.engine.JasperCompileManager.compileReportToFile(JasperCo
pileManager.java:101)
at JasperCompiler.main(JasperCompiler.java:137)

Regards,


rkodumagulla




By: Teodor Danciu - teodord
RE: Compilation Error using Command Line
2003-01-07 09:13

Hi,

You don't have tools.jar in your classpath.
This is OK, but then neither javac.exe is in the PATH.
This is also OK, but then you did not specify
a different java compiler program.

In this case, JasperReports does not have any
means to compile the report.

I hope this helps.
Teodor





By: Chuck Deal - cdeal
RE: Compilation Error using Command Line
2003-01-07 10:06
I am using Eclipse for development at both work and home. I have both copies of Eclipse set up very similarly. It is possible that they are different, however, Eclipse handles all of the CLASSPATH issues and if that were the problem I should be experiencing it on WinNT as well.

I will double check my settings to be sure.




By: Sanjeev - hotfile
RE: Compilation Error using Command Line
2003-04-21 18:49
I am using NetBeans IDE (with JDK1.4.1) on WindowsME. I am getting the similar error as below. If anyone has a solution then please help:

Following is the error during runtime:
java.io.IOException: CreateProcess: javac -classpath "C:\WINDOWS\.netbeans\3.4\system;C:\WINDOWS\.netbeans\3.4\system;C:\PROGRAM FILES\NETBEANS IDE 3.4.1\system;C:\Program Files\NetBeans IDE 3.4.1\lib\openide.jar;C:\Program Files\NetBeans IDE 3.4.1\modules\ext\AbsoluteLayout.jar;C:\WINDOWS\.netbeans\3.4\modules\ext\junit-3.7.jar;C:\WINDOWS\.netbeans\3.4\modules\ext\junit-ext.jar;C:\WINDOWS\.netbeans\3.4\modules\ext\jelly2-nb.jar;C:\WINDOWS\.netbeans\3.4\modules\ext\jemmy.jar;C:\Program Files\NetBeans IDE 3.4.1\modules\autoload\ext\servlet-2.3.jar;C:\Program Files\NetBeans IDE 3.4.1\lib\ext\xml-apis.jar;C:\Program Files\NetBeans IDE 3.4.1\beans\TimerBean.jar;C:\xerces_2_3_0;C:\xerces_2_3_0\xercesSamples.jar;C:\xerces_2_3_0\xercesImpl.jar;C:\xerces_2_3_0\xml-apis.jar;C:\xerces_2_3_0\xmlParserAPIs.jar;C:\OracleDriver;C:\OracleDriver\classes111.zip;C:\JReport\lib\JRDesign.jar;C:\JReport\lib\JREngine.jar;C:\JReport\lib\JRResultViewer.jar;C:\reporttest;C:\JasperReport\JasperReport046;C:\reporttest\commons-digester-1.4.1\commons-digeste?
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:63)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:566)
at java.lang.Runtime.exec(Runtime.java:491)
at java.lang.Runtime.exec(Runtime.java:457)
at dori.jasper.engine.design.JRJavacCompiler.compileClass(JRJavacCompiler.java:102)
at dori.jasper.engine.design.JRCompiler.compileClass(JRCompiler.java:235)
at dori.jasper.engine.design.JRCompiler.compileReport(JRCompiler.java:145)
at dori.jasper.engine.JasperCompileManager.compileReport(JasperCompileManager.java:196)
at dori.jasper.engine.JasperManager.compileReport(JasperManager.java:982)
at BasicReport.main(BasicReport.java:33)
NESTED BY :
java.io.IOException: CreateProcess: javac -classpath "C:\WINDOWS\.netbeans\3.4\system;C:\WINDOWS\.netbeans\3.4\system;C:\PROGRAM FILES\NETBEANS IDE 3.4.1\system;C:\Program Files\NetBeans IDE 3.4.1\lib\openide.jar;C:\Program Files\NetBeans IDE 3.4.1\modules\ext\AbsoluteLayout.jar;C:\WINDOWS\.netbeans\3.4\modules\ext\junit-3.7.jar;C:\WINDOWS\.netbeans\3.4\modules\ext\junit-ext.jar;C:\WINDOWS\.netbeans\3.4\modules\ext\jelly2-nb.jar;C:\WINDOWS\.netbeans\3.4\modules\ext\jemmy.jar;C:\Program Files\NetBeans IDE 3.4.1\modules\autoload\ext\servlet-2.3.jar;C:\Program Files\NetBeans IDE 3.4.1\lib\ext\xml-apis.jar;C:\Program Files\NetBeans IDE 3.4.1\beans\TimerBean.jar;C:\xerces_2_3_0;C:\xerces_2_3_0\xercesSamples.jar;C:\xerces_2_3_0\xercesImpl.jar;C:\xerces_2_3_0\xml-apis.jar;C:\xerces_2_3_0\xmlParserAPIs.jar;C:\OracleDriver;C:\OracleDriver\classes111.zip;C:\JReport\lib\JRDesign.jar;C:\JReport\lib\JREngine.jar;C:\JReport\lib\JRResultViewer.jar;C:\reporttest;C:\JasperReport\JasperReport046;C:\reporttest\commons-digester-1.4.1\commons-digeste?
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:63)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:566)
at java.lang.Runtime.exec(Runtime.java:491)
at java.lang.Runtime.exec(Runtime.java:457)
at dori.jasper.engine.design.JRJavacCompiler.compileClass(JRJavacCompiler.java:102)
at dori.jasper.engine.design.JRCompiler.compileClass(JRCompiler.java:235)
at dori.jasper.engine.design.JRCompiler.compileReport(JRCompiler.java:145)
at dori.jasper.engine.JasperCompileManager.compileReport(JasperCompileManager.java:196)
at dori.jasper.engine.JasperManager.compileReport(JasperManager.java:982)
at BasicReport.main(BasicReport.java:33)
NESTED BY :
dori.jasper.engine.JRException: Error compiling report java source file : C:\Program Files\NetBeans IDE 3.4.1\BasicReport.java
at dori.jasper.engine.design.JRJavacCompiler.compileClass(JRJavacCompiler.java:127)
at dori.jasper.engine.design.JRCompiler.compileClass(JRCompiler.java:235)
at dori.jasper.engine.design.JRCompiler.compileReport(JRCompiler.java:145)
at dori.jasper.engine.JasperCompileManager.compileReport(JasperCompileManager.java:196)
at dori.jasper.engine.JasperManager.compileReport(JasperManager.java:982)
at BasicReport.main(BasicReport.java:33)
Caused by: java.io.IOException: CreateProcess: javac -classpath "C:\WINDOWS\.netbeans\3.4\system;C:\WINDOWS\.netbeans\3.4\system;C:\PROGRAM FILES\NETBEANS IDE 3.4.1\system;C:\Program Files\NetBeans IDE 3.4.1\lib\openide.jar;C:\Program Files\NetBeans IDE 3.4.1\modules\ext\AbsoluteLayout.jar;C:\WINDOWS\.netbeans\3.4\modules\ext\junit-3.7.jar;C:\WINDOWS\.netbeans\3.4\modules\ext\junit-ext.jar;C:\WINDOWS\.netbeans\3.4\modules\ext\jelly2-nb.jar;C:\WINDOWS\.netbeans\3.4\modules\ext\jemmy.jar;C:\Program Files\NetBeans IDE 3.4.1\modules\autoload\ext\servlet-2.3.jar;C:\Program Files\NetBeans IDE 3.4.1\lib\ext\xml-apis.jar;C:\Program Files\NetBeans IDE 3.4.1\beans\TimerBean.jar;C:\xerces_2_3_0;C:\xerces_2_3_0\xercesSamples.jar;C:\xerces_2_3_0\xercesImpl.jar;C:\xerces_2_3_0\xml-apis.jar;C:\xerces_2_3_0\xmlParserAPIs.jar;C:\OracleDriver;C:\OracleDriver\classes111.zip;C:\JReport\lib\JRDesign.jar;C:\JReport\lib\JREngine.jar;C:\JReport\lib\JRResultViewer.jar;C:\reporttest;C:\JasperReport\JasperReport046;C:\reporttest\commons-digester-1.4.1\commons-digeste?
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:63)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:566)
at java.lang.Runtime.exec(Runtime.java:491)
at java.lang.Runtime.exec(Runtime.java:457)
at dori.jasper.engine.design.JRJavacCompiler.compileClass(JRJavacCompiler.java:102)
... 5 more
Exception in thread "main"





By: Teodor Danciu - teodord
RE: Compilation Error using Command Line
2003-12-06 10:29

Hi,

The javac.exe is not found in the system's search path.
Add JAVA_HOME\bin to the PATH environment variable.
Or add tools.jar to the classpath when you compile
your reports.

I hope this helps.
Teodor





By: Chuck Deal - cdeal
RE: Compilation Error using Command Line
2003-01-07 10:04
I'm having the same problem on a WinXP box. I just haven't had the time to figure out why. I know that the same code DOES work on a WinNT box (using the same JDK version).

If anyone has some insight, it would be most appreciated.




By: Bertoldi Alex - berales
RE: Compilation Error using Command Line
2003-05-12 07:41
I have same problem on Windows XP.
But, only, if run my Java program in a DOS script or MS-DOS prompt Windows .
If i use a Link with the full java command (the same as in the DOS script) it works... :-(
2002 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:28am
Last seen: 16 years 7 months ago

0 Answers:

No answers yet
Feedback