Search Results

Search found 303 results on 13 pages for 'javac'.

Page 9/13 | < Previous Page | 5 6 7 8 9 10 11 12 13  | Next Page >

  • Problems with installing jcc and pylucene

    - by Christian
    I'm trying to install pylucene on Windows XP. I installed JDK on C:\Programme\Java\jdk1.6.0_18 . I also installed Visual Studio C++ Express to have a C++ compiler. As first step I'm trying to integrate jcc into python2.6 through the command: C:\Python26\python.exe setup.py build This gives me the following result: C:\Installfiles\pylucene-3.0.1-1\jcc>C:\Python26\python.exe setup.py build Traceback (most recent call last): File "setup.py", line 332, in <module> main('--debug' in sys.argv) File "setup.py", line 289, in main raise type(e), "%s: %s" %(e, args) WindowsError: [Error 2] Das System kann die angegebene Datei nicht finden: ['jav ac.exe', '-d', 'jcc/classes', 'java/org/apache/jcc/PythonVM.java', 'java/org/apa che/jcc/PythonException.java'] Other information: In systems I set: Uservariables: CLASSPATH C:\Programme\Java\jdk1.6.0_18\bin\javac.exe System Variables Path %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem; C:\Programme\Java\jdk1.6.0_18\bin Where does the error come from and what do I have to do to overcome it?

    Read the article

  • Java: initialization problem with private-final-int-value and empty constructor

    - by HH
    $ javac InitInt.java InitInt.java:7: variable right might not have been initialized InitInt(){} ^ 1 error $ cat InitInt.java import java.util.*; import java.io.*; public class InitInt { private final int right; InitInt(){} public static void main(String[] args) { // I don't want to assign any value. // just initialize it, how? InitInt test = new InitInt(); System.out.println(test.getRight()); // later assiging a value } public int getRight(){return right;} } Initialization problem with Constructor InitInt{ // Still the error, "may not be initialized" // How to initialise it? if(snippetBuilder.length()>(charwisePos+25)){ right=charwisePos+25; }else{ right=snippetBuilder.length()-1; } }

    Read the article

  • "The left hand side of an assignment must be a variable" due to extra parentheses

    - by polygenelubricants
    I know why the following code doesn't compile: public class Main { public static void main(String args[]) { main((null)); // this is fine! (main(null)); // this is NOT! } } What I'm wondering is why my compiler (javac 1.6.0_17, Windows version) is complaining "The left hand side of an assignment must be a variable". I'd expect something like "Don't put parentheses around a method invokation, dummy!", instead. So why is the compiler making a totally unhelpful complaint about something that is blatantly irrelevant? Is this the result of an ambiguity in the grammar? A bug in the compiler? If it's the former, could you design a language such that a compiler would never be so off-base about a syntax error like this?

    Read the article

  • Java: design problem with final-value and empty constructor

    - by HH
    $ javac InitInt.java InitInt.java:7: variable right might not have been initialized InitInt(){} ^ 1 error $ cat InitInt.java import java.util.*; import java.io.*; public class InitInt { private final int right; // Design Problem? // I feel the initialization problem is just due to bad style. InitInt(){} InitInt{ // Still the error, "may not be initialized" // How to initialise it? if(snippetBuilder.length()>(charwisePos+25)){ right=charwisePos+25; }else{ right=snippetBuilder.length()-1; } } public static void main(String[] args) { InitInt test = new InitInt(); System.out.println(test.getRight()); } public int getRight(){return right;} } Partial Solutions and Suggestions use "this" to access methods in the class, instead of creating empty constructor change final to non-final with final field value: initialize all final values in every constructor remove the empty constructor, keep your code simple and clean

    Read the article

  • Java: startingPath as "public static final" exception

    - by HH
    [Updated] Thanks to polygenelubricants's reply, the real problem is the exception from the method getCanonicalPath() because I cannot include try-catch-loop there. $ cat StartingPath.java import java.util.*; import java.io.*; public class StartingPath { public static final String startingPath = (new File(".")).getCanonicalPath(); public static void main(String[] args){ System.out.println(startingPath); } } $ javac StartingPath.java StartingPath.java:5: unreported exception java.io.IOException; must be caught or declared to be thrown public static final String startingPath = (new File(".")).getCanonicalPath(); ^ 1 error

    Read the article

  • Java: what are IOEXceptions in BufferedReader's readLine() for?

    - by HH
    I can "fix" the below exception with a try-catch loop but I cannot understand the reason. Why does the part "in.readLine()" continuosly ignite IOExceptions? What is really the purpose of throwing such exceptions, the goal probably not just more side effects? Code and IOExceptions $ javac ReadLineTest.java ReadLineTest.java:9: unreported exception java.io.IOException; must be caught or declared to be thrown while((s=in.readLine())!=null){ ^ 1 error $ cat ReadLineTest.java import java.io.*; import java.util.*; public class ReadLineTest { public static void main(String[] args) { String s; BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); // WHY IOException here? while((s=in.readLine())!=null){ System.out.println(s); } } }

    Read the article

  • PATH and CLASSPATH in Windows7 7 / Eclipse

    - by Richard Knop
    So I would like to set PATH and CLASSPATH system variables so I can use javac and java commands in the command line. I can just compile and run java programs in eclipse but I would also like to be able to run them through command line. This is where I have Java installed: C:\Program Files (x86)\Java jdk1.6.0_20 jre6 And this is where eclipse stores my Java projects: D:\java-projects HelloWorld bin HelloWorld.class src HelloWorld.java I have set up the PATH and CLASSPATH variables like this: PATH: C:\Program Files (x86)\Java\jdk1.6.0_20\bin CLASSPATH: D:\java-projects But it doesn't work. When I write: java HelloWorld Or: java HelloWorld.class I get error like this: Exception in thread “main” java.lang.NoClassDefFoundError: HelloWorld The error is longer, that's just the first line. How can I fix this? I'm mainly interested to be able to run compiled .class programs from the command line, I can do compiling in the eclipse.

    Read the article

  • Java: custom-exception-error

    - by HH
    $ javac TestExceptions.java TestExceptions.java:11: cannot find symbol symbol : class test location: class TestExceptions throw new TestExceptions.test("If you see me, exceptions work!"); ^ 1 error Code import java.util.*; import java.io.*; public class TestExceptions { static void test(String message) throws java.lang.Error{ System.out.println(message); } public static void main(String[] args){ try { // Why does it not access TestExceptions.test-method in the class? throw new TestExceptions.test("If you see me, exceptions work!"); }catch(java.lang.Error a){ System.out.println("Working Status: " + a.getMessage() ); } } }

    Read the article

  • Java: how does isDirectory and isFile work in File-class?

    - by HH
    $ javac GetAllDirs.java GetAllDirs.java:16: cannot find symbol symbol : variable checkFile location: class GetAllDirs System.out.println(checkFile.getName()); ^ 1 error $ cat GetAllDirs.java import java.util.*; import java.io.*; public class GetAllDirs { public void getAllDirs(File file) { if(file.isDirectory()){ System.out.println(file.getName()); File checkFile = new File(file.getCanonicalPath()); }else if(file.isFile()){ System.out.println(file.getName()); File checkFile = new File(file.getParent()); }else{ // checkFile should get Initialized at least HERE! File checkFile = file; } System.out.println(file.getName()); // WHY ERROR HERE: checkfile not found System.out.println(checkFile.getName()); } public static void main(String[] args) { GetAllDirs dirs = new GetAllDirs(); File current = new File("."); dirs.getAllDirs(current); } }

    Read the article

  • Java: how to initialize private final int value with if-else in constructor?

    - by HH
    $ javac InitInt.java InitInt.java:7: variable right might not have been initialized InitInt(){} ^ 1 error $ cat InitInt.java import java.util.*; import java.io.*; public class InitInt { private final int right; InitInt(){} public static void main(String[] args) { // I don't want to assign any value. // just initialize it, how? InitInt test = new InitInt(); System.out.println(test.getRight()); // later assiging a value } public int getRight(){return right;} } Initialization problem with Constructor, due to if-else -loop InitInt{ // Still the error, "may not be initialized" // How to initialise it, without removing if-else? if(snippetBuilder.length()>(charwisePos+25)){ right=charwisePos+25; }else{ right=snippetBuilder.length()-1; } }

    Read the article

  • Java compiler error: "cannot find symbol" when trying to access local variable

    - by HH
    $ javac GetAllDirs.java GetAllDirs.java:16: cannot find symbol symbol : variable checkFile location: class GetAllDirs System.out.println(checkFile.getName()); ^ 1 error $ cat GetAllDirs.java import java.util.*; import java.io.*; public class GetAllDirs { public void getAllDirs(File file) { if(file.isDirectory()){ System.out.println(file.getName()); File checkFile = new File(file.getCanonicalPath()); }else if(file.isFile()){ System.out.println(file.getName()); File checkFile = new File(file.getParent()); }else{ // checkFile should get Initialized at least HERE! File checkFile = file; } System.out.println(file.getName()); // WHY ERROR HERE: checkfile not found System.out.println(checkFile.getName()); } public static void main(String[] args) { GetAllDirs dirs = new GetAllDirs(); File current = new File("."); dirs.getAllDirs(current); } }

    Read the article

  • Problem with greek characters using java

    - by Subhendu Mahanta
    I am trying to write greek characters to a file using java like this: String greek = "\u03c1\u03ae\u03bc. \u03c7\u03b1\u03b9\u03c1\u03b5\u03c4\u03ce"; try { BufferedWriter out = new BufferedWriter(new FileWriter("E:\\properties\\outfilename.txt")); out.write(greek); out.close(); } catch (IOException e) { } Not working. Tried to use javac -encoding ISO-8859-7. Also tried java -Dfile.encoding=ISO-8859-7. Assuming that as I do not have greek font in my pc, I downloaded achillies (greek font - Ach4.ttf).Installed it by going to control panel fonts. Any ideas?

    Read the article

  • Problem making ant compile my classes present in different Eclipse projects into single destination

    - by KCore
    I have close to about 20 projects in my Eclipse workspace. They are interdependent. Now I want to build all of them in a single war file. The thing is eclipse does it nicely... if I create a Dynamic Web Project and link sources of all the 20 projects. But I want to automate the entire process and want to be able to run a script (ant maybe..) and deploy a war in my app server. My approach: I started with a simple approach. I tried to sequentially build each project (javac task) with destination directory as web-inf of my war. But it is giving me weird errors like : package " ** " not found,when it shows the same all the required classes in classpath (I used verbose) Do you think, a continous integration engine will be better for my case (20 projects..) I saw Team City, but didnt get it the first time...

    Read the article

  • Java: how to initialize int without assigning a value?

    - by HH
    $ javac InitInt.java InitInt.java:9: '[' expected right = new int; ^ InitInt.java:9: ']' expected right = new int; ^ InitInt.java:13: ';' expected } ^ InitInt.java:14: ';' expected public int getRight(){return right;} ^ InitInt.java:15: reached end of file while parsing } ^ 5 errors $ cat InitInt.java import java.util.*; import java.io.*; public class InitInt { private final int right; public static void main(String[] args) { // I don't want to assign any value. // just initialize it, how? right = new int; // later assiging a value } public int getRight(){return right;} }

    Read the article

  • Using Interfaces in JNI

    - by lhw
    I am trying to use (*env)->RegisterNatives to add methods to a defined class which I then add to a callback list. The callback sender of course expects my class to implement a certain interface which I do not. And is failing on execution. If I add the keyword "implements Listener" to my class in Java the javac expects to have the methods definition in Java or with native keyword which I try to avoid here, as I'd like to register the methods within the JNI_OnLoad and execute one of them afterwards. The question now is: Can I implement the interface in JNI or avoid the error message in Java?

    Read the article

  • How to compile these 2 java files correctly?

    - by user198729
    I'm following the steps here, it's basically : Compile the DataSource and LiveStream classes: javac -d . DataSource.java LiveStream.java Run using JMStudio: java JMStudio screen://0,0,160,120/10 But when I compile them, got lots of errors like javax.media doesn't exist and so on. Here's the directory structure: D:\>dir 2010-06-11 22:25 <DIR> . 2010-06-11 22:25 <DIR> .. 2010-06-11 22:25 3,730 DataSource.java 2010-06-11 22:25 6,860 LiveStream.java Can someone give more detailed steps how to set up the environment correctly to compile correctly?

    Read the article

  • Java generics SuppressWarnings("unchecked") mystery

    - by Johannes Ernst
    Why does code alternative(1) compile without warnings, and code alternative(2) produce an "unchecked cast" warning? Common for both: class Foo<T> { Foo( T [] arg ) { } } Alternative (1): class Bar<T> extends Foo<T> { protected static final Object [] EMPTY_ARRAY = {}; @SuppressWarnings("unchecked") Bar() { super( (T []) EMPTY_ARRAY ); } } Alternative (2): class Bar<T> extends Foo<T> { @SuppressWarnings("unchecked") Bar() { super( (T []) EMPTY_ARRAY ); } protected static final Object [] EMPTY_ARRAY = {}; } Alternative (2) produces: javac -Xlint:unchecked Foo.java Bar.java Bar.java:4: warning: [unchecked] unchecked cast super( (T []) EMPTY_ARRAY ); ^ required: T[] found: Object[] where T is a type-variable: T extends Object declared in class Bar 1 warning This is: java version "1.7.0_07" Java(TM) SE Runtime Environment (build 1.7.0_07-b10) Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

    Read the article

  • HOw I can verify my SQL / SQL Pl syntax

    - by rima
    Hi all Sorry my English is bad.I hope u can get what I want. I have lots of *.sql files that i want to write a program to compile them and if there is any issue(problem or mistake) report me. One of my friend write an IDE for java,as I remember he use javac to generate the codes error,in other hand maybe u see when u try to write code in a Visual stadio or Netbean the IDE generate errors for u.so now I want to know any one have any idea how I can do it for my sql files? In other mean I want to write a Editor for SQL files(PL/SQL) that compile my code and tell me what is my error. this problem raise up when I try to compile all of them in SQL PLUS,it's so boring. please help me...

    Read the article

  • Compiling and executing through commandLine shows NoClassDefFoundError when trying to find Java pack

    - by eruina
    I have a client/server program that attempts to send and receive an object. There are three packages: server, client and shared shared contains only the Message class I put Message.java from shared package into the same folder as calcclient package source files and calcserver package source files. I compile using the line: javac -classpath .; Message.java They can compile. Then I change directory up one level and ran with: java -classpath .; .Main When I use Netbeans to run, the entire program works as per normal. But not if I run from command line. If its executed through command line, the program will work until it needs to use the Message object. Then it will show a NoClassDefFoundError Am I putting the right files at the right places? How do I get the program to find shared package through command line?

    Read the article

  • Preferred Windows Java Development Environment

    - by JF
    I've been a Linux Java developer for years and have loved it. I just got a new laptop which is running Windows 7. I could wipe the drive and go back to my typical Linux dev setup: vim for editing, tabbed Bash windows running javac and java for smaller projects, ant for big projects That said, I'm really thinking it couldn't hurt to learn to develop in a new environment. So, with that in mind, are there any Windows-based Java devs out there? What setup do you like to use to get things done? It'd be interesting to hear both ways to emulate my Linux-based environment as well as completely different styles that I might benefit from trying.

    Read the article

  • Java: design problem with private-final-int-value and empty constructor

    - by HH
    $ javac InitInt.java InitInt.java:7: variable right might not have been initialized InitInt(){} ^ 1 error $ cat InitInt.java import java.util.*; import java.io.*; public class InitInt { private final int right; //DUE to new Klowledge: Design Problem //I think having an empty constructor like this // is an design problem, shall I remove it? What do you think? // When to use an empty constructor? InitInt(){} public static void main(String[] args) { InitInt test = new InitInt(); System.out.println(test.getRight()); } public int getRight(){return right;} } Initialization problem with Constructor InitInt{ // Still the error, "may not be initialized" // How to initialise it? if(snippetBuilder.length()>(charwisePos+25)){ right=charwisePos+25; }else{ right=snippetBuilder.length()-1; } }

    Read the article

  • Why's a simple change to rt.jar causing the Java Runtime Environment to crash silently?

    - by Tom
    This is what I'm doing: extract contents of my JRE's rt.jar extract src.zip of my JDK (same version) Now, if I copy Runtime.java from the extracted src folder and compile it using javac.exe without any modifications and then put it in the extracted rt folder to finally put everything back in a jar file using jar.exe, everything works as expected. The JRE runs fine. However, if I make the slightest change to Runtime.java and compile it and put it in rt.jar, the JRE crashes whenever I attempt to start it. This is an example of a slight change that causes the silent crash: /** Don't let anyone else instantiate this class */ private Runtime() { System.out.println("This is a test."); } Instead of: /** Don't let anyone else instantiate this class */ private Runtime() {} Could anyone tell me why this is causing my JRE to crash? Thanks in advance.

    Read the article

  • Compiling a class using Java code using process

    - by Noona
    I have this piece of code that compiles a class called tspClassName, when I compile using this code: Process compileProc = null; try { compileProc = Runtime.getRuntime().exec("javac -classpath ." + File.separator + "src" + File.separator + File.separator + "generated." + tspClassName + ".java -d ." + File.separator + "bin"); // catch exception if (compileProc.exitValue() != 0) { System.out.println("Compile exit status: " + compileProc.exitValue()); System.err.println("Compile error:" + compileProc.getErrorStream()); it outputs this: "Compile exit status: 2 Compile error:java.io.FileInputStream@17182c1" The class tspClassName.java compiles without errors otherwise, so I am guessing it has to do with the path,and in my eclipse project, the tspClassName.java resides in package homework4.generated inside src, is there something wrong with the path that I use in the code? thanks

    Read the article

  • Running a java program in linux terminal with -class path

    - by Arya
    Hello I've been trying for an hour to run the following program with a the postgresql classpath class Test{ public static void main(String[] args){ try { Class.forName("org.postgresql.Driver"); } catch (ClassNotFoundException cnfe) { System.err.println("Couldn't find Postgresql driver class!"); } } } The program compiled fine with the javac command, but I'm having a hard time running it with the postgresql classpath. I have "postgresql-9.0-801.jdbc4.jar" in the same directory as the file and I tried the following, but non of them worked java -classpath ./postgresql-9.0-801.jdbc4.jar Test java -classpath postgresql-9.0-801.jdbc4.jar Test java -classpath "postgresql-9.0-801.jdbc4.jar" Test What am I doing wrong? Regards!

    Read the article

  • Parantheses around method invokation: why is the compiler complaining about assignment?

    - by polygenelubricants
    I know why the following code doesn't compile: public class Main { public static void main(String args[]) { main((null)); // this is fine! (main(null)); // this is NOT! } } What I'm wondering is why my compiler (javac 1.6.0_17, Windows version) is complaining "The left hand side of an assignment must be a variable". I'd expect something like "Don't put parantheses around a method invokation, dummy!", instead. So why is the compiler making a totally unhelpful complaint about something that is blatantly irrelevant? Is this the result of an ambiguity in the grammar? A bug in the compiler? If it's the former, could you design a language such that a compiler would never be so off-base about a syntax error like this?

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13  | Next Page >