how to solve the java error for File: (no associated file) [line: (no source location)] - windows

I'm learning java as you can probably see. I'm stuck on the first lesson I can't compile it for this error.
1./*
2.Java Hello World example.
3.*/
4.
5.public class HelloWorldExample{
6.
7. public static void main(String args[]){
8.
9. /*
10. Use System.out.println() to print on console.
11. */
12. System.out.println("Hello World !");
13.
14. }
15.
16.}
17.
18./*
19.
20.OUTPUT of the above given Java Hello World Example would be :
21.
22.Hello World !
23.
24.*/
1 error found:
File: (no associated file) [line: (no source location)]
Error: Compile exception: java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/compiler/impl/IrritantSet
please help this blind fool find the associated file, Thanks

You have misconfigured your JRE in Eclipse. It'll work if you run it outside eclipse or fix your Eclipse JRE settings.

Related

Starting a payara 5 has encountered

I have build a very simple project of hello world in
Payara 5 (5.181)
JSF 2.3
JDK 1.8
CDI 2.0
Maven
and encountered a problem
Unable to start server due following issues: Launch process failed with exit code 1
in console it throws an error of :
Error: Could not find or load main class server\payara5\glassfish.lib.grizzly-npn-bootstrap.jar
[PIC] Payara 5 Error
It seems that the Payara Tools for Eclipse suffer by several bugs that may cause this. In my case, the following workarounds helped:
The Payara installation path should not contain spaces (e.g. Program Files\Payara)
It seems that only Java 8 is supported at the time
Open the domain.xml configuration file for the domain you are trying to start (typically payara_install_path/glassfish/domains/domain1/config/domain1.xml) and search for "Xbootclasspath". You should find a couple of lines like
<jvm-options>[1.8.0|1.8.0u120]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.6.jar</jvm-options>
<jvm-options>[1.8.0u121|1.8.0u160]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.7.jar</jvm-options>
<jvm-options>[1.8.0u161|1.8.0u190]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.jar</jvm-options>
<jvm-options>[1.8.0u191|1.8.0u500]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.1.jar</jvm-options>
Depending of your installed Java version (try running java --version) and choose the appropriate line (most likely the last one). Remove the remaining lines and remove the [...] part at the beginning of the chosen line so you will get something like
<jvm-options>-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.1.jar</jvm-options>
After this, the tools seem to start normally.
The Problem is with Java version. The grizzly-npn-bootstrap-1.8.1.jar Jar is placed in bootclasspath, thats why it requires proper java version to start payara server. So remove unnecessary bootstrap jar from domain.xml.
In Windows:
1) Go To ---C:\Users\xxxx\payara5\glassfish\domains\domain1\config\domain.xml
2) According to my java verson(java version "1.8.0_191") I deleted the following lines from domain.xml. So delete according to your java version.
<jvm-options>[1.8.0|1.8.0u120]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.6.jar</jvm-options>
<jvm-options>[1.8.0u121|1.8.0u160]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.7.jar</jvm-options>
<jvm-options>[1.8.0u161|1.8.0u190]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.jar</jvm-options>
3) Remove this [1.8.0u191|1.8.0u500] part from jvm-options & Edit the line in your domain.xml(w.r.t java -version) as shown below
<jvm-options>-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.1.jar</jvm-options>
4) restart your server.
As Radkovo said, "The Payara installation path should not contain spaces (e.g. Program Files\Payara)", so I moved the Payara to the Documents folder.
Problem solved!

Unable to Build Boost.python in Visual Studio 2008. Compilation gives error

I am in a HUGE depression now! I spend 2 days trying to use boost.python . PLEASE guide me! I will explain what I did.
I have Winows 7 64 bit.
The Python is 64 bit 2.7.3 installed at C:\Python27_amd64.
Now, I take boost_1_54_0.zip and unzip in F: directory.
The I use cmd.
bootstrap
this creates project-config.jam. I edit it and insert
using msvc : 9.0 ;
using python : 2.7 : C:\Python27_amd64\python : C:\Python27_amd64\include : C:\Python27_amd64\libs ;
Now i do
.\b2
This process runs for 20 something minutes and I am told that boost has successfully been build.
After that I install boost binaries from http://sourceforge.net/projects/boost/files/boost-binaries/
The binaries get installed in C:\local\boost_1_54_0.
Now I want to create a General project.
Now, I use the code given for embedding python in C++ here
#include <boost/python.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <iostream>
namespace py = boost::python;
using namespace std;
int main()
{
// Initialize the interpreter
Py_Initialize();
py::object main_module = py::import("__main__");
py::object main_namespace = main_module.attr("__dict__");
py::exec("print 'Hello, world'", main_namespace);
py::exec("print 'Hello, world'[3:5]", main_namespace);
py::exec("print '.'.join(['1','2','3'])", main_namespace);
}
I setup the header files and library in VC++ directories to F:\boost_1_54_0\boost_1_54_0 and F:\boost_1_54_0\boost_1_54_0\stage\lib respectively.
I also setup project-->properties-->configuration properties-->C/C++-->General-->Additional Include directories to C:\Python27_amd64\include
Likewise, I also setup project-->properties-->configuration properties--> Linker--> General to C:\Python27_amd64\libs;"C:\local\boost_1_54_0\lib64-msvc-9.0" .
Now when I compile using x64 debugger. It gives me an error
Unhandled exception at 0x00000000 in test8.exe: 0xC0000005: Access violation at location 0x0000000000000000.
I am struck since last 2 days...but thats the closest I have been since then. please help me!
So you mean a runtime error, right?
I think you should first ensure, that there is no exception thrown by boost::python itself.
First try to set the try block around you python calls with a catch(...)
If exception is caught it is most probably the boost::python::error_already_set exception.
So, you then should decode it like here

jdk 1.7.25 CORBA idl build warning: Anonymous sequences and array are deprecated

My java project updated to jdk 1.7.25, over Solaris 10 environment, this is the first time seen that there is a new warning message in build log: Anonymous sequences and array are deprecated (build IDL)
problem: The main GUI(build by jdk 1.7.25) cannot been brought up
We think this maybe a problem(but not sure). The idl file is very simple:
$ cat UnsubscribeAttb.idl
//../../../proj/request/requestIfc/UnsubscribeAttb.idl
include ../../../proj/request/requestIfc/subscribeKey.idl
module requestIfc {
struct requestIfc {
bool subscribeKeys;
sequence<subscribeKey> UnsubscribeAttbList;
}
}
I put in "typedef" at the front of the last line, but build immediately gives an error complained this line, but didnot give me a specific reason. Looking for your help.
Thanks,
Curtis

Definitive Antlr Reference - Chapter 3 and AntlrWorks

I am new to Antlr and my setup is as follows: Windows 7, Java JDK 1.7.0_17, AntlrWorks 1.5, Antlr 3.5.
The AntlrWorks Help-About shows the following information:
ANTLRWorks 1.5
ANTLR 3.5
StringTemplate v3 3.2.1
StringTemplate v4 4.0.7-SNAPSHOT
Java 1.7.0_17 (Oracle Corporation)
Chapter 3 of the Definitive Antlr Reference book introduces a sample grammar for expression evaluation (Expr.g), which I downloaded from the hyperlink in the PDF version of the book.
The book recomends using AntlrWorks and I am, however when I Generate Code (Ctrl+Shift+G) in AntlrWorks it produces code without the "throws" clause.
For example, the following is generated in AntlrWorks:
// $ANTLR start "prog"
// C:\\Users\\Mark\\Documents\\output\\Expr.g:12:1: prog : ( stat )+ ;
public final void prog() throws {
try {
Note the missing code after the throws keyword...
If I generate from the command prompt using this command line:
java -cp antlr-3.5-complete.jar org.antlr.Tool Expr.g
I get this output:
// $ANTLR start "prog"
// Expr.g:12:1: prog : ( stat )+ ;
public final void prog() throws RecognitionException {
try {
My question is this - how do I get AntlrWorks to generate the same code?
This is a known issue in ANTLRWorks 1.5 which has been resolved for the next release.
#5: ANTLRworks fails to generate proper Java Code

Gallio error "An exception was thrown while exploring tests."

Hi I have a test project with Gallio 3.2 b.435 within VisualStudio 2010. Every time I launch any test the output windows pops out.
this is the error message
[error] An exception was thrown while exploring tests.
Location: C:\xxxxxxx(73)
Details: System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
this is the code at the line specified
71: [Test, ExpectedException(typeof(RulesException<Story>))]
72: public void CanNotSaveItemIfInvalid()
73: {
74: var story= new Story{ Id = 100, Tilte= "test" };
75: repository.Save(story, new MembershipUser());
76: }
This error isthrown no metter what test is under testing (the project contains 700 test)
Of course ;) the test compiles and passes and I cannot understand the error.
bye Stefano
This error is a known issue. It's due to a bug in the early version of Mono.Cecil (v0.6) that was used by the Gallio core engine. It has been fixed recently: Gallio is now using Mono.Cecil v0.9.
Please try out the latest version of Gallio (v3.2.2)

Resources