Java (not to be confused with JavaScript) is a class-based, object-oriented, strongly typed, reflective language and runtime environment (JRE). Java programs are compiled to bytecode and run in a virtual machine (JVM) enabling a "write once, run anywhere" (WORA) methodology.

learn more… | top users | synonyms (6) | java jobs

0
votes
0answers
7 views

null when using .split()

hey guys i'm very new to java, and i was wondering if someone could explain why i'm getting a random null at the beginning of my array it goes [null,r,b,o,e,r,t] not sure why it does that! any help ...
0
votes
0answers
5 views

Read Data from Web.xml using class file

i want use read data from XML context-param using java class file not servlet. for establish a connection
0
votes
0answers
2 views

Is Primefaces Mobile scalable?

Is someone using Primefaces Mobile for production? Do you recommend Primefaces Mobile for an scalable web application with million of users?
0
votes
0answers
6 views

Android Button Works Only on the second Click

I am Developing my first android Calculator app. I'm stuck with a single defect. I have added few buttons and on clicking those buttons, it will put the respectives text on the EditText Field. The ...
0
votes
1answer
7 views

How to load a property file just once and use it throughout the application in java?

I have a scenario where i need to show the success/error messages in jsp's from the controller. The controller has access to many methods and each method may return some message. These messages are ...
0
votes
1answer
20 views

Java Index Out Of Bounds Exception When Loading Tile Map

In the tool I am making to aid me in creating my new game I need to be able to load and save tile maps and edit them. When I click the mouse it will change the current tile the mouse is hovering over ...
0
votes
0answers
12 views

Eclipse Crashing on Fedora 20

I have been using Eclipse on Fedora for about a week now. But suddenly , Eclipse is crashing every time I try to write code in my .java class. Here is the crash log : uncaught ...
0
votes
3answers
29 views

How to check if Android application goes to foreground?

Is it possible to check if the Android application goes to foreground? Maybe anything callback function? Any idea or suggestions is appreciated.
0
votes
0answers
3 views

Socket.IO Client Implementation in Java in OSGI container

I am looking for socket.io client implementation in java which will be deployed on OSGI container. Could not find many options. https://github.com/Gottox/socket.io-java-client is available in java, ...
0
votes
0answers
8 views

Right Approach to Call Web Service(API) from Fragment class

I need to know, In which fragment callback method, we should call a web service by which after come back to fragment web service should not call again. For example. I have a fragment class ...
0
votes
1answer
12 views

How to perform SSL operations on port 80

I have a server.java file as: import javax.net.ssl.*; import java.io.*; //***************** public class Server { public static void main(String[] args) { try { ...
0
votes
0answers
11 views

Maintaining a parallel class hierarchy in C++

There is a certain class hierarchy and I would like to have another hierarchy having a class corresponding to every class in the former hierarchy. Note that the structure of the second hierarchy ...
-1
votes
1answer
18 views

Removing all types of comments in java file

I have a java project and i have used comments in many location in various java files in the project. Now i need to remove all type of comments : single line , multiple line comments . Please provide ...
1
vote
0answers
6 views

Save unicode characters in DB using java

I need to save some uni-code characters in Sql server 2005 DB with JDBC, When i try to save "O’CON" into DB column having type NVarchar using a stored procedure it saves "O?CON" `(where ’ character is ...
0
votes
1answer
16 views

404 not found when calling servlet from jsp

In my servlet, the path define like this: @WebServlet("/checklogin") from jsp i call this servlet by <form id="login-form" name="login" action="checklogin" method="post"> deploy to ...
2
votes
4answers
29 views

Why do we need Init() method in servlets when servlets has it Construtor?

in java Constructor is used for initialization why we need init() for initialization.... This question was asked in an Interview
0
votes
0answers
16 views

Huge spacing comes between two JPanels in java

The following is a GUI code for a Java program. On the left side I am adding some names and some checkboxes on the right side. Please see the code as it will clarify my question plus your thinking. ...
0
votes
0answers
9 views

url path to .mdb file deployed in war on Tomcat

I am trying to deploy a Ms Access .mdb file as part of the WAR on Tomcat 7. This is Java Spring MVC application. My application works when the url path to the mdb file is set to a windows directory ...
0
votes
5answers
37 views

Splitting between [ , and ]

I'm getting an error when I try to include '[' and ']' in my collection if split items. I've tried a few different variations like '\\[' for example but its still not working. It seems to have a ...
0
votes
3answers
36 views

dynamically increase row size of HTML table in java script

I am new to JavaScript and just learning the basics of it. I am doing a sample program and crated a javascript program to show some data in a html page inside div. but it is not dynamic. I have some ...
0
votes
4answers
25 views

find object by id from nested object list in java

I have a java bean class : class Node{ int id, parentId; String value; List<Node> childs; } How could i find a parent node in this hierarchy and insert a child node in the ...
0
votes
0answers
5 views

MySQL update trigger error; setting a value in an updated record

I am trying to make a trigger that sets the column last_modified to CURRENT_TIMESTAMP after an update is successfully performed on any row. I am using the h2 library in java. Here is my table ...
0
votes
1answer
11 views

How do I re-encode dynamically compiled bytes to text?

Consider the following(Sourced primarily from here): JavaCompiler compiler = ToolProvider.getSystemJavaCompiler( ); JavaFileManager manager = new MemoryFileManager( compiler.getStandardFileManager( ...
0
votes
4answers
28 views

Split the string with delimiter

I have a String as param1=HUvguys83789r8==== i have to split this with = delimiter. I have tried with String.split("=") as well as i have used StringUtils too but i cannot split it correctly. Can some ...
0
votes
2answers
17 views

Split text inside Spinner Error

I have the following item inside my Spinner: Andrew-15. The first item is the name and second is the age. So I want to split this into two parts where String1 stores Andrew and String2 stores 15. So ...
0
votes
0answers
10 views

Selenium rotate iOS device with Java

I have an issue that I cannot seem to resolve. I am writing an automated testing application in Java using JUnit/Selenium with Appium to test a website in the iOS simulator (Mobile Safari). In this ...
0
votes
0answers
12 views

why we cannot use BFS to find Topological sort

why we can't use Breadth-first-search to find Topological sort? I need an explanations for this please
0
votes
0answers
8 views

How to set the file size in JasperExportManager

I used jasper report jasper (4.7.1) to export DB data to pdf. Can any one know how to set export file size when I use JasperExportManager.
0
votes
1answer
11 views

How to mock instantiating a new object with any not null parameter with JMockit

I would like to mock the new instance of java.io.File with any not null parameter with JMockit. Here is the code newInstance("java.io.File", (String) withNotNull(), (String) withNotNull()); But it ...
0
votes
0answers
10 views

How to create a secondary index by coprocessor

I heard that one of coprocessor's jobs is creating a secondary index, but i'm not a java programmer i'm using Hbase clinet API and i hope someone give me a full java code to create a secondary index. ...
-1
votes
0answers
6 views

Webcam is launching, however 'canvas' is displaying the image only once

I am trying to utilize my laptop's webcam to capture an image for a certain application. However, although the webcam is starting up (inferring from the notification light beside my webcam), the ...
-2
votes
3answers
36 views

java I/O & exceptions - answered

Im having a bit of trouble trying to get my code to read a .dat file and use its contents to fill in the information. I am not too sure if my code below is the correct way on doing this, any ...
0
votes
0answers
36 views

controlling enum state with an index

I'm having problems using enums. I am declaring them as follows: public static enum State { STATE_1(0), STATE_2(1), STATE_3(2); int index; State(int i) { index = i; } } I ...
0
votes
3answers
39 views

java How to get the list from a string by the specified symbol?

example I have a string "123<a>3213<b>3434343<c>,example <d><1><2><3>" I want to get the inner text by the symbol "<>" how can I get the list ...
-3
votes
0answers
26 views

How to make the character use different weapons, cloths [on hold]

I'm learning Java and making my first project. I'm making a platform game, and I want the character to be able to use different weapons and clothing (hats, etc.) The only way I could think to do it is ...
0
votes
0answers
5 views

Eclipse/STS auto-correcting “new” as “newEmail”

I am using Spring Tool Suite Version: 3.5.0.RELEASE Build Id: 201404011851, which is based on Eclipse. The auto-correct works great, but it is annoying on some cases. The worst case is when I type ...
0
votes
0answers
22 views

Leaked window error with Progress Dialog even after calling dismiss

I have a menu button, that when I click it, it sends some data to the cloud. While it is sending the data, I display a progress dialog. Every thing goes swimmingly and seems to be fine and I can press ...
2
votes
1answer
28 views

Special character in Email Address throwing Exception

I have to send email to users using JavaMail API. User may have email address with apostrophe some like Michael.O’[email protected] I am getting below exception when I try to send an email ...
0
votes
0answers
16 views

Which Structure to use: To Array or To “Objectivify”? When polling data

I'm new to programming structures and attempting to push my limits of programming concepts with this next project I have. (Not for school, its my own thing) I have a few slingboxes of which have ...
0
votes
0answers
10 views

Why couldn't I read a full incoming data by using non-blocking I/O socketchannel

I am trying to testing FTP by using SocketChannel, but it is not really in my expectation. I knew that I need to setup a selector algorithm which select the OP_CONNECT, OP_READ key to perform the ...
0
votes
0answers
13 views

Android: Collect “kernel” or “dmesg” log inside android app

I want to collect "kernel" or dmesg" log in my apps; I have tried to collect using the "Runtime.getRuntime().exec" but not able returned any value. Can someone please help on this? Code snippet: ...
0
votes
0answers
5 views

Android USB Permissions, onPause, onResume - Unfortunately, System UI has stopped"

I am developing an Android application using Android Studio 0.5.2. My application is operating a USB host which appears to operate correctly - unless the device is connected (and permissions have not ...
0
votes
1answer
13 views

Having trouble creating makefile for JAVA

I'd like to try and create a makefile for my project. I am running this in linux not in windows, specifically ubuntu. This is what my project directory looks like: project_root /src ...
0
votes
2answers
18 views

Remove punctuation, preserve letters and white space - Java Regex

Tonight I'm attempting to parse words from a file, and I'd like to remove all punctuation while preserving Lower and Upper case words as well as white spaces. String alpha = ...
0
votes
0answers
6 views

Installing openjdk7-jre on debian squeeze server

I am trying to update a server to use openjdk-7-jre using apt-get install openjdk-7-jre This returns this. Reading package lists... Done Building dependency tree Reading state ...
0
votes
0answers
3 views

Windows taskkill /IM How to auto confirm exit dialog?

I call Java Runtime.getRuntime().exec("taskkill /IM xxx.exe") to auto close xxx.exe application the same with close it exit button . But it will pop up Exit confirm dialog "Are you sure to Exit ? ...
1
vote
1answer
37 views

How to detect if two images collide in Java?

I am creating a game in Java, and I am using BufferedImages to show items on the screen. These images have transparent pixels on their borders, so the objects are not squares but unique shapes. ...
0
votes
0answers
12 views

How To create packet and send to gps device?Using java

Hi I am getting the Data from the GPS device, I want to send the response back to the Gps device by creating the packet MY packet is like this. No. Field TYPE Length description 1 sMark ...
0
votes
0answers
4 views

Grails: Blazeds being started in wrong context

So I have a Grails application running BlazeDS. For some reason, it appears that my Blaze servlet is being started in a different context so to speak than the rest of my application. When I debug, I ...
0
votes
1answer
6 views

When a (non-web, non JSF) event invoke, need to update data on the browser

currently I am using javaEE7 and I have a scenario as follow. Inside my JSF webapp, I have an event listener (not JSF event) that when an event invoke, do something, then update these information to ...