Skip to content

Commit f30650a

Browse files
committed
fix: native2ascii works with local JAVA_HOME now
1 parent 946148c commit f30650a

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package io.github.todolist.core;
2+
3+
import java.io.File;
4+
5+
public class Statics {
6+
7+
public static final String JAVA_HOME = System.getenv("JAVA_HOME");
8+
public static final String NATIVE2ASCII = (JAVA_HOME != null ? JAVA_HOME : "./.jdk") + File.separator + "bin" + File.separator + "native2ascii";
9+
}

todolist-core/src/main/java/io/github/todolist/core/domain/Todo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
import javax.persistence.Temporal;
4545
import javax.persistence.TemporalType;
4646

47+
import static io.github.todolist.core.Statics.NATIVE2ASCII;
48+
4749
/**
4850
* Todo entity.
4951
*
@@ -56,9 +58,7 @@
5658
@NamedQuery(name = "findTodosByTitle", query = "SELECT t FROM Todo t where t.userId = ?1 and upper(t.title) like ?2 order by t.dueDate")
5759
})
5860
public class Todo implements Serializable {
59-
60-
// If the JAVA_HOME isn't set, use the Heroku Java location
61-
static final String NATIVE2ASCII = System.getProperty("JAVA_HOME", "./.jdk") + File.separator + "bin" + File.separator + "native2ascii";
61+
6262
@Id
6363
@GeneratedValue
6464
private long id;

0 commit comments

Comments
 (0)