I am having problems connecting my SalesMain.java and SalesCalc.java files together so that they can use each other.
And here is the error I am getting:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: salescalc.SalesCalc
at salescalc.SalesMain.main(SalesMain.java:14) Java Result: 1 BUILD SUCCESSFUL (total time: 1 second)
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: salescalc.SalesCalc
at salescalc.SalesMain.main(SalesMain.java:14) Java Result: 1
I am really new to Java so this is all a lot for me.
Here is the code to the Main and Sales files.
Add package salescalc; at the beginning of SalesCalc.
They must be in the same package, otherwise you need to import it.
SalesMain is in the package salescalc and SalesCalc is not in any package at all. The easiest solution would be to put them both in the same package.
I think you are using NetBeans IDE. To get around this problem you have to uncheck "Compile on save" setting in the project properties (Build -> Compiling).
Check this out: http://forums.netbeans.org/post-45324.html
Related
I compiled pjsip, and now I'm trying to use pjsua2 in netbeans for an linux application. Using Swig I was able to get the java code, witch I copied as a package of my project. The project is in github on this link:
https://github.com/eduardobonfa/PjsipLinux
But when I try to run I got the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.pjsip.pjsua2.pjsua2JNI.swig_module_init()V
at org.pjsip.pjsua2.pjsua2JNI.swig_module_init(Native Method)
at org.pjsip.pjsua2.pjsua2JNI.<clinit>(pjsua2JNI.java:2619)
at org.pjsip.pjsua2.Endpoint.<init>(Endpoint.java:68)
at javaapplication3.test.main(MyAccount.java:44)
/home/eduardo/.cache/netbeans/8.2/executor-snippets/run.xml:53: Java returned: 1
BUILD FAILED (total time: 0 seconds)
What Do I need to do?
I compiled the pjsip using the following steps:
./configure --enable-shared --prefix=/usr/lib
make dep && make && make install
go to swig folder
make
Got the java code and put in my project
Am I missing something??
I'm not familiar with stanford coreNLP. I want to use one of its classes Evalb. I've imported all packages (although many of them have errors). class Evalb doesn't have any error. when I run it I got this exception :
Exception in thread "main" java.lang.ExceptionInInitializerError
at edu.stanford.nlp.international.Language.<clinit>(Language.java:15)
at edu.stanford.nlp.parser.metrics.Evalb.usage(Evalb.java:136)
at edu.stanford.nlp.parser.metrics.Evalb.main(Evalb.java:163)
Caused by: java.lang.RuntimeException: Uncompilable source code - package java.util.function does not exist
at edu.stanford.nlp.parser.lexparser.AbstractTreebankParserParams.<clinit>(AbstractTreebankParserParams.java:13)
... 3 more
Java Result: 1
I have installed JDK 1.8
How can I fix this?
I'm trying to use semantic vectors. Here are some links:
https://code.google.com/p/semanticvectors/wiki/InstallationInstructions
https://code.google.com/p/semanticvectors/
Anyway, I'm on the step where you input java pitt.search.semanticvectors.BuildIndex, but I'm lacking results.
The current part I'm following is "To Build and Search a Model".
I am able to compile the package successfully with the ant command and I did get the first step working with first setting the class path with:
export CLASSPATH=./lib/lucene-core-3.6.2.jar:./…
And then inputing
java org.apache.lucene.demo.IndexFiles -docs .
However with this next step I'm getting these errors:
user:/home/data/SemanticVectors/semant… java pitt.search.semanticvectors.BuildIndex
Exception in thread "main" java.lang.NoClassDefFoundError: pitt/search/semanticvectors/BuildIndex
Caused by: java.lang.ClassNotFoundException: pitt.search.semanticvectors.BuildIndex
at java.net.URLClassLoader$1.run(URLClassLo…
at java.security.AccessController.doPrivile… Method)
at java.net.URLClassLoader.findClass(URLCla…
at java.lang.ClassLoader.loadClass(ClassLoa…
at sun.misc.Launcher$AppClassLoader.loadCla…
at java.lang.ClassLoader.loadClass(ClassLoa…
Could not find the main class: pitt.search.semanticvectors.BuildIndex. Program will exit.
I am using a terminal on a mac OS X
As I see your post, it appears you are not providing a path to the semanticvectors-x.x.jar file as indicated in
export CLASSPATH=./lib/lucene-core-3.6.2.jar:./…
Once this change is done, it should work.
I am getting the following error when running my program. Compilation works just fine! and the program was working a min ago wht the hell is going on?! can you please help
java.lang.VerifyError: (class: FinalTest, method: <init> signature: ()V) Constructor must call super() or this()
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
at java.lang.Class.getMethod0(Class.java:2685)
at java.lang.Class.getMethod(Class.java:1620)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:484)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:476)
Exception in thread "main" Java Result: 1
Javadoc says:
Thrown when the "verifier" detects that a class file, though well
formed, contains some sort of internal inconsistency or security
problem.
As you application was running a mintute ago, it should not be a security issue. Cleanup all your .class files, rebuild your application and run it. Also, check your compilation warnings to make sure you don't have conflicting dependencies.
Just copy the whole project .. and run the new one.. It worked for me.
I get the following message when trying to execute etherpad/bin/run-local.sh:
Exception in thread "main" java.lang.NoClassDefFoundError: net/appjet/oui/main
I created CLASSPATH variable,
export CLASSPATH="/home/user/src/etherpad/trunk/infrastructure/build"
but that didn't help either. Although I can clearly see net/appjet/oui package in the build directory.
Looks like this has been figured out:
http://groups.google.com/group/etherpad-open-source-discuss/browse_thread/thread/2d877d1b585e159c