play project fail to run in the Netbeans - java

this question is similiar to another question(http://stackoverflow.com/questions/11683802/cannot-run-play-framework-project-on-netbeans-7-2-ide)
When I use play-1.2.5, my project fail to run in Netbeans 7.
But when I change the play version to 1.2.4,it run success.
Here is the Exception when I run the project in netbenas 7 with play-1.2.5 framework
E:\play-1.2.5\id doesn't exist
Listening for transport dt_socket at address: 8000
java.lang.NoClassDefFoundError: ${jvm/memory}
Caused by: java.lang.ClassNotFoundException: ${jvm.memory}
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: ${jvm.memory}. Program will exit.
Exception in thread "main" Java Result: 1

add this to your application.conf
jvm.memory=-Xmx256M

Try increasing the heap size for the JVM.

Related

Can't run Java program from Terminal

I recently created and compiled a Java program, but it will not run from the Terminal. It isn't the program, because it WILL run from Eclipse. This is what I get from Terminal when I attempt to run the program:
Grants-MBP:~ Grant$ java /Users/Grant/Desktop/Pythagorean
Exception in thread "main" java.lang.NoClassDefFoundError: /Users/Grant/Desktop/Pythagorean
Caused by: java.lang.ClassNotFoundException: .Users.Grant.Desktop.Pythagorean
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
navigate to the desktop folder
cd /Users/Grant/Desktop/
invoke java using
java Pythagorean

Java Error when trying to start stardog server

When I try to start my stardog-server, my terminal shows me following Java-Error
Exception in thread "main" java.lang.NoClassDefFoundError: com/complexible/stardog/cli/admin/CLI
Caused by: java.lang.ClassNotFoundException: com.complexible.stardog.cli.admin.CLI
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
I have no idea why this keeps happening, because I have gotten my stardom-server to run before, but today it started showing me this Error.
Does anybody have an idea about why this keeps happening?
I'm working on OSX Mavericks (if that helps anyone)
There seems to be a problem with the classpath.
Searching for this I found this exchange:
This is due to a bug in the stardog.bat script. If you add a semicolon to line 21 so that it reads 'set CLASSPATH=%HOMEDIR%\client\api*;%HOMEDIR%\client\cli*;%HOMEDIR%\client\http*;%HOMEDIR%\client\snarl*;%HOMEDIR%\pack\client*;%SLF4J_JARS%' this problem will be fixed.

Not Able to Compile Java Code via Command-line

I wrote some Java code that takes several arguments using Eclipse. I was able to compile and execute the code just fine by entering the arguments in the "Run configurations."
However, I need to be able to run my code via command-line. This is what I tried:
javac -g ./MyCode.java
java MyCode ./fileOne.txt ./fileTwo.txt ./fileThree.txt
And the error message:
Exception in thread "main" java.lang.NoClassDefFoundError: mypackage/MyCode
Caused by: java.lang.ClassNotFoundException: mypackage.MyCode
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
I don't understand what is going on. My code does not have any bugs when I run through Eclipse. Help?
You are not setting up the classpath properly.
http://docs.oracle.com/javase/tutorial/essential/environment/paths.html

How to run Netflix Astyanax in linux

I'm a newbie in running Java code in Linux environment. I'm trying to get the Astyanax to work on the linux machine.
I followed the instruction on https://github.com/Netflix/astyanax/wiki/Getting-Started
I have cloned the code from github, and ./gradlew build runs successfully.
I'm trying to run the AstClient in the astyanax-examples. I tried the following command:
java -cp "/home/shbash6/astyanax/astyanax-examples/build/libs/;/home/shbash6/astyanax/astyanax-cassandra/build/libs/;/home/shbash6/astyanax/astyanax-core/build/libs/;/home/shbash6/astyanax/astyanax-thrift/build/libs/" com.netflix.astyanax.examples.AstClient
under holder:
/home/shbash6/astyanax/astyanax-examples/build/classes/main
but I got the following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: com/netflix/astyanax/examples/AstClient
Caused by: java.lang.ClassNotFoundException: com.netflix.astyanax.examples.AstClient
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: com.netflix.astyanax.examples.AstClient. Program will exit.
Could anyone tell me how to fix this issue? Thanks!
Use : classpath separators on *nix platforms
java -cp "/home/shbash6/astyanax/astyanax-examples/build/libs/*:/home/shbash6/astyanax/astyanax-cassandra/build/libs/*:/home/shbash6/astyanax/astyanax-core/build/libs/*:/home/shbash6/astyanax/astyanax-thrift/build/libs/*" com.netflix.astyanax.examples.AstClient

Not able to connect MS SQL server 2008 with java

I tried to connect java with My MS SQL express, I downloaded the sqljdbc4.jar also
When I don't bother with the CLASSPATH and all and I try to execute my program( even with sqljdbc in
C:\Program Files (x86)\Java\jre6\lib
I get the following error
java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at Connect.getConnection(Connect.java:24)
at Connect.displayDbProperties(Connect.java:42)
at Connect.main(Connect.java:78)
Error Trace in getConnection() : com.microsoft.jdbc.sqlserver.SQLServerDriver
Error: No active Connection
But If I try and set the CLASSPATH variable to point to sqljdbc4.jar then ClassNotHoundExcepetion is occurring with identifying my classname.
Need immediate help. kindly respond.
I use Command line mode of invoking it, I tried setting the classpath in the system variables dialog box of windows 7. and when I do that or use set CLASSPATH="C:\temp\sqljdbc4.jar" the jre fails to recogonize the main class of my program and throws
Exception in thread "main" java.lang.NoClassDefFoundError: Connect
Caused by: java.lang.ClassNotFoundException: Connect
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: Connect. Program will exit.
So I am at a loss here.
Your problem occur because classloader has not found driver jar, how you start your program?
Have you put -cp or -classpath if it command line ? Or add to lib folder if web application ?
You should set the classpath to include the sqljdbc4.jar file. See details here.

Categories