Search java

134911 results
3

votes
3

answer

Java, Java VM, Java Platform, [closed]

Can someone explain the differences of the Java Platform SE (6), Java, Java VM, etc.? Thanks.
mk12
4

votes
1

answer

Java JNDI Name java:/

I'm following the tutorial: https://docs.oracle.com/javase/tutorial/jndi/index.html My adventure started while setting a JNDI name for a datasource with the WildFly application server. The name started with "java:/". I was curious on what it was and how it worked. I have Apache Directory LDAP server...
Brian
8

votes
1

answer

Java -> Clojure -> Java

I am trying to use Clojure as a scripting language from a host Java program. The idea being that the end user will be able to write Clojure scripting code that will call a domain-specific Java API. At runtime, the host Java program will evaluate the end-user's Clojure script (which will in turn call...
Marcus Junius Brutus
2

votes
2

answer

Java meaning of .java~

By typing jar -tf myJar.jar MyProject I get in the file list, besides the normal .java and .class files, also a .java~ file. I have read googling it around that it is due to some other incomplete version of the file.java. If so, How can I go ahead and remove those files? since in the real folder the...
Rollerball
1

votes
3

answer

JAVA: Basic java logic

I have been working with java just a little, but there is these small logic things that I seem to never understand and I'll give an example right away. I currently have this code: class test { public static void main(String[] args) { ST st; st = new ST(); for (int i = 0; !StdIn.isEmpty(); i++) { Str...
BrianLaguana
2

votes
2

answer

Java Calculator errors java scanner

I'm trying to make a simple calculator and need help with somthing import java.util.*; import javax.swing.*; public class HiWorld { public static void main(String[] args) { System.out.println("Type 2 Numbers"); Scanner input1 = new Scanner(System.in); Scanner input2 = new Scanner(System.in); answer...
user3546834
3

votes
2

answer

Java 8 and Java time

I know the default Java library for Codename One is now Java 8 and I am also compiling locally with Java 8. I am trying to use the new java.time API added in Java 8 (Tutorial). I see the following error at compile time: : error: package java.time does not exist Are java.time classes not included i...
3lix
4

votes
3

answer

Java compiler in java [duplicate]

Possible Duplicate: implementing a compiler in “itself” I was reading about the Java compiler and realized that it was written in Java. How can that be possible? I mean, isnt this like "Chicken and egg" problem? How can we write the compiler in the same language?
Chander Shivdasani
3

votes
2

answer

java -version vs java -fullversion

What are the differences between java -version and java -fullversion? The two do not seem to line up on my machine. C:\Users\kmort>java -fullversion java full version "1.8.0_20-b26" C:\Users\kmort>java -version java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b18) Java HotSpot...
kmort
22

votes
3

answer

java streams in Java 7

My question may be too broad and probably the answer is a simple NO, but I have to ask. Is there any equivalent implementation of (Java 8) streams* in Java 7? I am familiar with (Java 8) streams but my project requirement is to use Java 7. *Not to be confused with inputStream and outputStream.
Athafoud
5

votes
4

answer

Java calling C calling Java

I want to call a C funcion from Java using JNI. And in the C function, I want to create a JVM and call some Java objects. When I try to create the JVM, JNI_CreateJavaVM returns -1. So, I want to know if it is possible to do this. The C code is compiled to create a .so file (in linux), and the Java...
arnott
2

votes
7

answer

Arrays in Java - Core Java

In This Question A value is "everywhere" in an array if for every pair of adjacent elements in the array, at least one of the pair is that value. Return true if the given value is everywhere in the array. isEverywhere({1, 2, 1, 3}, 1) → true,coz 1 is present in(1,2) and (1,3) isEverywhere({1, 2,...
Deepak
1

votes
4

answer

Java Multiple comparision in java

Pardon me if this is a stupid question.. I was wondering if there is any support for following comparison in Java: (a, b, c .... != null) in place for : (a != null && b != null && c != null && d ! null and so on ..) I was trying to make code more readable as my code which is almost unreadable due...
Ankur Saran
1

votes
4

answer

Android-java vs PC-Java

This simple line of code gives the error "The method getTextContent() is undefined for the type Element": String color_string = ( ( Element )( ( Element )inner_node ).getElementsByTagName( "color" ).item( 0 ) ).getTextContent(); I get the error in my Android-java version, but not in my PC-Java which...
Espen
2

votes
0

answer

Split [java-se] from [java]

Are we removing the Java tag from questions not explicitly about "Java SE"? and Deleting java tag from questions tagged android+java and Delete Java tag from 100% Android related questions are all examples where there has been confusion with the java-tag regarding examples which were not about Java...
geisterfurz007
2

votes
4

answer

A riddle in java - Java

My friend gave me a riddle to solve. It goes like this: There are 100 people. Each one of them, in his turn, does the following: The first person opens all the boxes. The second person change the state to all the boxes whose number is divided by 2, without remainders. For instance, if a box is open...
David Lasry
6

votes
3

answer

Java starting another Java Application

I am in the process of building a wrapper jar for a jar that I built. It will handle updating the main application and making sure users are valid users. I am having a major issue though, because I can't get the external jar launching function working. This is what I have so far: ProcessBuilder buil...
Aaron
0

votes
2

answer

java java.lang.outofmemoryerror: java heap space

Okay so im programming a game for my A-Level computing project, and so far everything has gone okay. I finished the framework, and started implementing gameplay when i got a java.lang.OutOfMemoryError: Java heap space (full error below). I've never experienced this before, however could it be to do...
Admin Hydra
5

votes
2

answer

AES Encryption Java -> PHP -> Java

In my Android app I am communicating with a web service the data sent and responded are encrypted with AES encryption. So what I do is the following. I'm sending a base64 encoded AES encrypted JSON String to share.php Share.php will then decrypt this string and insert it into the database. After tha...
sn0ep
4

votes
1

answer

Java BigDecimal.doubleValue between Java 6 and Java 8

Case 1: In Java6 BigDecimal("0.0050000").doubleValue() returns 0.0050, and in Java 8 return value is 0.005 Case 2: In Java6 BigDecimal("0.0250000").doubleValue() returns 0.025, and in Java 8 return value is 0.025 In case 1: Java 6 returns with extra trailing zero.. Any idea?? Also how to make Java...
arunodak
1

votes
1

answer

Migrating Java Applet to Java WebStart (JNLP)

I'm going to migrate a Java Applet to be started via JNLP as a Java Web Start Application and run into some troubles/missunderstandings ... One of the resources I've got is this: 6 Migrating Java Applets to Java Web Start and JNLP: But let's start: Currently the application is an applet (JApplet) a...
PaulEdison
11

votes
1

answer

Java 8 performance VS. Java 7

I'm developing a imaging processing Java 7u80 application using C++ libraries through JNI. As I was willing to execute streams in parallel with Java 8u60, I just switched to JDK 8 and relaunched all my unit tests. Java 8u60 Overall duration: **35'408 [ms]** Java 7u80 Overall duration: **29'581 [ms]...
Hey StackExchange
11

votes
1

answer

java/lang/NoClassDefFoundError: java/lang/Object [closed]

Am facing problem with java setting. My JAVA_HOME is C:\Program Files\Java\jdk1.7.0_09 PATH is C:\Program Files\Java\jdk1.7.0_09\bin . When I try run the command java -version, it is throwing an error : Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
user1490244
1

votes
5

answer

Java developer moving into Java Desktop development

I've been writing Java web (JSF, Struts, JSR168) apps for a number of years. With the recent departure of a colleague, it looks like I'm going to be building more client applications. I've used Eclipse since the beginning and I'm really comfortable with it. It feels as though SWT is waning (just...
Jamie McIlroy
1

votes
3

answer

What and Why Java 6 & Java 7?

It's been a while when I received some of the subscription from free resource talking about the Java updates and many. I realized that Sun has been taken over by Oracle. And so Java is now in their control. Last info I received, is that Java 7 is openly released with its API for public. And I am i...
gumuruh
3

votes
1

answer

Java bytecode, java Supplier and invokedynamic argument

I have this class, and I compile it. package org.test; import java.util.function.Supplier; public class Test { static String get() { return "!!"; } public static void main(String[] args) { Supplier sup = Test::get; System.out.println(sup.get()); } } Then, trying to look into it's bytecode, I get fol...
Wyvie
3

votes
1

answer

Launch Java class from another Java application

Is there a way to launch a java class (and pass it a classpath and libary path) from within a Java application with out using Runtime.exec? I have seen: Launch a java application from another java application but need to be able to pass a CLASSPATH and libary path. I am trying to make a launcher tha...
WookooUK
19

votes
6

answer

Compile to java bytecode (without using Java)

My compilers class is creating a language that we intend to compile to Java Bytecode. We have made plenty of progress and are nearing the time where it's time for code generation. We are having problems locating information on how to create .class files from our compiler. Do you have any resources t...
Allyn
4

votes
1

answer

Browser Detection using java/Java EE

In order to achieve browser compatibility in an application I am in need of a Java class/Bean/Jar which will return the following information: current browser of user its name version the OS of the user Any thought on this will be really helpful. This should work well in latest versions of all t...
An Object
1

votes
5

answer

Correct: Java “enterprise” edition = Java “internet” edition?

I am reading books on middleware, Spring, Hibernate, etc., and am wondering myself why the developer invented a new name, i.e. "enterprise edition" for Java "web" or "internet" libraries? As I have a quite individual mindset, "enterprise" edition sounds almost like "socialist" edition... what do I n...
11

votes
7

answer

JDK = Java SE && JDK != Java EE?

Please confirm the above statement? I need to know what they are referring to when they mention JDK.
ajsie
7

votes
6

answer

Execute Java code in Java [duplicate]

Possible Duplicate: Convert String to code in Java Dynamic code execution on Java I have a String containing : "for(int i=0 ; i
Devashish Dixit
2

votes
2

answer

calling java methods from java script

I am trying to create a light weight web interface using embedded jetty to host the server, and a simple html code with a java script to display the main page, since the pages are not static depending on a condition I would need to make a call to a java code. The sample html code is as follows : f...
bhavs
4

votes
3

answer

what does **/*.java mean in java classpath

So I saw this line in the .classpath file(eclipse file) today I know *.java means any java file, but what does that **/ before it do? Does it mean to include every subfolder under src/main/java?
r0dney
2

votes
1

answer

NetBeans (Java) - loading additional .java files

So I had an assignment to write a program for the game Othello/Reversi. I used NetBeans. Now the teacher sent us a "ReversiGUI.java" file that uses my own ReversiPlay.java and loads it onto a GUI so that I can test the game with my bots etc. If I use the regular javac ReversiGUI.java and then run ja...
Cauthon
2

votes
3

answer

Java Runtime.exec() to run a java program

Here's the situation. Im creating a UI which will allow make using a genetic programming system (ECJ) easier to use. Currently you need to run a command prompt within the ECJ folder and use the commands similar to this to execute a parameter file. java ec.Evolve -file ec\app\tutorial5\tutorial5.para...
George
2

votes
0

answer

Java AST to .java file Rascal

I am wondering if there are mechanics in place to translate from a Java AST back to a Java source file inside the lang::java::m3 library. thanks!
josh
2

votes
4

answer

Java Properties File binding to Java Interface

With GWT you have stuff like this: public interface LoginConstants extends Constants { @DefaultStringValue("Wellcome to my super app") @Key("appDescription") String appDescription(); @DefaultStringValue("Ok") @Key("okButtonLabel") String okButtonLabel(); } Then you can use from your classes doing GW...
Luigi R. Viggiano
1

votes
3

answer

Java AOT + loading java classes dynamically

I'm building a plugin system for my application. I've read that anyone can decomple .class files and therefore I'm forced ot use a Ahead-Of-Time compiler (right?). The problem is that I need to load some plugin classes dynamically. Right now I'm loading all .class files in a folder and invoking a st...
Baversjo
2

votes
1

answer

Draw square in java without Java Graphics

How would we make a square pattern on a canvas, given two of its coordinates. The following function is supposed to draw a square with the given coordinates (x1,y1), (x3,y3) on the canvas of size 20x16 - public static void main(String[] args) { DrawMe(20, 16, 16, 14, 8, 14); } public static...
blahblah