I have tried downloading and placing org.eclipse.swt-3.1.jar in the plugins folder of my eclipse and also I tried editing eclipse.ini file with below lines
how do you get from launching some java code in eclipse to launching a java program from your desktop.Does one somehow wrap the code in C+ to make it a .exe? take for example Mine-Craft.Its build in Java however launches as a .exe.
For my jsp file, the code editor shows no error, but the projects window shows an error. I built my project again, cleaned the project, restart eclipse twice and summoned cthulhu. But my project still shows an error. How do I find the cause.
Eclipse project -
JSP file -
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ taglib prefix="mine" uri="DiceFunctions"%>
I'm trying to run a java program from cmd. I'm using Windows 8, java version "1.8_0_20". I've got two classes, the main class called Middleware and a secondary class, called WorkerThread, of which the main class is using functions. I've successfully compiled both .java files with javac, and created the .class file. So all files are in the same folder. However, when I attempt to run the main class with java Middleware, I get the error message: "Error: Could not find or load main class". Here's the main class:
package middleware; import java.net.*; import java.util.concurrent.*; public class Middleware { //Number of threads serving clients. private static int nr_threads = 5; private static int portNr = 6789; private static ServerSocket welcomeSocket; private static ExecutorService executor;
[code]....
My code compiles and runs fine in eclipse but on the console, I'm having troubles.
I'm getting an error trying to run a welcome app from a book. I've looked at the FAQs and can't seem to solve the issue. I'm guessing my path and/or classpath are not right. Here's my path environment variable.
I was trying to write my own version of the game SimpleDotCom from Head First Java. I have two files:
Game.java: package project_01; public class Game{ byte hitCount = 0; String result = "miss"; int counter = 0; String checkGuess(int[] location,int userGuess){
[Code] .....
The two files are in the same directory, "project_01" and the CLASSPATH environment variable is set to ".;". The game compiled but when I tried launching it with "java GameTester" it returned the error : Could not find or load main class GameTester. I know my game is horrible and probably extremely buggy but I'll fix all the bugs, etc. later, right now I just need to get it to run.
My problem is that I can compile a java HelloWorld program using javac HelloWorld.java but I cannot run the program using java HelloWorld. I didn't create the code it was developed by a professional programmer. My assignment is to compile and run, so that I see the output.
The error "cannot resolve to a variable". I get the error I just can't seem to fix the error.Presently I am working my way through the Oracle docs and that seems ok. Java for Dummies, Sams teach Yourself Java in 21 Days, plus my favorite Head First Java.
package tutorial; import java.util.*; public class HolidaySked { BitSet sked; public HolidaySked(){ sked = new BitSet (365); int [] holiday = {1,15,50,148,185,246,281, 316,326,359}; for (int i = 0; i<holiday.length; i++){ addHoliday(holiday[i]);
I've got a problem in Eclipse. The below code is a part of my program, used for (re)starting a new game. The 'public static int' statement gives the error 'This method must return a result of type int'..
public static int playAgain(){ boolean validInput = false; do { System.out.println("Would you like to play a game? Please answer 'yes' or 'no'."); String playAgain = input.next();
I downloaded this code from Head First Java. But when I tried running it on Eclipse, it gives this error message.
import javax.sound.midi.*; public class MiniMiniMusicApp { // this is the first one public static void main(String[] args) { MiniMiniMusicApp mini = new MiniMiniMusicApp(); mini.play();
[code]....
and this was the error message: Jan 02, 2015 8:10:36 PM java.util.prefs.WindowsPreferences <init>Could not open/create prefs root node Software Java SoftPrefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
I currently use Eclipse to maintain our Java application. I recently upgraded from Java 6 to Java 7. I updated my Eclipse projects to use the Java 7 .jar files. I can run the application from Eclipse via the Run Configuration.
I can also run the Ant build and it completes successfully. When I install the application on my desktop, I receive the "Java Virtual Machine Launcher: Could not find main class..." error. My CLASSPATH is set to ".".
I have been working on a home database. I was asked why I choose swing and why I did launch it on a server to make it look like a web page. How can I do this? What is the advantages of doing it that way apposed to a swing application?
Let's say, there is a simple Java application. It could either be a Swing or JavaFX or a plain Console application.
Then there are kind of X plugin jars which can be also on the classpath.
The main application (e.g. main.jar) scans the classpath for classes, which implement an plugin interface. For each found implementation it invokes some method on the interface.
The interesting part now is, that upon calling the interface method, some plugins may want to popup a JavaFX window.
And the problem is, that I can't just call Platform.runLater there, because of "java.lang.IllegalStateException: Toolkit not initialized".
And if I somehow manage to call Application.launch() (when? where?) in the plugin then there's the danger, that the second plugin gets "IllegalStateException: Application launch must not be called more than once"
I also don't want to call launch() in the main application, since it is not necessarily an JavaFX application.
Do I maybe need to start separate JVM in the plugin? Could it still communicate with the original JVM then (main.jar)?
I need to build an application that can preform measurements. So I have a measuring device that can be connected through USB (with a rs232 converter aka VCP).The manufacturer provided me with two libraries:
C++ : a library (.lib) file and a header (.h) file VB6 : a DLL (.dll) file and a list (.txt) with all the available functions
And also some demo code. Can't get the C++ code running with my Borland C++ 5.5 compiler but the VB6 code is working.What can I use to integrate into my java code.
I've been trying this for hours but it's not working. I'm trying to add the sea glass look and feel library to my project but I still get the error:
Exception in thread "main" java.lang.NoClassDefFoundError: List (wrong name: list)
What should I do? I've added the library to "project settings >Required Libraries" and did not forget to check the box. I've also imported the L&F so it can't be that.
I'm researching the viability of a project. One of the requirements is that a "play slip" will be used to read input. I've searched for open source Java libraries that utilize OMR's (optical mark reader) but to no avail. I have located a C library that fulfills the task- is there a way in Java to access/use non-native language libraries?
I am responsible for an application which the developer did not build with ANT and also, he had the libraries sitting on his local machine.
Do you have any recommendations on what I should do with these libraries, knowing they were parcelled out and sitting on his local machine instead of in the project itself (Eclipse IDE workspace)?
I am building a script in ANT but don't really know what to do with his libraries. I did get a bunch of compilation errors earlier when I did not have the libraries, but now that I have them, I don't really know where to put them.
I'm trying to make my first servlet, however since I have only installed the Java SE, the javac compiler is complaining about missing packages (javax.servlet.http...)
I've realized now that I need javax.servlet jar or class files from Java EE, but after downloading java_ee_sdk-7u1.zip from Oracle here I'm not seeing any .sh or java_ee_sdk-7-jdk7-macosx-x64.sh installer (which I saw mentioned elsewhere). The oracle page only instructs to unzip the downloaded file, and searching for javax.servlet only reveals a few files which I'm not sure what to do with:
I am not necessarily 'new' to java, however I have always used NetBeans so I am not entirely sure how to do what I need with the terminal commands. I am trying to execute a java jar file(which works perfectly on windows) on the Raspberri Pi, essentially debian linux.
As I mentioned previously, I have a java jar file which I can execute on windows, but it depends on three other libraries, namely RXTX, MySQL, and JSON. I am not positive how to compile this into a jar, or execute it in debian.
This was how I attempted to load two of those libraries, however the last line is the error I received.
Error: Could not find or load main class Automation_System.core.HAS
Specifically, the problem seems to be that I cannot use the -cp flag to indicate classpaths, and the -jar flag indicating I am executing a jar in the same command. I am not sure how to point the compiler to my main class HAS in the core package of the jar, and also to the libraries referenced.
I wrote my own class to represent univariate polynomials and it works fine, but I was quite sure I was reinventing the wheel, and should obviously like to extend my program's functionality using other kinds of mathematical object.
I've been looking and there are of course open source libraries available which contain everything I'd want to do myself, and more, and probably better, saving me a lot of work.
However the usefulness of this kind of library extends far beyond simple practice and would be invaluable in developing more complex applications.
If I were to plan to write an application that I would at some point in the future like to compile into an executable and sell, would I need to take care about any open source libraries used that the compiler relies on? If so, would it be possible at that stage to use just the API and write my own classes replicating the functionality to avoid breaking license agreements?
The library I'm looking at right now is distributed under the Apache license.
I have been working on project (developing web interface for generating dynamic reports)for that i have downloaded dynamic reports library and i want this library to be imported for my project to jsp page on netbeans 7.2 how can i do it?
My task is to implement a B-Tree data structure in Java using no libraries.
My current problem is inserting when the root is full, thus the middle key goes to root.keys[0] and then it get the left and right side which are new Nodes separating and inserting their keys. My problem is that for some reason there is a random second number when in the root and secondly my boolean leaf is always false meaning it never detects that the Tree is deeper than root.
The coding makes sense to me and I have tried printing everywhere but still can't seem to find the problem.
public class BTree { /* 1. You may not modify the public interface of this class. You may however add any additional methods and/or field which you may require to aid you in the completion of this assignment.
2. You will have to design and implement a Node class. The BTree should house Integer objects.
3. You will notice that there are some overloaded methods, some of which work for Integer objects and some with primitive type int. You have to find a way to implement the methods to work with both types. */
class BTreeNode { boolean leaf = true; int numKeys = 1; int mOrder; Integer keys[];